fix(next): let legacy workspace defaults take front-tab names

Merged
TE
14d ago
+96-19

Problem

Leo reported: "likewise the auto naming for workspaces and tabs where's that". Legacy cmux workspaces can arrive as ~ or an empty name, but NEXT only recognized workspace-N as daemon-owned. Those rows were treated as manually named, so a useful front-tab label could never reach the sidebar.

Change

Treat the empty and home-folder defaults retained by older daemons as automatic names. A meaningful front-tab label can now replace them, while a non-empty workspace title still wins. The regression coverage exercises both the model predicate and the live label rule.

Changelog

  • Fixed: legacy ~ and empty workspace defaults now accept automatic front-tab names.

Validation

  • python3 scripts/verify-local.py --only swift-syntax --swift-changed passed locally.
  • Native Swift tests are routed to the managed fleet; the exact receipt will be added before merge.

Scope

This is the small sidebar behavior fix for legacy defaults. The classic prompt/model auto-namer remains a separate structural HOLD.

Agent session: big-red


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


Summary by cubic

Fixes legacy workspace naming so ~ and empty default names on older daemons are recognized as automatic, letting front-tab labels replace them in the sidebar while preserving user-renamed names.

  • WorkspaceModel.isUnnamed(_:) treats empty and ~ names as daemon defaults only when the daemon lacks name-source provenance.
  • WorkspaceAutoName.isUserNamed and NewWorkspaceName.forLastTab gate on nameSource and nameRevision, so a user-renamed ~ survives while legacy defaults still take front-tab names.
  • forLastTab and the reader detect allowsLegacyDefaults from the daemon's workspaceNameSource capability; new daemons never treat ~ as automatic.
  • A non-empty workspace title still wins over an automatic front-tab name.
  • Adds regression tests for the model predicate, the live labeling rule, and moved last-tab naming.