cmux NEXT sidebar: an agent's session with --group appears straight in its group, never in the current group first
Leo, 2026-11-01:
a lot of these asks or whatever when you guys create them it looks really odd when they pop up into some existing group on the sidebar as a workspace and then go to wherever they're supposed to go to
i feel like the animation should be less jarring/sometimes they dont need animations
What was wrong
agent.openSessionWorkspace (what acpmux new --group, cmux agent open --group and the asks reconciler's sessions go through) registered two placements for one new workspace:
- Cmd-N's
workspaces.newPlacementslot. Under the defaulttop, that is the top of the window's current group. - Then a
joininto the named group.
So the row first stood in whatever group the window was showing, then moved across on the sidebar's .move spring to its real group. That is the jump Leo saw.
A second, smaller late-metadata move: the caller's lineage parent (AgentSessionParents) was recorded only after the chat tab opened. That let the row list at top level and then nest under its caller a moment later (sidebar.lineageNesting is on by default).
Fix
- With a
groupnamed, the group join is the row's only placement (byDefaultis nil). Without a group, nothing changes: #29889's below-the-parent slot, else the setting. - The lineage parent is recorded before the create, so the row nests from its first frame.
- New-row motion is unchanged.
sidebar.insertMotionis alreadysnapby default: rows below land in place and the new row fades in at its slot. That is the quiet appearance the ask wants. The travel came only from the second placement, which is now gone.
Design spec: leo-workspace design/sidebar.md gets the rule "Never show a new workspace row anywhere but its final place" (PR linked below).
Prior art read: #29889 (an agent's spawn without --group joins its parent's group; kept as is) and #28730 (group-name matching; unchanged).
Test
AgentSessionGroupDirectPlacementTests: a window showing a workspace in group "current" while an agent opens a session with group: "lanes". The test hooks the production join and records where the row stands when the join runs. On base, the row is already in "current" at that point.
- Red at dc0c6b2108fa3261bb9afba2e5895eb720e7ddb3:
cmux-ci run --class light --script scripts/ci/package-test-lane.sh --arg=suite --arg=Packages/macOS/CmuxNext --arg=AgentSessionGroupDirectPlacementTests: failed on the fleet (step df9231c4520cd635f681f80d):Expectation failed: (seen.groupBeforeJoin β "g-current") != (.some(current.rawValue) β "g-current") - Green at the head, with AgentSessionGroupPlacementTests, AgentSessionParentGroupTests and AgentSessionGroupJoinTests at c98a891c57e59e542eea376d270071a95b18e5cd: all 4 suites passed on the fleet (step c392c7eff84d691bd963733a)
Observed / Not run
- Observed: the fleet suite runs above. Review: SHIP at c98a891c57e59e542eea376d270071a95b18e5cd (receipt comment). Follow-up: #30603.
- Not run: a nightly with an agent-created session (that is the lane's stop condition, after landing). No capture: Mac-only timing change with no new look.
Risk: low/normal. One handler's placement registration; a contained sidebar behavior fix.
Changelog
- Fixed: a session an agent opens in a sidebar group appears straight in that group, instead of first showing in the current group and then moving.
Agent session: agent session
π€ Generated with Claude Code