cmux NEXT: a session an agent opens without --group joins its parent's sidebar group
Leo (2026-10-30): "there are still hundreds of random ass sessions that i have 0 clue what are for plus you didnt do these groups well don't we hav ebetter acpmux commands for you guys yet"
What
When an agent opens a session's workspace without a group (cmux agent open SESSION, cmux agents chat new with no workspace or pane, the MCP app_agent_open), agent.openSessionWorkspace used Cmd-N's placement. The new workspace landed in the group of whatever workspace the window happened to show, not next to the agent that started it.
Now, with no group, when the caller's own chat (the parent the action already resolves from caller.agent_session) sits in a workspace that is in a sidebar group, the new workspace goes right below the caller's workspace (WorkspaceSlot.below), so it is in that group. Nothing changes when:
--groupis given (#28730, another lane's, only normalizes those names and is untouched here),- there is no parent (a person's open, Start Agent's Return),
- the parent's workspace is loose or not listed in any window's sidebar.
Placement fallback (WindowManager+Placement.swift): when a pending placement has both a slot and the setting's rule, and the slot no longer resolves (the parent's row closed or moved before the daemon reported the new workspace), the workspace falls back to the setting's placement instead of staying wherever the daemon put it. The current-row wait (awaitsCurrentAnchor, up to 3 s) only runs when there is no slot, so a spawn that has one isn't held up. Every other caller passes a slot or a rule, never both, so they don't change.
The logic lives in domain packages, not the App: WorkspaceSlot.belowGrouped(_:in:) (CmuxNextBridge) and AgentSessionParents.workspace(of:in:) (CmuxNextAgentLanes). The handler change is a call site; CmuxNextApp's line count doesn't grow (arch-ratchet flat). The pick reads the Swift sidebar's group membership, which no Rust crate holds, so it can't move to acpmux or cmux-tui.
Prior art: open PRs touching this handler (#27786: abandon pending placement on failure; #29673: Chief subagent rows) don't change the no-group placement. #28730 covers --group names only.
Test
AgentSessionParentGroupTests.aSpawnWithoutGroupJoinsItsParentsGroup: a grouped parent gives .below(parent), and that slot resolves to a drop position inside the parent's group. A loose parent or an unlisted one gives nil (Cmd-N's placement). Red commit first (the API doesn't exist on base, so it fails to compile), then the fix. Base merged in for the NativePopupHost base-red fix (#29871), which had stopped the app compile on base.
Observed / Not run
- Observed:
scripts/cmux-next/prepush-gate.py, no new violations. Fleet compile and the suite run are listed in a comment below. - Not run: a DEV build. Leo tries the build himself.
risk: normal (one handler's placement when no group is named). No capture: placement only, no new UI.
Changelog
Changed: a session an agent opens without a group now goes in the agent's own sidebar group, right below it.
Agent session: agent session
š¤ Generated with Claude Code