cmux-tui: workspace_group.create {reuse: true} finds the group by name instead of making one per member

Merged
TE
4d ago
+138-12

Leo: "there are still hundreds of random sessions that i have 0 clue what are for plus you didnt do these groups well don't we have better acpmux commands for you guys yet"

His sidebar had about fifteen "Leads" groups holding one workspace each, and four "UI think tank" groups. Agents build groups with workspace_group_create {name} and then workspace_place per member, as the code-mode guide says. That op always makes a new group, so an agent that asked for "Leads" once per lane got one "Leads" per lane.

Change

  • workspace_group.create takes reuse: true: the space's first group (in group order) whose name matches after trimming outer spaces, with case counted, answers the create, marked reused: true, and nothing is written. When no group has that name, one is made as before. Another space's group is never reused.
  • A create without reuse behaves as before (a person's New Group may want a second group with the same name).
  • cmux workspace group create --name N --reuse sends it.
  • The code-mode guide tells agents to call workspace_group_create {name, reuse: true} once, not once per member.

The app's own agent open --group path already joins an existing group by name and is unchanged here. Tidying the duplicates already on a sidebar and adding acpmux group commands are separate PRs.

Tests

  • state/group_reuse_tests.rs (red first, in the first commit): reuse answers the same group for "Leads", " Leads " and "Leads"; it makes the group when none matches, and leads (different case) is a different group; it never reuses another space's group; a plain create still makes a second group.
  • cli/command.rs: --reuse maps to reuse: true, and a plain create sends no reuse.

Agent session: agent session

šŸ¤– Generated with Claude Code


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


Summary by cubic

Adds workspace_group.create {reuse: true} so agents asking for a named group once per lane get the room's existing group of that name instead of a new one per lane. A create without reuse still makes a new group, so plain behavior is unchanged.

Key changes

  • Reuse matches the room's first group by name (outer spaces trimmed, case counts); the matched group's plain snapshot answers the create.
  • reuse is declared in the operation catalog, and the SDK binding descriptors were resynced.
  • cmux workspace group create --name N --reuse sends reuse: true.
  • The code-mode guide now tells agents to call workspace_group_create {name, reuse: true} once, not once per member.
  • Reuse never answers a group from another space.