cmux NEXT sidebar: a slow group collapse save retries quietly, never a toast
Leo, on a toast in the cmux NEXT sidebar: "the heck happened here?" The toast read:
"Collapse/Expand Workspace Group did not apply: update-personal-group: timed out: workspace_group.update (no reply within 2.0 seconds)".
What happened
Collapsing a group already showed the fold on the click (SidebarRows.fold). But when the daemon's reply to workspace_group.update missed the 2 s control deadline, the app treated the timeout as a failure: it dropped the fold, resynced the sidebar back to the old look and showed a "did not apply" toast, even though a timed-out command may still apply (ActionWorkFailure.mayHaveApplied). The daemon was slow to answer because the control channel was busy (idle personal.session.put churn; #33318 removed the identical saves at the source).
Fix
A fold is this window's look, so a slow save never undoes it or shows a notice:
SidebarRowEdits.saveFold(CmuxNextSidebar) holds the fold and sends the save; a reply that only missed its deadline is sent again in the background withBackoff(about 0.5, 1, 2, 4 s;SidebarFoldPersist), with no toast.- A later click on the same group stops the earlier fold's retries, so a stale value never overwrites the newer one.
- After the last retry the hold is released quietly; the store's next echo shows what the daemon holds.
- Only a real refusal (not connected, a rejected command) still drops the fold and reports, as before.
SidebarRows.fold(App) shrinks to a call into it (App lines -6).
Loop stop conditions: the retry task ends at the first reply, a refusal, a later click on the group, cancellation, or after 4 retries (at most about 7.5 s of waits).
Design spec: sidebar (plans/cmux-next/sidebar-owner.md); no visual change.
Changelog
Fixed: Collapsing or expanding a workspace group no longer shows a "did not apply ... timed out" notice or snaps back when the background service is slow to answer.
Tests
SidebarFoldPersistTests (new): a slow reply is sent again with no report and settles on the reply; a refusal reports once with no retry; a save that never answers gives up quietly after every retry; a later click stops the earlier fold's retries. Run with GroupHeaderClickTests and SidebarHostGroupTests on the fleet (cmux-ci run --class light --script scripts/ci/package-test-lane.sh --arg=suite ...); result in a comment below.
Observed / Not run
- Observed: prepush gate clean; fleet suite run (see comment).
- Not run: a live repro of the slow daemon in a DEV build.
Agent session: agent session
🤖 Generated with Claude Code
![Autofix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/autofix-with-codesmith-dark-3x.png)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes the cmux NEXT sidebar so collapsing or expanding a workspace group no longer shows a "did not apply ... timed out" notice or snaps back when the daemon is slow to answer.
The fold shows on the click; a save that misses the 2 s control deadline is retried quietly in the background (about 0.5, 1, 2, 4 s) with no toast. A later click on the same group stops earlier retries; after the last retry the hold is released quietly and the store's next echo shows what the daemon holds. Only a genuine refusal (not connected, a rejected command) still drops the fold and reports. SidebarFoldPersistTests cover retries, refusal, silent give-up, and a later click stopping earlier retries. CmuxNextWakeups is now imported publicly where Backoff appears in public signatures, and the test target depends on it.