Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions codex-rs/app-server-protocol/src/protocol/thread_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -1818,6 +1819,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -1920,6 +1922,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -1971,6 +1974,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2023,6 +2027,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2086,6 +2091,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2154,6 +2160,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2232,6 +2239,7 @@ mod tests {
})),
RolloutItem::EventMsg(EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-image".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2344,6 +2352,7 @@ mod tests {
}),
EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some("turn-1".into()),
started_at: None,
reason: TurnAbortReason::Replaced,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2583,6 +2592,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3151,6 +3161,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3193,6 +3204,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-b".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3249,6 +3261,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3291,6 +3304,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-b".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3479,6 +3493,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand All @@ -3501,6 +3516,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand All @@ -3513,6 +3529,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-b".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3551,6 +3568,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand All @@ -3573,6 +3591,7 @@ mod tests {
}),
EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some("turn-a".into()),
started_at: None,
reason: TurnAbortReason::Replaced,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3616,6 +3635,7 @@ mod tests {
}),
RolloutItem::EventMsg(EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-compact".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3878,6 +3898,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3943,6 +3964,7 @@ mod tests {
}),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -3998,6 +4020,7 @@ mod tests {
RolloutItem::ResponseItem(hook_prompt),
RolloutItem::EventMsg(EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -4079,6 +4102,7 @@ mod tests {
}),
RolloutItem::EventMsg(EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -4244,6 +4268,7 @@ mod tests {
let complete_changes = builder.handle_rollout_item_with_changes(&RolloutItem::EventMsg(
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: Some(20),
duration_ms: Some(123),
Expand Down Expand Up @@ -4324,6 +4349,7 @@ mod tests {
})),
RolloutItem::EventMsg(EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-a".into(),
started_at: None,
last_agent_message: None,
completed_at: Some(20),
duration_ms: Some(123),
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/app-server/src/bespoke_event_handling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2191,6 +2191,7 @@ mod tests {
fn turn_complete_event(turn_id: &str) -> TurnCompleteEvent {
TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: None,
completed_at: Some(TEST_TURN_COMPLETED_AT),
duration_ms: Some(TEST_TURN_DURATION_MS),
Expand All @@ -2201,6 +2202,7 @@ mod tests {
fn turn_aborted_event(turn_id: &str) -> TurnAbortedEvent {
TurnAbortedEvent {
turn_id: Some(turn_id.to_string()),
started_at: None,
reason: codex_protocol::protocol::TurnAbortReason::Interrupted,
completed_at: Some(TEST_TURN_COMPLETED_AT),
duration_ms: Some(TEST_TURN_DURATION_MS),
Expand Down
1 change: 1 addition & 0 deletions codex-rs/app-server/tests/suite/v2/thread_resume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,7 @@ async fn thread_resume_token_usage_replay_can_belong_to_interrupted_turn() -> Re
"type": "event_msg",
"payload": serde_json::to_value(EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some(interrupted_turn_id.to_string()),
started_at: None,
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/core/src/agent/control/residency_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ async fn mark_thread_completed(thread: &CodexThread) {
turn.as_ref(),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn.sub_id.clone(),
started_at: None,
last_agent_message: Some("done".to_string()),
completed_at: None,
duration_ms: None,
Expand All @@ -178,6 +179,7 @@ async fn mark_thread_interrupted(thread: &CodexThread) {
turn.as_ref(),
EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some(turn.sub_id.clone()),
started_at: None,
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
Expand Down
4 changes: 4 additions & 0 deletions codex-rs/core/src/agent/control_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ async fn on_event_updates_status_from_task_started() {
async fn on_event_updates_status_from_task_complete() {
let status = agent_status_from_event(&EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "turn-1".to_string(),
started_at: None,
last_agent_message: Some("done".to_string()),
completed_at: None,
duration_ms: None,
Expand All @@ -373,6 +374,7 @@ async fn on_event_updates_status_from_error() {
async fn on_event_updates_status_from_turn_aborted() {
let status = agent_status_from_event(&EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
started_at: None,
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2025,6 +2027,7 @@ async fn multi_agent_v2_completion_ignores_dead_direct_parent() {
tester_turn.as_ref(),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: tester_turn.sub_id.clone(),
started_at: None,
last_agent_message: Some("done".to_string()),
completed_at: None,
duration_ms: None,
Expand Down Expand Up @@ -2112,6 +2115,7 @@ async fn multi_agent_v2_completion_queues_message_for_direct_parent() {
tester_turn.as_ref(),
EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: tester_turn.sub_id.clone(),
started_at: None,
last_agent_message: Some("done".to_string()),
completed_at: None,
duration_ms: None,
Expand Down
1 change: 1 addition & 0 deletions codex-rs/core/src/codex_delegate_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async fn forward_events_filters_private_events_before_blocked_send_is_cancelled(
id: "full".to_string(),
msg: EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some("turn-1".to_string()),
started_at: None,
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/core/src/guardian/review_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,7 @@ mod tests {
id: turn_id.to_string(),
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: turn_id.to_string(),
started_at: None,
last_agent_message: last_agent_message.map(str::to_string),
completed_at: None,
duration_ms: None,
Expand All @@ -1190,6 +1191,7 @@ mod tests {
id: turn_id.to_string(),
msg: EventMsg::TurnAborted(TurnAbortedEvent {
turn_id: Some(turn_id.to_string()),
started_at: None,
reason: TurnAbortReason::Interrupted,
completed_at: None,
duration_ms: None,
Expand Down
1 change: 1 addition & 0 deletions codex-rs/core/src/guardian/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,7 @@ async fn guardian_reused_trunk_ignores_stale_prior_turn_completion() -> anyhow::
id: "stale-turn".to_string(),
msg: EventMsg::TurnComplete(TurnCompleteEvent {
turn_id: "stale-turn".to_string(),
started_at: None,
last_agent_message: Some(
"{\"risk_level\":\"high\",\"user_authorization\":\"low\",\"outcome\":\"deny\",\"rationale\":\"stale guardian rationale\"}"
.to_string(),
Expand Down
Loading
Loading