mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Track remote plugin IDs in skill invocation analytics (#35262)
## What changed - Add `remote_plugin_id` to skill invocation facts and analytics event parameters. - Propagate the ID for both explicit and implicit plugin skill invocations. ## Testing - Cover explicit and implicit remote plugin skill invocations with analytics integration tests. GitOrigin-RevId: 3e1d25b5ff88dcff9c2b6c9fe44bca97e8778221
This commit is contained in:
1 parent
07fd04abb1
commit
0d2a0aa76b
8 files changed
+180
-31
No files matched your search
@@ -3587,6 +3587,7 @@ async fn reducer_ingests_skill_invoked_fact() {
|
||||
skill_scope: codex_protocol::protocol::SkillScope::User,
|
||||
skill_path,
|
||||
plugin_id: None,
|
||||
remote_plugin_id: None,
|
||||
invocation_type: InvocationType::Explicit,
|
||||
}],
|
||||
})),
|
||||
@@ -3605,6 +3606,7 @@ async fn reducer_ingests_skill_invoked_fact() {
|
||||
"product_client_id": TEST_PRODUCT_CLIENT_ID,
|
||||
"skill_scope": "user",
|
||||
"plugin_id": null,
|
||||
"remote_plugin_id": null,
|
||||
"repo_url": null,
|
||||
"thread_id": "thread-1",
|
||||
"turn_id": "turn-1",
|
||||
@@ -3616,7 +3618,7 @@ async fn reducer_ingests_skill_invoked_fact() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn reducer_includes_plugin_id_for_plugin_skill_invocations() {
|
||||
async fn reducer_includes_plugin_ids_for_plugin_skill_invocations() {
|
||||
let mut reducer = AnalyticsReducer::default();
|
||||
let mut events = Vec::new();
|
||||
let tracking = test_tracking_context("thread-1", "turn-1");
|
||||
@@ -3632,6 +3634,7 @@ async fn reducer_includes_plugin_id_for_plugin_skill_invocations() {
|
||||
skill_scope: codex_protocol::protocol::SkillScope::User,
|
||||
skill_path,
|
||||
plugin_id: Some("sample@test".to_string()),
|
||||
remote_plugin_id: Some("plugins~Plugin_sample".to_string()),
|
||||
invocation_type: InvocationType::Explicit,
|
||||
}],
|
||||
})),
|
||||
@@ -3641,8 +3644,11 @@ async fn reducer_includes_plugin_id_for_plugin_skill_invocations() {
|
||||
|
||||
let payload = serde_json::to_value(&events).expect("serialize events");
|
||||
assert_eq!(
|
||||
payload[0]["event_params"]["plugin_id"],
|
||||
json!("sample@test")
|
||||
(
|
||||
&payload[0]["event_params"]["plugin_id"],
|
||||
&payload[0]["event_params"]["remote_plugin_id"],
|
||||
),
|
||||
(&json!("sample@test"), &json!("plugins~Plugin_sample"))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user