Merge branch 'rhan/oob-turn-metadata' into rhan/oob-turn-steer

This commit is contained in:
rhan-oai
2026-03-31 23:49:32 -07:00
committed by GitHub
7 changed files with 45 additions and 14 deletions
@@ -262,7 +262,7 @@ async fn ingest_turn_prerequisites(
AnalyticsFact::Request {
connection_id: 7,
request_id: RequestId::Integer(3),
request: Box::new(sample_turn_start_request("thread-2", 3)),
request: Box::new(sample_turn_start_request("thread-2", /*request_id*/ 3)),
},
out,
)
@@ -271,7 +271,7 @@ async fn ingest_turn_prerequisites(
.ingest(
AnalyticsFact::Response {
connection_id: 7,
response: Box::new(sample_turn_start_response("turn-2", 3)),
response: Box::new(sample_turn_start_response("turn-2", /*request_id*/ 3)),
},
out,
)
@@ -1055,7 +1055,7 @@ async fn turn_lifecycle_emits_turn_event() {
"thread-2",
"turn-2",
AppServerTurnStatus::Completed,
None,
/*codex_error_info*/ None,
))),
&mut out,
)
@@ -1173,14 +1173,21 @@ async fn turn_does_not_emit_without_required_prerequisites() {
let mut reducer = AnalyticsReducer::default();
let mut out = Vec::new();
ingest_turn_prerequisites(&mut reducer, &mut out, false, true, false).await;
ingest_turn_prerequisites(
&mut reducer,
&mut out,
/*include_initialize*/ false,
/*include_resolved_config*/ true,
/*include_started*/ false,
)
.await;
reducer
.ingest(
AnalyticsFact::Notification(Box::new(sample_turn_completed_notification(
"thread-2",
"turn-2",
AppServerTurnStatus::Completed,
None,
/*codex_error_info*/ None,
))),
&mut out,
)
@@ -1195,14 +1202,21 @@ async fn turn_does_not_emit_without_required_prerequisites() {
let mut reducer = AnalyticsReducer::default();
let mut out = Vec::new();
ingest_turn_prerequisites(&mut reducer, &mut out, true, false, false).await;
ingest_turn_prerequisites(
&mut reducer,
&mut out,
/*include_initialize*/ true,
/*include_resolved_config*/ false,
/*include_started*/ false,
)
.await;
reducer
.ingest(
AnalyticsFact::Notification(Box::new(sample_turn_completed_notification(
"thread-2",
"turn-2",
AppServerTurnStatus::Completed,
None,
/*codex_error_info*/ None,
))),
&mut out,
)
@@ -1215,14 +1229,21 @@ async fn turn_completed_without_started_notification_emits_null_created_at() {
let mut reducer = AnalyticsReducer::default();
let mut out = Vec::new();
ingest_turn_prerequisites(&mut reducer, &mut out, true, true, false).await;
ingest_turn_prerequisites(
&mut reducer,
&mut out,
/*include_initialize*/ true,
/*include_resolved_config*/ true,
/*include_started*/ false,
)
.await;
reducer
.ingest(
AnalyticsFact::Notification(Box::new(sample_turn_completed_notification(
"thread-2",
"turn-2",
AppServerTurnStatus::Completed,
None,
/*codex_error_info*/ None,
))),
&mut out,
)
@@ -3331,7 +3331,7 @@ mod tests {
handle_turn_complete(
conversation_id,
event_turn_id.clone(),
None,
/*analytics_events_client*/ None,
&outgoing,
&thread_state,
)
@@ -3420,7 +3420,7 @@ mod tests {
handle_turn_complete(
conversation_id,
event_turn_id.clone(),
None,
/*analytics_events_client*/ None,
&outgoing,
&thread_state,
)
@@ -3684,7 +3684,7 @@ mod tests {
handle_turn_complete(
conversation_a,
a_turn1.clone(),
None,
/*analytics_events_client*/ None,
&outgoing,
&thread_state,
)
@@ -3705,7 +3705,7 @@ mod tests {
handle_turn_complete(
conversation_b,
b_turn1.clone(),
None,
/*analytics_events_client*/ None,
&outgoing,
&thread_state,
)
@@ -3716,7 +3716,7 @@ mod tests {
handle_turn_complete(
conversation_a,
a_turn2.clone(),
None,
/*analytics_events_client*/ None,
&outgoing,
&thread_state,
)
+1
View File
@@ -9078,6 +9078,7 @@ guardian_approval = true
ServerNotification::TurnStarted(TurnStartedNotification {
thread_id: thread_id.to_string(),
turn: test_turn(turn_id, TurnStatus::InProgress, Vec::new()),
created_at: 0,
})
}
@@ -677,6 +677,8 @@ mod tests {
status: TurnStatus::Completed,
error: None,
},
completed_at: 0,
duration_ms: None,
})
}
@@ -94,6 +94,7 @@ async fn live_app_server_turn_completed_clears_working_status_after_answer_item(
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
/*replay_kind*/ None,
);
@@ -418,6 +419,7 @@ async fn live_app_server_failed_turn_does_not_duplicate_error_history() {
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
/*replay_kind*/ None,
);
@@ -476,6 +478,7 @@ async fn live_app_server_stream_recovery_restores_previous_status_header() {
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
/*replay_kind*/ None,
);
@@ -530,6 +533,7 @@ async fn live_app_server_server_overloaded_error_renders_warning() {
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
/*replay_kind*/ None,
);
@@ -537,6 +537,7 @@ async fn replayed_retryable_app_server_error_keeps_turn_running() {
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
Some(ReplayKind::ThreadSnapshot),
);
@@ -687,6 +688,7 @@ async fn live_reasoning_summary_is_not_rendered_twice_when_item_completes() {
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
/*replay_kind*/ None,
);
@@ -851,6 +851,7 @@ async fn submit_user_message_queues_while_compaction_turn_is_running() {
status: AppServerTurnStatus::InProgress,
error: None,
},
created_at: 0,
}),
/*replay_kind*/ None,
);