From 6ab2fcc21f96bae802171d0d079029e49553d603 Mon Sep 17 00:00:00 2001 From: Hunter Bown Date: Sun, 26 Apr 2026 15:45:13 -0500 Subject: [PATCH] fix(tui): rustfmt parity + working-strip stays visible all turn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes folded into one commit (the parity failure was blocking the v0.6.2 npm publish, the strip fix is the dogfooding follow-up): 1. cargo fmt --all: subagent/mod.rs (long timeout wrapper) was over the line-length budget when committed earlier; rustfmt rewraps it. CI parity (`cargo fmt -- --check`) was failing the release pipeline. 2. footer working-strip stays visible for the entire turn: previously the strip only animated while `is_loading || is_compacting || running_agents > 0`. Between LLM rounds inside a single turn (tool execution, reasoning replay, capacity refresh) `is_loading` flickers off — and so the user saw the strip vanish for seconds at a time even though the agent was clearly still working. Widen the gate to ALSO include `runtime_turn_status == Some("in_progress")`, which only clears when `EngineEvent::TurnComplete` fires — so the strip now stays lit for the whole turn duration. --- crates/tui/src/tools/subagent/mod.rs | 9 ++++++--- crates/tui/src/tui/ui.rs | 13 +++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/tui/src/tools/subagent/mod.rs b/crates/tui/src/tools/subagent/mod.rs index 7618b62c..e7c70359 100644 --- a/crates/tui/src/tools/subagent/mod.rs +++ b/crates/tui/src/tools/subagent/mod.rs @@ -2402,9 +2402,12 @@ async fn run_subagent( top_p: None, }; - let response = tokio::time::timeout(STEP_API_TIMEOUT, runtime.client.create_message(request)) - .await - .map_err(|_| anyhow!("API call timed out after {}s", STEP_API_TIMEOUT.as_secs()))??; + let response = + tokio::time::timeout(STEP_API_TIMEOUT, runtime.client.create_message(request)) + .await + .map_err(|_| { + anyhow!("API call timed out after {}s", STEP_API_TIMEOUT.as_secs()) + })??; let mut tool_uses = Vec::new(); for block in &response.content { diff --git a/crates/tui/src/tui/ui.rs b/crates/tui/src/tui/ui.rs index a58d6564..0fd29561 100644 --- a/crates/tui/src/tui/ui.rs +++ b/crates/tui/src/tui/ui.rs @@ -3224,11 +3224,16 @@ fn render_footer(f: &mut Frame, area: Rect, app: &mut App) { } /// Whether the footer should animate the water-spout strip. Driven by the -/// underlying live-work flags (model loading, compacting, sub-agents) rather -/// than a stringly-typed status label, so adding or removing labels never -/// silently disables the animation. +/// underlying live-work flags so the strip stays visible for the *entire* +/// turn — not just the moments where bytes are streaming. `is_loading` can +/// flicker off between LLM rounds within a single turn (tool execution, +/// reasoning replay, capacity refresh, etc.), so we ALSO gate on the turn +/// itself still being in flight via `runtime_turn_status == "in_progress"`. +/// Without that, the user sees the strip vanish for seconds at a time even +/// though the agent is still working. fn footer_working_strip_active(app: &App) -> bool { - app.is_loading || app.is_compacting || running_agent_count(app) > 0 + let turn_in_progress = app.runtime_turn_status.as_deref() == Some("in_progress"); + app.is_loading || app.is_compacting || running_agent_count(app) > 0 || turn_in_progress } /// Test-only helper retained as a parity reference for `FooterWidget`'s