From e5e3911799b80a8fd0382ec5130351be17f4a697 Mon Sep 17 00:00:00 2001 From: Friel Date: Sat, 28 Mar 2026 16:33:33 -0700 Subject: [PATCH] fix(tui): align watchdog spawn replay fallback --- codex-rs/tui/src/chatwidget.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 69e524a8ab..2d31961b52 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -139,6 +139,7 @@ use codex_protocol::protocol::AgentReasoningEvent; use codex_protocol::protocol::AgentReasoningRawContentDeltaEvent; #[cfg(test)] use codex_protocol::protocol::AgentReasoningRawContentEvent; +use codex_protocol::protocol::AgentSpawnMode; use codex_protocol::protocol::AgentStatus; use codex_protocol::protocol::ApplyPatchApprovalRequestEvent; #[cfg(test)] @@ -3663,9 +3664,12 @@ impl ChatWidget { .as_ref() .and_then(|metadata| metadata.agent_role.clone()), prompt: prompt.unwrap_or_default(), - spawn_mode: codex_protocol::protocol::AgentSpawnMode::Spawn, model: String::new(), reasoning_effort: ReasoningEffortConfig::Medium, + // Thread history items do not carry spawn_mode yet, so the + // replay path must choose an explicit fallback for reconstructed + // spawn rows. Plain spawn is the least surprising default. + spawn_mode: AgentSpawnMode::Spawn, status: first_receiver .as_ref() .and_then(|thread_id| agents_states.get(&thread_id.to_string()))