Skip to content

🤖 feat: add Change SSH Host for existing workspaces#2603

Open
coadler wants to merge 3 commits intocoder:mainfrom
coadler:feat/change-ssh-host
Open

🤖 feat: add Change SSH Host for existing workspaces#2603
coadler wants to merge 3 commits intocoder:mainfrom
coadler:feat/change-ssh-host

Conversation

@coadler
Copy link
Contributor

@coadler coadler commented Feb 24, 2026

Summary

Add the ability to change the SSH host of an existing workspace from the workspace actions menu and command palette, so users don't lose chat history when a server changes address.

Background

Users who create SSH workspaces currently have no way to change the SSH host after creation. If a server changes hostname/IP or the user needs to switch machines, they must create a new workspace and lose their entire chat history. Since the runtime is recreated fresh on every sendMessage from metadata.runtimeConfig, updating runtimeConfig in config.json takes effect on the very next message — no restart needed.

Implementation

Backend (3 files):

  • Added updateRuntimeConfig IPC schema in api.ts with workspaceId + runtimeConfig input
  • Added updateRuntimeConfig() method in workspaceService.ts following the exact updateTitle pattern (validate workspace → update config → emit metadata)
  • Added router handler in router.ts wired to the service method
  • Leverages existing config.updateWorkspaceMetadata() which already accepts runtimeConfig

Frontend (8 files):

  • Added updateWorkspaceRuntimeConfig callback to WorkspaceContext following updateWorkspaceTitle pattern
  • Created ChangeSSHHostDialog.tsx — Radix Dialog that preserves all SSH config fields (srcBaseDir, identityFile, port, coder) via spread, only changing host
  • Added onChangeSSHHost menu item to WorkspaceActionsMenuContent (only shown for SSH workspaces)
  • Wired dialog in both WorkspaceMenuBar.tsx and WorkspaceListItem.tsx
  • Added ws:change-ssh-host command palette command (only visible when SSH workspaces exist) with select+text prompt pattern
  • Wired command palette callback in App.tsx

Validation

  • make static-check passes (typecheck, lint, fmt, broken-links)
image image

Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: high • Cost: $1.02

@coadler
Copy link
Contributor Author

coadler commented Feb 24, 2026

@codex review

Mux added 2 commits February 24, 2026 17:37
Add schema, service method, and router handler to allow changing a
workspace's runtime config (e.g. SSH host) without losing chat history.
The runtime is recreated fresh on every sendMessage from
metadata.runtimeConfig, so updating runtimeConfig in config.json takes
effect immediately.
…d command palette

- WorkspaceContext: add updateWorkspaceRuntimeConfig method following
  updateWorkspaceTitle pattern, wired into actionsValue useMemo
- ChangeSSHHostDialog: new Radix Dialog using existing Dialog/Button/Input
  UI primitives, resets state on open, preserves all SSH config fields
  (srcBaseDir, identityFile, port, coder) when changing host
- WorkspaceActionsMenuContent: add onChangeSSHHost prop with Globe icon,
  rendered between Edit Title and Configure MCP items
- WorkspaceMenuBar: wire sshHostDialogOpen state and pass to both menu
  content and dialog, conditionally shown for SSH workspaces
- WorkspaceListItem: same wiring as MenuBar for sidebar context menu
- commandIds: add workspaceChangeSSHHost command ID
- sources.ts: register Change SSH Host command with select+text prompt,
  only visible when SSH workspaces exist
- App.tsx: add changeSSHHostFromPalette callback that gets current
  runtimeConfig and spreads host change, wired to buildCoreSources
@coadler coadler force-pushed the feat/change-ssh-host branch from 6de3d8f to 9b22b8b Compare February 24, 2026 17:40
@coadler
Copy link
Contributor Author

coadler commented Feb 24, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9b22b8badb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coadler
Copy link
Contributor Author

coadler commented Feb 24, 2026

@codex review

Addressed your P2 comment: replaced with the same + path-fallback pattern used by , so legacy workspaces without in config are still found and updated correctly.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coadler
Copy link
Contributor Author

coadler commented Feb 24, 2026

cc @ThomasK33 doesn't seem like I can get integration tests working as a pr from a fork, but this is ready otherwise

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.

1 participant