Skip to content

cmux-next: agent open --group joins the existing same-named group; a re-homed lane reuses its row - #24162

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
cmux/lane-group-reuse
Oct 22, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
cmux/lane-group-reuse

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Leo, 2026-10-22: "you also just kept adding them to same-named groups...? this doenst seem rightr"

After the big-red lane re-home, Leo's sidebar had 9 extra "GUI push · lanes" groups, one lane each and some empty. Four lanes (prompt-queue-edit, pane-motion, pr-cards, deeplink-message) each had a second row next to the old one.

agent.openSessionWorkspace (cmux agent open --group, which acpmux new --group runs) only tried the first personal group with the requested name. When that group couldn't hold the new row (a different machine row's group, or a group that exists only on the sidebar document), it made a new group with the same name, and did that again for every lane.

  • Joining a group: it now tries every listed group with that name, in any section and either organization, and joins the first that SidebarEdits.canMove allows. It makes a new group only when none can hold the row.
  • Re-homed lane: when the requested name already has a row in that group (a lane re-homed to another machine gets a new session, so a new workspace key), the new session's chat opens as a tab of that row and is selected there. The launcher's key is the tab's creation key, so running the launcher again returns the same tab.

Testing

  • 3ab027e adds AgentSessionGroupJoinTests first (red: it doesn't compile, because group(named:accepting:in:) and predecessor(named:inGroup:in:) don't exist yet).
  • bae6161 is the fix. Fleet cmux-ci compile-check --app passed on that head. The fleet package-test-lane run of AgentSessionGroupJoinTests and NewWorkspaceInGroupTests is in the comments.

Observed / Not run

  • Not run: a live re-home in the app. The new tab inside the reused row is checked by the compile and code reading, not dogfooded.
  • The extra groups and rows already on Leo's sidebar were cleaned up by hand. This PR stops new ones.

No capture: the change is which existing group a new row joins; nothing on screen is drawn differently.

Changelog

  • Fixed: cmux agent open --group joins the existing group of that name instead of making another, and a re-homed agent's chat opens in its existing sidebar row.

🤖 Generated with Claude Code
Agent session: huge-blue


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes cmux agent open --group creating duplicate same-named sidebar groups and duplicate rows for re-homed lanes.

agent.openSessionWorkspace only tried the first personal group with the requested name. When that group couldn't hold the workspace (another machine's row, or a group existing only on the sidebar document), it created a new group of the same name — repeatedly, leaving nine "GUI push · lanes" groups. It now tries every listed group with that name, in any section and either organization, and joins the first that SidebarEdits.canMove allows. A new group is made only when none can hold the row.

A re-homed lane's new session gets a new workspace key, so it used to appear as a second row next to its predecessor's. Now, when the requested name already has a row in the group, the chat opens as a tab of that row and is selected there. The predecessor row is looked up in every window's sidebar, since it can be in any of them. The launcher's key becomes the tab's creation key, so running the launcher again returns the same tab. Only this Mac's rows are candidate predecessors, since the chat opens on this Mac's daemon.

Testing

  • Adds AgentSessionGroupJoinTests, covering group selection across sections and organizations, predecessor-row lookup, and that another machine's row is never a predecessor; the live app re-home path was not dogfooded.

Written for commit 3ed9967. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 2 commits October 22, 2026 02:57
…an hold the row, and a re-homed lane finds its predecessor's row (red)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15c6d-a1d2-7fc2-9458-92b8dc48a5f1&host=huge-blue
…d the row; a re-homed lane reuses its predecessor's row

Only the first personal group of that name was tried, so a row it could not
hold (another organization or machine row) got a new same-named group each
time: nine "GUI push · lanes" groups. Now every listed group of that name is
tried, and one is made only when none can hold the row. A name that already
has a row in that group gets the new session's chat as a tab of that row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15c6d-a1d2-7fc2-9458-92b8dc48a5f1&host=huge-blue
@cursor

cursor Bot commented Oct 22, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review 3ed9967: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr24162 -f ref=cmux/lane-group-reuse -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on df74f47 to compare; do not merge until green; see lane-rules

@blacksmith-sh

blacksmith-sh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Found 17 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmpctd2ln5i/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmpyb2u76si/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs
cmux-next-ios-kit.yml runs macOS jobs on pull requests but a new push does not cancel t
he previous run; key the concurrency group on the pull request and set cancel-in-progre
ss for its pull request events/
cmux-next-ios-kit.yml runs macOS jobs on pull requests but a new push does not cancel t
he previous run; key the concurrency group on the pull request and set cancel-in-progre
ss for its pull request events
View Logs
convention violations found (ERROR lines above)./
convention violations found (ERROR lines above).
View Logs
nightly cmux-tui resolve/nightly cmux-tui resolve View Logs
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)/
test_every_submodule_free_checkout_on_an_owned_runner_resets_submodules (main.Reuse
dWorkspaceSubmodules.test_every_submodule_free_checkout_on_an_owned_runner_resets_submo
dules)
View Logs

...and 7 more test failures. View all on Blacksmith: run 39722336930, run 39722337003

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-9dzhr created for this PR by the cmux coordinator.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (Codex reviewer): SHIP at 3ed9967

Cross-family review (Codex, high effort), read-only. Earlier rounds found two defects, both fixed:

  • a remote row could be picked as the predecessor (now only this Mac's rows);
  • the lookup only searched one window (now every window's sidebar).

The reviewer confirmed:

  • nested groups are flat nodes in document order;
  • document group ids are valid for .move;
  • a workspace row id is the daemon workspace key;
  • the idempotency key and the main-actor path are right.

Title-based lane identity is the stated contract.

@teamleaderleo
teamleaderleo merged commit 6acda7a into feat-cmux-next Oct 22, 2026
@teamleaderleo
teamleaderleo deleted the cmux/lane-group-reuse branch October 22, 2026 04:56
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

teamleaderleo added a commit that referenced this pull request Oct 23, 2026
Conflicts:
- MachineRegistry: keep this branch's remoteDaemon(named:)/machine(named:among:)
  and base's tabColorName(_:badge:) (#24159); both are additive.
- AgentSessionWorkspace: base's #24162 group join (any same-named group that can
  hold the row) and predecessor-row reuse for the local open. The remote adopt
  now joins its group through base's AgentSessionWorkspace.join, so this
  branch's duplicate SidebarEdits.group(named:accepting:in:) and joinGroup are
  removed; AgentBypassBadgeTests checks AgentSessionWorkspace.group instead.
- agent_update.rs: keep the shared agent_session_start::is_chief; it now reads
  tags through base's panic-free JsonFields::field, as base's copy did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a16040-fd0b-7dd0-9487-1a3a198d9f5c&host=cosmic-gray

This branch was previously deployed

1 inactive deployment
ci-routing-agent — 3ed9967a Deployed Oct 22, 2026 by teamleaderleo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:normal Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant