-
Notifications
You must be signed in to change notification settings - Fork 3.4k
v0.8.66: Remove blocking shell-manager locks from async TUI refresh paths #3804
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingrelease-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 workingrelease-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 async TUI loop calls blocking
std::sync::Mutex::lock()on the shell manager while refreshing the Work sidebar and shell live-output state. If a background shell path holds that lock, the UI thread can block synchronously with no async yield.Parent: #3800
Verified evidence
crates/tui/src/tui/ui.rs:refresh_active_task_panellocksapp.runtime_services.shell_managerwithshell_mgr.lock().crates/tui/src/tui/ui.rs:refresh_shell_exec_live_outputalso locks the same manager withshell_mgr.lock().Critical framing
This may be an amplifier rather than the primary fanout cause. Do not fix it with a broad, unmeasured thread offload. The target is to remove synchronous blocking from UI hot paths and prove the UI still paints while shell jobs are active.
Suggested implementation options
try_lockand skip/retain previous snapshot on contention.Acceptance criteria
std::sync::Mutex::lock()for shell manager state.Security / policy guardrails
Removing blocking UI locks must not make shell state invisible to enforcement:
try_lock/snapshot fallback is acceptable for rendering, but shell ownership, cancellation, approval state, and output capture must not depend on a successful UI refresh.