-
Notifications
You must be signed in to change notification settings - Fork 3.4k
v0.8.66: Make sub-agent sidebar refresh read-only and coalesced #3803
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestrelease-blockerMust be fixed before the next releaseMust be fixed before the next releasereliabilityReliability, flaky behavior, retries, fallbacks, and robustnessReliability, flaky behavior, retries, fallbacks, and robustnesssubagentsSub-agent orchestration, lifecycle, and completion handlingSub-agent orchestration, lifecycle, and completion handlingtuiTerminal UI behavior, rendering, or interactionTerminal UI behavior, rendering, or interactionv0.8.66Targeting v0.8.66Targeting v0.8.66
Milestone
Description
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or requestrelease-blockerMust be fixed before the next releaseMust be fixed before the next releasereliabilityReliability, flaky behavior, retries, fallbacks, and robustnessReliability, flaky behavior, retries, fallbacks, and robustnesssubagentsSub-agent orchestration, lifecycle, and completion handlingSub-agent orchestration, lifecycle, and completion handlingtuiTerminal UI behavior, rendering, or interactionTerminal UI behavior, rendering, or interactionv0.8.66Targeting v0.8.66Targeting v0.8.66
Projects
StatusShow more project fields
Done
Problem
The TUI requests
Op::ListSubAgentsafter event-drain batches, but the engine handles that op by taking theSubAgentManagerwrite lock, running cleanup, listing agents, and sending anAgentListevent. Under fanout/completion bursts, this refresh path contends with completion updates and persistence.Parent: #3800
Verified evidence
crates/tui/src/tui/ui.rs: trailing-edge sub-agent list refresh sendsOp::ListSubAgentsafter drain batches.crates/tui/src/core/engine.rs:Op::ListSubAgentstakesself.subagent_manager.write().await, callscleanup, thenlist, then awaitstx_event.send(Event::AgentList { ... }).crates/tui/src/tools/subagent/mod.rs: completion handling also takes the manager write lock and updates terminal state.Desired behavior
Sidebar refresh should be a cheap snapshot read, and cleanup should not run on every UI list request. Multiple refresh requests during a burst should coalesce to one latest-state update.
Suggested implementation options
ListSubAgentsinto a read-only snapshot path and a separate periodic cleanup path.AgentListdelivery latest-state/convergent rather than one event per trigger.Acceptance criteria
Op::ListSubAgentsno longer requires the manager write lock merely to render the sidebar.Security / policy guardrails
Making sidebar refresh read-only must not weaken lifecycle enforcement:
ListSubAgentsmust be paired with a periodic or event-driven cleanup path so stale children still time out and cancel.