Skip to content

cmux NEXT palette: Close Workspaces in Group, and Set Space Terminal Defaults asks instead of clearing - #23385

Merged
teamleaderleo merged 4 commits into
feat-cmux-nextfrom
cmux/group-close-setdefaults
Oct 21, 2026
Merged

teamleaderleo merged 4 commits into
feat-cmux-nextfrom
cmux/group-close-setdefaults

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two palette-audit fixes in cmux NEXT.

Group close titles name their noun. The palette shows these rows out of context, so each title says which group it closes:

Action Palette title
tabGroup.close Close Tab Group (already right, unchanged)
screenGroup.close Close Screen Group (already right, unchanged)
workspaceGroup.closeWorkspaces Close All Workspaces in Group → Close Workspaces in Group

Only the workspace-group title changed. The Swift defaultValue and all 21 locales in ActionCatalog.xcstrings were updated through ./scripts/localize-changes. The context-menu labels (Close Group, Close All in Group) stay as they are, since the right-clicked row already names the group. PaletteMenuVocabularyTests.groupCloseTitlesNameTheirNoun pins all three titles. No hand-written test asserted the old title.

Set Space Terminal Defaults… no longer clears the defaults silently. space.setDefaults takes only optional arguments, so the palette and the space menu ran it at once with none. A run with neither cwd nor env sent defaults: .clear, wiping the space's terminal directory and environment without asking. Now:

  • A person's run that passes neither argument (palette, space context menu) asks for the working directory inline in Cmd-Shift-P (ActionRegistry.ask, the same prompt Rename Space uses), starting from the space's current cwd. The ask carries the current env, so the answer keeps it. cmux NEXT has no separate editor sheet for space defaults; this inline palette prompt is the existing editor.
  • A CLI, MCP, socket or page run that passes neither is refused with "a cwd or env argument is required; pass both empty to clear the defaults" (new rooms.refusal.defaultsRequired, 21 locales). It no longer pops a palette prompt on the person's screen.
  • Runs that pass arguments behave as before. Clearing is still possible, but only when asked for explicitly: pass both empty (cmux space set-defaults --arg cwd= --arg env=), which is the documented "both empty clears" path.

I checked every entrypoint. The palette row, the space context menu, cmux space set-defaults, MCP app_space_set_defaults and socket action.run all reach the single RoomHandlers binding, so the guard covers all of them. Nothing else calls updateProfile(defaults:) for this.

Testing

The regression test went in first (e0b3046), then the fix (head):

Tests/CmuxNextAppTests/SpaceSetDefaultsAskTests.swift (suite SpaceSetDefaultsAskTests, CmuxNextAppTests). The test seams are ActionRegistry.argumentAsker (to see the ask), DaemonService.workTracker (to count daemon sends) and capturingRefusal.

  • fromThePaletteWithNoArgumentsItAsksAndClearsNothing: fails on base (one daemon update sent, nothing asked), passes on head.
  • automationWithNoArgumentsIsRefusedAndClearsNothing: fails on base (no refusal, one update sent), passes on head.
  • namedArgumentsStillSetAndBothEmptyStillClears: passes on both, so explicit callers keep working.

Focused command (fleet): cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref SHA --arg=suite --arg=Packages/macOS/CmuxNext --arg=CmuxNextAppTests.SpaceSetDefaultsAskTests[,CmuxNextActionsTests.PaletteMenuVocabularyTests].

  • Red: the test commit alone on base f1c7068 (ee597c06d373, branch tmp/pa-23385-red), cmux-ci step a7dcbdddbf5175df42189248: SpaceSetDefaultsAskTests failed with 4 issues, Expectation failed: (fixture.sends() → 1) == 0 and (fixture.asked() → []).first → nil for the palette run, (reason → nil) != nil and (fixture.sends() → 1) == 0 for the CLI run; the explicit-arguments test passed.
  • Green: head 7821b76 (base merged), cmux-ci step 3efd3b60f7fe8272d0ae58ef: SpaceSetDefaultsAskTests and PaletteMenuVocabularyTests both passed.

Observed / Not run

  • Observed: python3 scripts/cmux-next/prepush-gate.py reports no new violations. scripts/localization_catalog.py check reports no errors for the two touched keys (the remaining parity errors in those catalogs are on base). ./scripts/localize-changes imported all 20 non-English locales for the changed title.
  • Not run: no local build or test, per the repo rule against compiling on the person's Mac. The red and green results above ran on the fleet. The earlier head was merged with base after review (clean merge) to pick up fix(next tests): PaletteMenuVocabularyTests compiles again #23386, which made the CmuxNext test targets compile again.
  • Not regenerated: plans/cmux-next/action-surfaces.json and the captured palette fixtures (webviews/test/fixtures/palette-eval/root-entries.json, cmux-tui/.../palette-corpus.json) still show the old title. They are generated or live-captured, so they are left to their generators.

Changelog

Fixed: Set Space Terminal Defaults… asks for the working directory instead of silently clearing the space's terminal defaults, and the palette's group close reads Close Workspaces in Group

Proof

No capture: the title change is a one-word copy edit listed above, and Set Space Terminal Defaults… now opens the existing inline palette prompt (the same one as Rename Space) rather than any new UI.

Agent session: cosmic-gray

🤖 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

Fixes two palette issues in cmux NEXT: renames the workspace-group close title, and stops Set Space Terminal Defaults from wiping a space's terminal defaults when run without arguments.

space.setDefaults takes only optional arguments, so the palette and the space menu ran it with none, and a run with neither cwd nor env cleared the space's working directory and environment silently.

Behavior changes

  • A person's run with no arguments now asks for the working directory inline in Cmd-Shift-P, starting from the current cwd and carrying the current env so the answer keeps it.
  • CLI, MCP, and socket runs with no arguments are refused with "a cwd or env argument is required; pass both empty to clear the defaults".
  • Clearing stays explicit: pass both empty (cwd= env=).
  • The palette title Close All Workspaces in Group now reads Close Workspaces in Group in all 21 locales; context-menu labels are unchanged.

Added SpaceSetDefaultsAskTests covering the ask, refusal, and explicit clearing paths, and pinned the three group-close titles in PaletteMenuVocabularyTests.

Written for commit 7821b76. Summary will update on new commits.

View guided diff Turn on auto-fix

teamleaderleo and others added 3 commits October 21, 2026 05:02
The palette shows group closes out of context, so each title names the
group: Close Tab Group and Close Screen Group already did; Close All
Workspaces in Group becomes Close Workspaces in Group in all 21 locales.
Context-menu labels keep their shorter form, since the right-clicked row
names the group. A vocabulary test pins the three titles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray
Red on base: from the palette with no arguments, space.setDefaults sends
an update that clears the space's terminal defaults instead of asking,
and a CLI run with no arguments clears them too instead of refusing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray
space.setDefaults has only optional arguments, so the palette and the
space menu ran it with none, and a run with neither cwd nor env cleared
the space's terminal defaults silently. A run that names neither now
asks for the working directory in the palette, starting from the
current one and carrying the current env so the answer keeps it; a CLI,
MCP or socket run that names neither is refused with how to clear.
Clearing stays explicit: name both empty (cwd= env=), as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray
@teamleaderleo teamleaderleo added the risk:normal Risk tier (docs/ci/risk-tiers.md) label Oct 21, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Owned by palette-audit on cosmic-gray · session

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Review 7821b76: 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=pr23385 -f ref=cmux/group-close-setdefaults -f platform=macos -f backend_mode=local

Not verified: macOS jobs did not run: compile and app tests were skipped on 7821b760cf; ci-status is green without them.

CI passes on 7821b760cf (run 39601820613 attempt 1).
macOS jobs did not run: compile and app tests were skipped: Fast static checks skipped (the macos job needs both to succeed). Re-run CI once they pass, before merging.

Written by scripts/ci/classify_failures.py (ci-failure-attribution.yml); signatures are its SIGNATURES table. A machine verdict is the runner's fault, not this PR's; yours means the failing file is one this PR changes, also red on main that main's latest full suite fails the same way, seen on other PRs that it failed on another pull request's run lately.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

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

@teamleaderleo
teamleaderleo merged commit 6e17c3e into feat-cmux-next Oct 21, 2026
@teamleaderleo
teamleaderleo deleted the cmux/group-close-setdefaults branch October 21, 2026 13:10
teamleaderleo added a commit that referenced this pull request Oct 21, 2026
… non-text, and Clear asks first

Failing tests for the #23385 follow-ups:
- a cwd or env that is not text (an in-app bool, or the "true" the socket makes of a bare
  --cwd) is refused and sends nothing;
- --cwd alone keeps the space's env and --env alone keeps its cwd (real daemon);
- Clear Space Terminal Defaults… (space.clearDefaults) asks from the palette and needs
  confirm from automation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray
teamleaderleo added a commit that referenced this pull request Oct 21, 2026
…n-text, add Clear Space Terminal Defaults…

Follows #23385.
- space.setDefaults changes only the fields a run names: --cwd X keeps the space's env,
  --env alone keeps its cwd, an empty one clears that field, both empty clear. The palette's
  directory ask no longer copies env into the rerun; the merge keeps it.
- A cwd or env that is not text is refused (rooms.refusal.defaultsMustBeText), and so is a
  relative cwd (rooms.refusal.cwdMustBeAbsolute): the socket turns a bare --cwd into the
  string "true", which used to become a directory named "true".
