mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Track Guardian reviewer turn and tool analytics (#41023)
## Why Trusted Guardian reviewer sessions can emit events without an app-server listener, leaving their turns and tool usage absent from analytics. ## What changed - Translate Guardian session lifecycle and canonical tool item events into analytics notifications while excluding messages, reasoning, and review content. - Preserve Guardian lineage during prewarming even when inherited client metadata is not yet available, without emitting an incomplete thread initialization event. - Limit direct session tracking to trusted Guardian children so resumed threads that have an app-server listener do not report duplicate events. ## Testing - Cover completed, failed, and interrupted Guardian turns, tool counts and timing, lineage, content exclusion, prewarmed lineage, and resumed-thread deduplication. GitOrigin-RevId: 70ace5f7ed30a7e3b6a9d6097c8b2a6a326dc4f7
This commit is contained in:
1 parent
81e180044d
commit
307ce6cda9
10 files changed
+467
-28
No files matched your search
@@ -3323,8 +3323,8 @@ fn subagent_thread_started_review_serializes_expected_shape() {
|
||||
parent_thread_id: None,
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::Subagent),
|
||||
@@ -3376,8 +3376,8 @@ fn subagent_thread_started_thread_spawn_serializes_thread_lineage() {
|
||||
parent_thread_id: Some(parent_thread_id.to_string()),
|
||||
forked_from_thread_id: Some(forked_from_thread_id.to_string()),
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: true,
|
||||
thread_source: Some(ThreadSource::Subagent),
|
||||
@@ -3416,8 +3416,8 @@ fn subagent_thread_started_memory_consolidation_serializes_expected_shape() {
|
||||
parent_thread_id: None,
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::Subagent),
|
||||
@@ -3444,8 +3444,8 @@ fn subagent_thread_started_other_serializes_expected_shape() {
|
||||
parent_thread_id: None,
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::GuardianReview),
|
||||
@@ -3472,8 +3472,8 @@ fn subagent_thread_started_other_serializes_explicit_parent_thread_id() {
|
||||
parent_thread_id: Some(parent_thread_id.to_string()),
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::GuardianReview),
|
||||
@@ -3504,8 +3504,8 @@ async fn subagent_thread_started_publishes_without_initialize() {
|
||||
parent_thread_id: None,
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::Subagent),
|
||||
@@ -3581,8 +3581,8 @@ async fn guardian_events_keep_thread_source_and_originator_with_explicit_turn_co
|
||||
parent_thread_id: Some(parent_thread_id.to_string()),
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "parent-client".to_string(),
|
||||
client_name: "parent-client".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("parent-client".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::GuardianReview),
|
||||
@@ -3718,8 +3718,8 @@ async fn subagent_tool_items_inherit_parent_connection_metadata() {
|
||||
parent_thread_id: Some("thread-1".to_string()),
|
||||
forked_from_thread_id: None,
|
||||
product_client_id: "codex-tui".to_string(),
|
||||
client_name: "codex-tui".to_string(),
|
||||
client_version: "1.0.0".to_string(),
|
||||
client_name: Some("codex-tui".to_string()),
|
||||
client_version: Some("1.0.0".to_string()),
|
||||
model: "gpt-5".to_string(),
|
||||
ephemeral: false,
|
||||
thread_source: Some(ThreadSource::Subagent),
|
||||
|
||||
Reference in new issue
Block a user