Repository navigation
feat(ssh): open SSH workspaces in VS Code Remote-SSH - #10005
AmethystLiang merged 1 commit into
Conversation
Allow the existing "Open in" entries to launch a configured VS Code
launcher against an SSH-backed worktree via Remote-SSH:
code --remote ssh-remote+<authority> <remote-path>
- Split the blanket SSH/runtime block into a capability model: file
managers and non-VS Code launchers stay local-only (disabled with
"Local only" metadata); a recognized VS Code command is enabled and
forwarded with connectionId over a typed object IPC.
- Main process stays authoritative: rejects active/owned runtimes,
resolves the SshTarget from the persisted Store, derives the authority
(config alias, or username@host on port 22, or ssh-alias-required on a
non-default port), validates POSIX/Windows absolute remote paths without
local stat/normalize, and rejects non-VS Code and compound commands
before spawn.
- Authority and remote path are passed as separate argv; getSpawnArgsForWindows
remains the cmd/bat shim boundary and fails closed on metacharacters.
- Same capability rules across the worktree menu, Explorer overflow, and
the source-control entry context menu.
Refs STA-2386
Closes #9999
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (21)
📝 WalkthroughWalkthroughThe change adds structured external-editor IPC requests and results, VS Code Remote SSH launcher detection, and SSH authority validation. Shell handlers now receive the Store and support remote-runtime restrictions, SSH target lookup, path validation, remote launch resolution, and structured failures. Preload and renderer APIs use the new request shape, while menus compute local/remote availability, display metadata, and provide localized failure guidance. Tests cover launcher resolution, SSH authority rules, IPC behavior, and renderer interactions. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)src/renderer/src/i18n/locales/en.jsonTraceback (most recent call last): Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Allow the existing "Open in" entries to launch a configured VS Code
launcher against an SSH-backed worktree via Remote-SSH:
code --remote ssh-remote+<authority> <remote-path>
- Split the blanket SSH/runtime block into a capability model: file
managers and non-VS Code launchers stay local-only (disabled with
"Local only" metadata); a recognized VS Code command is enabled and
forwarded with connectionId over a typed object IPC.
- Main process stays authoritative: rejects active/owned runtimes,
resolves the SshTarget from the persisted Store, derives the authority
(config alias, or username@host on port 22, or ssh-alias-required on a
non-default port), validates POSIX/Windows absolute remote paths without
local stat/normalize, and rejects non-VS Code and compound commands
before spawn.
- Authority and remote path are passed as separate argv; getSpawnArgsForWindows
remains the cmd/bat shim boundary and fails closed on metacharacters.
- Same capability rules across the worktree menu, Explorer overflow, and
the source-control entry context menu.
Refs STA-2386
Closes stablyai#9999
Summary
Lets the existing Open in entries launch a configured VS Code launcher against an SSH-backed worktree via Remote-SSH, on the machine running Orca:
VS Code owns Remote-SSH install/connection/auth/host-key errors. Orca keeps blocking local-only launchers and file-manager actions for SSH paths, and every local-OS open for remote-runtime workspaces.
What changed
connectionId.shell:openInExternalEditornow takes{ path, command?, connectionId? }and returns a dedicatedShellOpenExternalEditorResultwith narrow remote failure reasons. Contract updated acrossshared,preload, renderer callers, and the web stub.registerShellHandlers(store)now: rejects active/owned runtimes; resolves theSshTargetfrom the persistedStore; derives the authority — config alias (via the sharedisOpenSshConfigBackedTargetpredicate), orusername@hoston port 22, orssh-alias-requiredon a non-default manual port; validates POSIX/Windows absolute remote paths without localstat/normalize/realpath; and rejects non-VS Code and compound commands before spawn.connectionIdis never interpolated; control-character authority fields are rejected;getSpawnArgsForWindowsremains the.cmd/.batshim boundary and fails closed on metacharacters; detached / ignored-stdio /windowsHidebehavior preserved.WorktreeOpenInMenuItems), and the source-control entry context menu (per-entrygetOpenInEntryAvailability+connectionIdwired fromactiveConnectionId).Test plan
username@host, non-22ssh-alias-required, legacy imported alias, blank/control-char invalid), launcher capability (stable/Insiders/direct+resolved Windows shims, compound/Cursor/Zed rejection),resolveVsCodeRemoteSshLaunchSpecexact--remoteargs + space preservation + closed unsupported/compound, IPC handler (relative-path/not-found local, SSH POSIX+Windows path bypass of local validation, runtime + runtime-owned rejection, alias-required recovery details, unsafe.cmdmetachars → closed launch-failed), renderer capability + menu forwarding, andregisterShellHandlers(store)wiring.npm run typecheck— clean.oxlint+oxfmt -c— clean.check:max-lines-ratchet— OK (no new bypasses).git diff --check— clean.verify:localization-coverage— passes; new keys present inen.json.verify:localization-catalogreports missing keys inNewWorkspaceComposerCard.tsx,SshHostAdvancedFields.tsx, andsleep-worktree-flow.ts— none in this diff, and the keys are absent frommain'sen.json.Notes
remote-editor-unsupportedfor SSH in this release.../../vscodecore checkout; theusername@hostport-22 fallback is a manual-matrix release gate, and detached spawn cannot report post-spawn connection/folder failures (by design).Refs STA-2386
Closes #9999
Made with Orca 🐋