From 77c69e35b7a8fcabed8710f82c7e48eb7d4a5bcb Mon Sep 17 00:00:00 2001 From: Friel Date: Fri, 27 Mar 2026 20:17:28 -0700 Subject: [PATCH] fix(tui): adapt collab foundation to refreshed main Preserve the collab transcript fixtures and current TUI style rules after rebasing onto the refreshed tui_app_server codebase. Co-authored-by: Codex --- codex-rs/core/src/tools/handlers/multi_agents.rs | 1 - codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs | 2 ++ codex-rs/tui/src/chatwidget/tests.rs | 1 + codex-rs/tui/src/history_cell.rs | 6 +++--- codex-rs/tui/src/multi_agents.rs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/codex-rs/core/src/tools/handlers/multi_agents.rs b/codex-rs/core/src/tools/handlers/multi_agents.rs index e0353275a6..cfc6f30dc5 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents.rs @@ -21,7 +21,6 @@ use async_trait::async_trait; use codex_protocol::ThreadId; use codex_protocol::models::ResponseInputItem; use codex_protocol::openai_models::ReasoningEffort; -use codex_protocol::openai_models::ReasoningEffortPreset; use codex_protocol::protocol::AgentSpawnMode; use codex_protocol::protocol::CollabAgentInteractionBeginEvent; use codex_protocol::protocol::CollabAgentInteractionEndEvent; diff --git a/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs b/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs index ffe128b43e..360f5b5b8e 100644 --- a/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs +++ b/codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs @@ -5,6 +5,7 @@ use crate::agent::next_thread_spawn_depth; use crate::agent::role::DEFAULT_ROLE_NAME; use crate::agent::role::apply_role_to_config; use codex_protocol::AgentPath; +use codex_protocol::protocol::AgentSpawnMode; use codex_protocol::protocol::InterAgentCommunication; use codex_protocol::protocol::Op; @@ -170,6 +171,7 @@ impl ToolHandler for Handler { prompt, model: effective_model, reasoning_effort: effective_reasoning_effort, + spawn_mode: AgentSpawnMode::Spawn, status, } .into(), diff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rs index 3c9297fb9f..ddae7e1b03 100644 --- a/codex-rs/tui/src/chatwidget/tests.rs +++ b/codex-rs/tui/src/chatwidget/tests.rs @@ -2409,6 +2409,7 @@ async fn collab_spawn_end_shows_requested_model_and_effort() { prompt: "Explore the repo".to_string(), model: "gpt-5".to_string(), reasoning_effort: ReasoningEffortConfig::High, + spawn_mode: codex_protocol::protocol::AgentSpawnMode::Spawn, status: AgentStatus::PendingInit, }), }); diff --git a/codex-rs/tui/src/history_cell.rs b/codex-rs/tui/src/history_cell.rs index 8a16ef4b98..8b73344590 100644 --- a/codex-rs/tui/src/history_cell.rs +++ b/codex-rs/tui/src/history_cell.rs @@ -643,7 +643,7 @@ pub(crate) fn new_subagent_spawned_cell(name: &str, prompt_preview: &str) -> Pla if !preview.is_empty() { lines.push(Line::from(vec![ " └ ".dim(), - Span::from(format!("\"{preview}\"" )).dim(), + Span::from(format!("\"{preview}\"")).dim(), ])); } @@ -689,7 +689,7 @@ fn status_span_for_panel(agent: &SubagentPanelAgent) -> Span<'static> { match &agent.status { AgentStatus::PendingInit if agent.is_watchdog => "idle".dim(), AgentStatus::PendingInit | AgentStatus::Running => "running".cyan().bold(), - AgentStatus::Interrupted => "interrupted".yellow(), + AgentStatus::Interrupted => "interrupted".magenta(), AgentStatus::Completed(_) => "completed".green(), AgentStatus::Errored(_) => "errored".red(), AgentStatus::Shutdown => "shutdown".dim(), @@ -713,7 +713,7 @@ fn should_shimmer(agent: &SubagentPanelAgent, now: Instant) -> bool { fn status_label_span(status: &AgentStatus) -> Span<'static> { match status { AgentStatus::PendingInit | AgentStatus::Running => "running".cyan().bold(), - AgentStatus::Interrupted => "interrupted".yellow(), + AgentStatus::Interrupted => "interrupted".magenta(), AgentStatus::Completed(_) => "completed".green(), AgentStatus::Errored(_) => "errored".red(), AgentStatus::Shutdown => "shutdown".dim(), diff --git a/codex-rs/tui/src/multi_agents.rs b/codex-rs/tui/src/multi_agents.rs index d56e79019d..2adf136d8c 100644 --- a/codex-rs/tui/src/multi_agents.rs +++ b/codex-rs/tui/src/multi_agents.rs @@ -9,7 +9,6 @@ use crate::render::line_utils::prefix_lines; use crate::text_formatting::truncate_text; use codex_protocol::ThreadId; use codex_protocol::openai_models::ReasoningEffort as ReasoningEffortConfig; -use codex_protocol::protocol::AgentSpawnMode; use codex_protocol::protocol::AgentStatus; use codex_protocol::protocol::CollabAgentInteractionEndEvent; use codex_protocol::protocol::CollabAgentRef; @@ -583,6 +582,7 @@ fn status_summary_spans(status: &AgentStatus) -> Vec> { #[cfg(test)] mod tests { use super::*; + use codex_protocol::protocol::AgentSpawnMode; use crate::history_cell::HistoryCell; #[cfg(target_os = "macos")] use crossterm::event::KeyEvent;