Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Dec 1, 2025

Summary

Prepares for #824 by ensuring users can safely upgrade→downgrade without losing access to their other workspaces.

When users upgrade to a version with new runtime types (like type: "local" without srcBaseDir for project-dir mode, or new type: "worktree") and then downgrade, the old version now shows a clear error instead of crashing.

Changes

File Change
src/common/utils/runtimeCompatibility.ts New: isIncompatibleRuntimeConfig() helper (in common/ to avoid circular deps)
src/common/types/workspace.ts Added incompatibleRuntime field to FrontendWorkspaceMetadata
src/node/config.ts Set incompatibleRuntime when loading workspace metadata
src/browser/components/AIView.tsx Display error view for incompatible workspaces
src/browser/App.tsx Pass incompatibleRuntime to AIView
src/node/runtime/runtimeFactory.ts Re-export helper + throw IncompatibleRuntimeError as safety net
src/node/services/ipcMain.ts Handle IncompatibleRuntimeError in sendMessage (fallback)
src/common/types/errors.ts Added incompatible_workspace SendMessageError type

User Experience

When clicking into an incompatible workspace, users see a centered error view:

⚠️ Incompatible Workspace
This workspace was created with a newer version of mux.
Please upgrade mux to use this workspace.

You can delete this workspace and create a new one, or upgrade mux to use it.

Testing

  • Added unit tests for isIncompatibleRuntimeConfig()
  • Added unit tests for createRuntime() throwing on incompatible configs
  • Added tests for error toast display (fallback path)
  • Added tests for non-retryable error classification

Generated with mux

@ammar-agent ammar-agent force-pushed the downgrade-compatibility-fix branch from b4d4b11 to 442a608 Compare December 1, 2025 18:41
When users upgrade to a version with new runtime types (like 'local' without
srcBaseDir for project-dir mode, or new 'worktree' type) and then downgrade,
the old version shows a clear error instead of crashing.

Changes:
- Add IncompatibleRuntimeError for workspaces from newer mux versions
- Add isIncompatibleRuntimeConfig helper to detect future configs
- Add incompatibleRuntime field to FrontendWorkspaceMetadata
- Show error in AIView when workspace is incompatible
- Add 'incompatible_workspace' SendMessageError type as fallback
- Mark incompatible_workspace as non-retryable

This prepares for #824 (Local/Worktree runtime distinction) by ensuring
users can safely downgrade without losing access to their other workspaces.
@ammar-agent ammar-agent force-pushed the downgrade-compatibility-fix branch from 442a608 to 5e30b3a Compare December 1, 2025 18:44
@ammar-agent ammar-agent force-pushed the downgrade-compatibility-fix branch from 7ffc8f0 to 012e3c1 Compare December 1, 2025 19:30
@ammario ammario merged commit 894a0d4 into main Dec 1, 2025
13 checks passed
@ammario ammario deleted the downgrade-compatibility-fix branch December 1, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants