mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
log plugin MCP server names (#26002)
## Summary - emit the plugin capability summary's exact MCP server names in `codex_plugin_used` ## Test - `just test -p codex-analytics` - `just test -p codex-core explicit_plugin_mentions_track_plugin_used_analytics` - `just fix -p codex-analytics`
This commit is contained in:
committed by
GitHub
Unverified
parent
0ed2735d19
commit
4d4837c495
@@ -2828,6 +2828,7 @@ fn plugin_used_event_serializes_expected_shape() {
|
||||
"mcp_server_count": 2,
|
||||
"connector_ids": ["calendar", "drive"],
|
||||
"product_client_id": originator().value,
|
||||
"mcp_server_names": ["mcp-1", "mcp-2"],
|
||||
"thread_id": "thread-3",
|
||||
"turn_id": "turn-3",
|
||||
"model_slug": "gpt-5"
|
||||
|
||||
@@ -865,6 +865,7 @@ pub(crate) struct CodexPluginMetadata {
|
||||
pub(crate) struct CodexPluginUsedMetadata {
|
||||
#[serde(flatten)]
|
||||
pub(crate) plugin: CodexPluginMetadata,
|
||||
pub(crate) mcp_server_names: Option<Vec<String>>,
|
||||
pub(crate) thread_id: Option<String>,
|
||||
pub(crate) turn_id: Option<String>,
|
||||
pub(crate) model_slug: Option<String>,
|
||||
@@ -971,8 +972,13 @@ pub(crate) fn codex_plugin_used_metadata(
|
||||
tracking: &TrackEventsContext,
|
||||
plugin: PluginTelemetryMetadata,
|
||||
) -> CodexPluginUsedMetadata {
|
||||
let mcp_server_names = plugin
|
||||
.capability_summary
|
||||
.as_ref()
|
||||
.map(|summary| summary.mcp_server_names.clone());
|
||||
CodexPluginUsedMetadata {
|
||||
plugin: codex_plugin_metadata(plugin),
|
||||
mcp_server_names,
|
||||
thread_id: Some(tracking.thread_id.clone()),
|
||||
turn_id: Some(tracking.turn_id.clone()),
|
||||
model_slug: Some(tracking.model_slug.clone()),
|
||||
|
||||
@@ -388,6 +388,10 @@ async fn explicit_plugin_mentions_track_plugin_used_analytics() -> Result<()> {
|
||||
assert_eq!(event["event_params"]["marketplace_name"], "test");
|
||||
assert_eq!(event["event_params"]["has_skills"], true);
|
||||
assert_eq!(event["event_params"]["mcp_server_count"], 0);
|
||||
assert_eq!(
|
||||
event["event_params"]["mcp_server_names"],
|
||||
serde_json::json!([])
|
||||
);
|
||||
assert_eq!(
|
||||
event["event_params"]["connector_ids"],
|
||||
serde_json::json!([])
|
||||
|
||||
Reference in New Issue
Block a user