From ced1b8aa883f25b992f9ebe7d218f3709926f912 Mon Sep 17 00:00:00 2001 From: jif Date: Wed, 10 Jun 2026 13:06:48 +0200 Subject: [PATCH] [codex] Tag multi-agent spawn metrics with version (#27375) ## Summary - tag legacy multi-agent spawn metrics with `version=v1` - tag multi-agent v2 spawn metrics with `version=v2` ## Why `codex.multi_agent.spawn` is emitted by both runtimes, so the existing metric cannot distinguish v2 adoption from aggregate multi-agent spawning. The bounded version tag makes that breakdown directly queryable without changing the counter's success-only semantics. ## Validation - `just fmt` - `git diff --check` - Tests and Clippy were intentionally left to CI. --- codex-rs/core/src/tools/handlers/multi_agents/spawn.rs | 2 +- codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs b/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs index a50d17f34..3f6c97fcb 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents/spawn.rs @@ -204,7 +204,7 @@ async fn handle_spawn_agent( turn.session_telemetry.counter( "codex.multi_agent.spawn", /*inc*/ 1, - &[("role", role_tag)], + &[("role", role_tag), ("version", "v1")], ); Ok(SpawnAgentResult { diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs index fc97df05d..34fddc60b 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs @@ -165,7 +165,7 @@ async fn handle_spawn_agent( turn.session_telemetry.counter( "codex.multi_agent.spawn", /*inc*/ 1, - &[("role", role_tag)], + &[("role", role_tag), ("version", "v2")], ); let task_name = String::from(new_agent_path);