From 2ffcc8164182453405506d9cf1ac79f191faf62d Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Thu, 9 Jul 2026 21:11:34 -0300 Subject: [PATCH] fix(app-server): initialize turn fixtures --- codex-rs/analytics/src/analytics_client_tests.rs | 3 +++ codex-rs/analytics/src/client_tests.rs | 1 + .../src/event_processor_with_human_output_tests.rs | 5 +++++ .../src/event_processor_with_jsonl_output_tests.rs | 1 + codex-rs/exec/src/lib_tests.rs | 3 +++ .../exec/tests/event_processor_with_json_output.rs | 11 +++++++++++ 6 files changed, 24 insertions(+) diff --git a/codex-rs/analytics/src/analytics_client_tests.rs b/codex-rs/analytics/src/analytics_client_tests.rs index 7b878e952c..81dad5bfc2 100644 --- a/codex-rs/analytics/src/analytics_client_tests.rs +++ b/codex-rs/analytics/src/analytics_client_tests.rs @@ -339,6 +339,7 @@ fn sample_turn_start_response(turn_id: &str) -> ClientResponsePayload { ClientResponsePayload::TurnStart(codex_app_server_protocol::TurnStartResponse { turn: Turn { id: turn_id.to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![], status: AppServerTurnStatus::InProgress, @@ -355,6 +356,7 @@ fn sample_turn_started_notification(thread_id: &str, turn_id: &str) -> ServerNot thread_id: thread_id.to_string(), turn: Turn { id: turn_id.to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![], status: AppServerTurnStatus::InProgress, @@ -390,6 +392,7 @@ fn sample_turn_completed_notification( thread_id: thread_id.to_string(), turn: Turn { id: turn_id.to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![], status, diff --git a/codex-rs/analytics/src/client_tests.rs b/codex-rs/analytics/src/client_tests.rs index ac50d6ebc7..8f6d7f38df 100644 --- a/codex-rs/analytics/src/client_tests.rs +++ b/codex-rs/analytics/src/client_tests.rs @@ -361,6 +361,7 @@ fn sample_turn_start_response() -> ClientResponsePayload { ClientResponsePayload::TurnStart(TurnStartResponse { turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: AppServerTurnStatus::InProgress, diff --git a/codex-rs/exec/src/event_processor_with_human_output_tests.rs b/codex-rs/exec/src/event_processor_with_human_output_tests.rs index 5e89d48c7f..eb489db182 100644 --- a/codex-rs/exec/src/event_processor_with_human_output_tests.rs +++ b/codex-rs/exec/src/event_processor_with_human_output_tests.rs @@ -310,6 +310,7 @@ fn turn_completed_recovers_final_message_from_turn_items() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![ThreadItem::AgentMessage { id: "msg-1".to_string(), @@ -358,6 +359,7 @@ fn turn_completed_overwrites_stale_final_message_from_turn_items() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![ThreadItem::AgentMessage { id: "msg-1".to_string(), @@ -407,6 +409,7 @@ fn turn_completed_preserves_streamed_final_message_when_turn_items_are_empty() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Completed, @@ -451,6 +454,7 @@ fn turn_failed_clears_stale_final_message() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Failed, @@ -496,6 +500,7 @@ fn turn_interrupted_clears_stale_final_message() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Interrupted, diff --git a/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs b/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs index 83cd6d3c6b..7917452db6 100644 --- a/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs +++ b/codex-rs/exec/src/event_processor_with_jsonl_output_tests.rs @@ -33,6 +33,7 @@ fn failed_turn_does_not_overwrite_output_last_message_file() { thread_id: "thread-1".to_string(), turn: codex_app_server_protocol::Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Failed, diff --git a/codex-rs/exec/src/lib_tests.rs b/codex-rs/exec/src/lib_tests.rs index fc1b713c92..395afe4d40 100644 --- a/codex-rs/exec/src/lib_tests.rs +++ b/codex-rs/exec/src/lib_tests.rs @@ -358,6 +358,7 @@ fn turn_items_for_thread_returns_matching_turn_items() { turns: vec![ codex_app_server_protocol::Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![AppServerThreadItem::AgentMessage { id: "msg-1".to_string(), @@ -373,6 +374,7 @@ fn turn_items_for_thread_returns_matching_turn_items() { }, codex_app_server_protocol::Turn { id: "turn-2".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![AppServerThreadItem::Plan { id: "plan-1".to_string(), @@ -406,6 +408,7 @@ fn should_backfill_turn_completed_items_skips_ephemeral_threads() { thread_id: "thread-1".to_string(), turn: codex_app_server_protocol::Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: codex_app_server_protocol::TurnStatus::Completed, diff --git a/codex-rs/exec/tests/event_processor_with_json_output.rs b/codex-rs/exec/tests/event_processor_with_json_output.rs index 3abdbd716b..2d4fd3ec55 100644 --- a/codex-rs/exec/tests/event_processor_with_json_output.rs +++ b/codex-rs/exec/tests/event_processor_with_json_output.rs @@ -146,6 +146,7 @@ fn turn_started_emits_turn_started_event() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::InProgress, @@ -1112,6 +1113,7 @@ fn plan_update_emits_started_then_updated_then_completed() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Completed, @@ -1172,6 +1174,7 @@ fn plan_update_after_completion_starts_new_todo_list_with_new_id() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Completed, @@ -1255,6 +1258,7 @@ fn token_usage_update_is_emitted_on_turn_completion() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Completed, @@ -1290,6 +1294,7 @@ fn turn_completion_recovers_final_message_from_turn_items() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![ThreadItem::AgentMessage { id: "msg-1".to_string(), @@ -1363,6 +1368,7 @@ fn turn_completion_reconciles_started_items_from_turn_items() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![ThreadItem::CommandExecution { id: "cmd-1".to_string(), @@ -1431,6 +1437,7 @@ fn turn_completion_overwrites_stale_final_message_from_turn_items() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![ThreadItem::AgentMessage { id: "msg-1".to_string(), @@ -1481,6 +1488,7 @@ fn turn_completion_preserves_streamed_final_message_when_turn_items_are_empty() thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Completed, @@ -1530,6 +1538,7 @@ fn failed_turn_clears_stale_final_message() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Failed, @@ -1558,6 +1567,7 @@ fn turn_completion_falls_back_to_final_plan_text() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: vec![ThreadItem::Plan { id: "plan-1".to_string(), @@ -1613,6 +1623,7 @@ fn turn_failure_prefers_structured_error_message() { thread_id: "thread-1".to_string(), turn: Turn { id: "turn-1".to_string(), + is_forkable: true, items_view: codex_app_server_protocol::TurnItemsView::Full, items: Vec::new(), status: TurnStatus::Failed,