Skip to content

Commit a4e563d

Browse files
committed
Make background tasks nonblocking in TUI
1 parent b9e4fad commit a4e563d

39 files changed

Lines changed: 1216 additions & 422 deletions

File tree

codex-rs/tui/src/app/tests.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4876,22 +4876,29 @@ async fn replace_chat_widget_reseeds_collab_agent_metadata_for_replay() {
48764876
session: None,
48774877
turns: Vec::new(),
48784878
events: vec![ThreadBufferedEvent::Notification(
4879-
ServerNotification::ItemStarted(
4880-
codex_app_server_protocol::ItemStartedNotification {
4879+
ServerNotification::ItemCompleted(
4880+
codex_app_server_protocol::ItemCompletedNotification {
48814881
thread_id: "thread-1".to_string(),
48824882
turn_id: "turn-1".to_string(),
4883-
started_at_ms: 0,
4883+
completed_at_ms: 0,
48844884
item: ThreadItem::CollabAgentToolCall {
48854885
id: "wait-1".to_string(),
48864886
tool: codex_app_server_protocol::CollabAgentTool::Wait,
4887-
status:
4888-
codex_app_server_protocol::CollabAgentToolCallStatus::InProgress,
4887+
status: codex_app_server_protocol::CollabAgentToolCallStatus::Completed,
48894888
sender_thread_id: ThreadId::new().to_string(),
48904889
receiver_thread_ids: vec![receiver_thread_id.to_string()],
48914890
prompt: None,
48924891
model: None,
48934892
reasoning_effort: None,
4894-
agents_states: HashMap::new(),
4893+
agents_states: HashMap::from([(
4894+
receiver_thread_id.to_string(),
4895+
codex_app_server_protocol::CollabAgentState {
4896+
status: codex_app_server_protocol::CollabAgentStatus::Completed,
4897+
message: Some("Done".to_string()),
4898+
agent_nickname: None,
4899+
agent_role: None,
4900+
},
4901+
)]),
48954902
},
48964903
},
48974904
),
@@ -4911,7 +4918,7 @@ async fn replace_chat_widget_reseeds_collab_agent_metadata_for_replay() {
49114918

49124919
assert!(
49134920
saw_named_wait,
4914-
"expected replayed wait item to keep agent name"
4921+
"expected replayed completed wait item to keep agent name"
49154922
);
49164923
}
49174924

0 commit comments

Comments
 (0)