You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 Fix misleading workspace ID patterns and rename to generateLegacyId (#418)
## Summary
Resolves misleading comments and patterns suggesting workspace IDs can
be constructed from project/branch names. Makes it explicit that
workspace IDs come from the backend and the old format is legacy-only.
## Changes
### 1. Fixed Misleading Comments
- **config.ts**: Updated `generateLegacyId()` (formerly
`generateWorkspaceId`) to explicitly state it's ONLY for legacy support
- **debug/git-status.ts**: Changed to use directory name only, with
clear comment this isn't how production IDs work
- **App.stories.tsx**: Updated mock IDs to use stable format (10 hex
chars) instead of `project-branch` pattern
- **E2E tests**: Added comments clarifying these test backward
compatibility
### 2. Removed Legacy Support from Debug Commands
Debug commands are internal dev tools and don't need backward
compatibility:
- **debug/list-workspaces.ts**: Display actual workspace ID from config
instead of generating legacy IDs
- **debug/agentSessionCli.ts**: Require `--workspace-id` instead of
deriving from project path
### 3. Renamed Method for Clarity
- `generateWorkspaceId()` → `generateLegacyId()` makes the legacy-only
purpose explicit
- Updated all call sites (config.ts, E2E tests, unit tests)
## Why Keep the Function?
Stable IDs were introduced only 8 days ago (Oct 16). The function is
necessary for:
- **Backward compatibility**: Users with pre-Oct-16 workspaces need
automatic migration
- **One-time migration**: When users open cmux, old workspaces
auto-migrate to config.json
- **E2E tests**: Validates backward compatibility
Cost is minimal (80 LoC, 0.5% of config.ts) and breaking workspace
access would be severe UX failure.
## Testing
- ✅ Type checking passes
- ✅ Unit tests pass (config.test.ts)
- ✅ No references to old `generateWorkspaceId` name remain
_Generated with `cmux`_
0 commit comments