- New destructive action space.clearDefaults ("Clear Space Terminal Defaults…", CLI
  `space clear-defaults`): the palette asks with the standard confirmation dialog while the
  space has defaults; CLI and MCP pass confirm, as for every destructive action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

teamleaderleo added a commit that referenced this pull request Oct 27, 2026
…use non-text, and Clear Space Terminal Defaults… asks first (#23461)

* test(cmux-next): space terminal defaults keep the other field, refuse non-text, and Clear asks first

Failing tests for the #23385 follow-ups:
- a cwd or env that is not text (an in-app bool, or the "true" the socket makes of a bare
  --cwd) is refused and sends nothing;
- --cwd alone keeps the space's env and --env alone keeps its cwd (real daemon);
- Clear Space Terminal Defaults… (space.clearDefaults) asks from the palette and needs
  confirm from automation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray

* fix(cmux-next): space terminal defaults merge named fields, refuse non-text, add Clear Space Terminal Defaults…

Follows #23385.
- space.setDefaults changes only the fields a run names: --cwd X keeps the space's env,
  --env alone keeps its cwd, an empty one clears that field, both empty clear. The palette's
  directory ask no longer copies env into the rerun; the merge keeps it.
- A cwd or env that is not text is refused (rooms.refusal.defaultsMustBeText), and so is a
  relative cwd (rooms.refusal.cwdMustBeAbsolute): the socket turns a bare --cwd into the
  string "true", which used to become a directory named "true".
- New destructive action space.clearDefaults ("Clear Space Terminal Defaults…", CLI
  `space clear-defaults`): the palette asks with the standard confirmation dialog while the
  space has defaults; CLI and MCP pass confirm, as for every destructive action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray

* test(cmux-tui): an action's --cwd reaches the app absolute, ~ and empty untouched

`cmux space set-defaults --cwd .` sends "." today, which the app now refuses (a space's
directory must be absolute). Also states the Default-space assumption in the Swift
clearDefaults "nothing at stake" test (review nit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray

* fix(cmux-tui): resolve an action's --cwd against the caller's directory

`cwd` joins `path` and `out` in the caller-path rewrite, so `cmux space set-defaults --cwd .`
(and --cwd on tab new, split, workspace new) reaches the app as an absolute directory instead
of one the app resolves against its own working directory or refuses. `~/…`, an empty
`--cwd=` and a bare `--cwd` are sent unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray

* Regenerate action surfaces for space.clearDefaults

From CI's cmux-next-generated-patch artifact (run 39646893133, merge ref
faf4d3a). It also carries chief.openViews, which base #22683 added without
regenerating these files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray

* Regenerate action surfaces for space.clearDefaults

From CI's cmux-next-generated-patch artifact (run 39656807210, merge ref
63c8844).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15bf1-fdc6-7623-8ee3-fa94b3900ccd&host=cosmic-gray

* cmux NEXT spaces: terminal defaults updates run in order against the daemon's defaults

Review finding: a partial Set Space Terminal Defaults run merged into the
app's mirrored room.defaults and sent the whole object, so two quick runs
(--cwd /a, then --env) both read the old mirror and the second dropped the
first's field. Set and Clear Space Terminal Defaults now run one at a time
per space, each merging its named fields into what list-personal returns
when it runs. The live test sends --cwd and --env back to back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f68ebdd9a3c1704ffb42

* cmux NEXT spaces: nonisolated deinit and a bounded stream for defaults runs

The crash-class gate flagged RoomDefaultsUpdates.Finish's plain deinit (main-actor
isolated in this target, cx-t7hu) and its unbounded AsyncStream. Finish only
finishes a Sendable continuation, so its deinit is nonisolated; the stream never
yields, so it buffers at most one element.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f68ebdd9a3c1704ffb42

* cmux NEXT spaces: Clear asks by the daemon's defaults; remote --cwd is sent as typed

Review findings on c3b37ee:
- Clear Space Terminal Defaults… skipped its question when the app's mirror showed
  no defaults, but the mirror lags a reply: set-then-clear could clear unasked. It
  now also asks while a defaults run for the space is in flight, and otherwise asks
  the daemon (listPersonal); a daemon that does not answer asks.
- The CLI resolved every action's --cwd against the caller's directory, including
  remote, cloud and agent actions whose cwd names a folder on another machine
  (`cmux open-remote HOST --cwd .`). Those now send --cwd as typed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f68ebdd9a3c1704ffb42

* cmux NEXT spaces: the defaults patch is nonisolated, so the daemon-side run can apply it

The Release compile refused RoomDefaultsUpdates' send body calling the main-actor
Patch.applied(to:) off the main actor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-f68ebdd9a3c1704ffb42

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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