Repository navigation
feat: open remote gateway files in a local editor over ssh - #31141
Conversation
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: the feature is new, off by default, closes #11338, and no existing mechanism opens a gateway file over SSH. Two parts are bigger than they need to be. Notes
What this change shipsInventory (8 items) — 6 justifiedIntent: a user with a gateway on a remote host opens a file shown in the dashboard in their own local VS Code over their own SSH. ADDITION.
[FIRST-PRINCIPLES-REVIEWED] ddf0ca6 Description read[DESCRIPTION-READ] 938389e4d51f5341087b9172335ab80bc0fb15d4cab804bc2db49b6eb69d69d1 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The feature is additive, off by default, gives the dashboard no write access, and both link inputs are validated when saved and again when served. Notes
[DESIGN-REVIEWED] ddf0ca6 Description read[DESCRIPTION-READ] aac02cddcbbb437f1b16f5e7e3de4bac61eff0108ead90bd934f4a98e98bb97f That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The blind reader read "Open in VS Code" correctly and identified the SSH host field correctly. They declined to fill the host field only because they have no SSH setup, and someone without one has no use for this feature. Notes
[UX-REVIEWED] ddf0ca6 Description read[DESCRIPTION-READ] 71c63f943dc8d831619a097000813fe01e815dcb4ef11592eb5307a2e9274b65 That sha256 names everything this verdict read: the PR description, plus the 14 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
b79a41c to
dddd3d1
Compare
|
self-added: no
|
|
self-added: no
|
dddd3d1 to
7b68b46
Compare
|
self-added: no
|
7b68b46 to
a049169
Compare
4dcf5fc to
17ce78c
Compare
|
self-added: no
|
|
self-added: no
|
|
Rebased: main moved in src/kiro_crew/config/sections.py and src/kiro_crew/docs/ui-index.generated.json (a conflict on the old head), plus the generated settings files and locale catalogs this PR also edits (c0e9c2e -> 7f11b5c); the generated files are rebuilt on the new base; CI re-running. |
|
[operator: bolichen97] Thanks. A separate PR for the attached-window row once this one lands is the right shape; it will get its own review. One thing to know when you rebase it: this branch now offers the link only in the side panel's ⋯ menu for an open file, not in path chips or the file viewer, because a chip in a chat bound to a session environment can name a file on another machine. |
17ce78c to
bb005e9
Compare
|
[operator: bolichen97] Rebased onto main The UX copy from the earlier ruling is applied: |
When the gateway runs on another machine, every file-open action in the dashboard's file menus ended at "Copy path": open and reveal act on the gateway host, and the desktop app's "Open in editor" opens a path that does not exist on the viewer's machine. Settings > Display > Remote editor takes an editor (VS Code, or off) and the SSH host the viewer reaches the gateway by. Once both are set, the side panel's overflow menu for an open file offers "Open in VS Code", a vscode://vscode-remote/ssh-remote+<host><path> link that the viewer's own editor opens over the viewer's own SSH. The dashboard grants no new write access: the edit happens in that editor. Only the side panel offers the row. It always shows the gateway's copy of a file, while a path in a transcript can name a file on another machine (a chat bound to a session environment), so a row there could open the wrong file. The editor is an enum because it becomes the link's URL scheme, and the host must be a DNS name or SSH alias, the grammar the desktop app's editor-link check takes, so it adds no URL structure and no leading dash ssh could read as an option. The write gate enforces both, and the branding endpoint drops a hand-edited value either one refuses. A path that is not absolute or has a dot segment gets no link, since URL parsing would remove the segment and could point the link at another host. In an embedded pane the link opens as a new window, which the desktop app confirms first. Builds on #19557 by @helenastafford. Closes #11338 Co-authored-by: Helena Stafford <43710966+helenastafford@users.noreply.github.com>
bb005e9 to
ddf0ca6
Compare
|
self-added: yes
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approving. On this head the review checked the whole path from the stored setting to the link. The owner-only PATCH gate refuses a bad editor or host with a full regex match. The branding endpoint checks again and drops hand-edited values such as -oProxyCommand=x, dev-box/x?y or a non-string. remoteEditorUrl returns no link for a dot segment, a backslash or a control character, and every character it emits fits the desktop app's EDITOR_LINK_RE. The tests check these refusal cases, the side-panel-only placement and the Settings save flow, and they do not sleep or leave shared state behind.
Security: the PR does pass new user input into a clickable vscode:// link and adds change-card classification rows, but neither opens a hole. An agent cannot point the link at another machine without the owner. The host is classified code_exec and the editor cannot widen. Three separate checks refuse a value with URL structure or an ssh option: the write gate, the branding re-check and the desktop app's own link check. The /a/../../ssh-remote+other/x host switch is pinned to no link.
Done well: the row only appears in the side panel, where the file is known to be on the gateway, and a negative test keeps it out of chat path chips.
Optional:
- Nothing pins
dashboard.remote_editor.hostascode_exec. If it moves to_CANNOT_WIDEN_SETTINGS, an agent-proposed host shows as anormalcard and the related tests stay green. One row intest_session_environment_paths_keep_their_classwould catch this, like the existingcoder_urlrow. - The help text tells users to type the name after
Hostin~/.ssh/config, but the host grammar refuses an alias such asdev_box. Either change the wording or widen this regex and the desktopHOSTNAME_REtogether. - After this lands, close #19557 as superseded and credit its author.
Problem / Motivation
Goal: When the gateway runs on another machine, a user can open a file from the dashboard's file menus in their own local VS Code, over their own SSH.
For a gateway on a remote or headless host, every file-open action in the file-path menus ends at "Copy path". Open and Reveal act on the gateway host, and the desktop app's "Open in editor" opens a path that does not exist on the viewer's machine. Editing a file the agent may not write (
config.json,.env) then needs a separate SSH session.Why it matters
Running the gateway on a cloud dev box or another headless server is a common setup, and those users have no way to get from a file path to an editor. One click now opens the right file in their own editor, and the dashboard gains no write access: the edit happens in the user's editor, over the user's SSH.
Not a goal
<scheme>://vscode-remote/ssh-remote+<host>link opens a remote file in it; adding one is one id inREMOTE_EDITOR_IDSandREMOTE_EDITORS.C:\paths) and chats bound to a session environment, whose paths are on another machine.What changed (motivation → approach → change)
The browser cannot know how the viewer reaches the gateway over SSH, so the user says it once in Settings. The side panel's ⋯ menu for an open file then offers Open in VS Code: VS Code's own
vscode://vscode-remote/ssh-remote+<host><path>link, which the viewer's editor opens with the viewer's own SSH credentials. This builds on #19557, trimmed to the link, the two settings and their checks.dashboard.remote_editor.editorand.hostand read back on load (config/sections_dashboard.py,config/sections.py,config/loader_builders.py,dashboard/handlers/core_config_schema.py,pages/settings/DisplayPanel.tsx). The descriptions say the viewer's computer needs VS Code with Remote-SSH, and that the host is theHostname in that computer's~/.ssh/config. The host field saves when it loses focus; it shows an example placeholder and a "Saved" line once the save lands, until the user types againcomponents/MarkdownPanelHeader.tsx), the link built byutils/remoteEditorUrl.tsGET /api/dashboard/brandingcarriesremote_editor(dashboard/handlers/core.py,hooks/useBranding.tsx,api/client/themes.ts)code_exec, the editor as cannot-widen (change_card_catalog_kinds.py)config-baseline.json,docs/settings-registry.generated.json,docs/ui-index.generated.json,settingsRegistry.gen.ts, the 12 locale catalogs andi18n/en.context.json, a brand exemption ineslint.i18n.config.js, the feature map andlearn-cron-dashboard.mdOnly the side panel offers the row. It always shows the gateway's copy of a file, while a path chip in a chat can name a file on another machine (a chat bound to a session environment), where the link would open the wrong file. Any path chip reaches the row through Open in side panel.
Both values end up in a clickable link. The editor is an enum because it becomes the URL scheme. The host must be a DNS name or SSH alias, the grammar the desktop app's editor-link check already takes, so it carries no URL structure and no leading
-that ssh could read as an option. The write gate refuses anything else, and the branding endpoint drops a hand-edited value that either check refuses. The row is offered only for an absolute path with no.or..segment, because URL parsing would drop the segment and could point the link at another host. Each segment is percent-encoded, and a name the desktop app's check refuses (a backslash or control character) gets no row. The row is not gated ondirect_local, which reads true through anssh -Lforward. In the desktop app the link opens as a new window, which the desktop app confirms before handing it to the OS: its navigation guard refuses an in-window navigation to an editor scheme.Backwards compatibility
Compatible: two new optional keys, off by default; with no editor set, nothing renders differently.
Removes nothing: the change only adds two settings, a branding field and a menu row.
Tests
website/src/test/MarkdownPanel.remoteEditor.test.tsx: the side panel row links to the file on the SSH host with each segment encoded (space,#, parentheses); no row while the editor is off;target="_blank"from an embedded pane and from a desktop-app window; no row in a path chip menu;remoteEditorUrlbuilds no link for a relative path, a dot segment, or a backslash or control character the desktop app's editor-link check refuses.website/src/test/DisplayPanel.remoteEditor.test.tsx: picking VS Code saves the editor and refetches branding; the empty host field shows its placeholder; the host is saved trimmed on blur and a "Saved" line appears, gone again once the user types; a refused host stays in the field with the format message and no "Saved" line.test/test_config_patch_remote_editor.py: the write gate takesvscode,""and a DNS name, and refuses another scheme, a port, a path or query, and a leading dash; a saved editor and host surviveKiroCrewConfig.load(), and a hand-edited scalar loads as off.test/test_dashboard_branding.py: branding serves only values the schema accepts;test/test_dashboard_handlers_core_coverage.pypins the default payload withremote_editor.Determinism: the three backend files passed 20 times at
-n0, 10 times at-n 4 --dist loadgroup --max-worker-restart=2besidetest_config_patch_otlp_endpoints.py, and in a shuffled order (seed 31141). The two vitest files passed 10 shuffled runs (--sequence.shuffle, seeds 1001 to 1010).Manual verification
Rendered the real SPA built from this head (
website/dist, API stubbed) and read back the side panel row'shref:vscode://vscode-remote/ssh-remote+dev-box/home/dev/notes/cleanup.md. The path chip menu for the same file has no editor row. Not done here: clicking the link on a desktop with VS Code and Remote-SSH installed.Screenshots / video
Side panel ⋯ menu for an open file, dark and light:
A path chip menu in chat offers no editor row:
The SSH host field empty, with its placeholder, and right after a save on blur, with the "Saved" line (dark and light):
Settings → Display → Remote editor, set, with the shipped copy (before the placeholder and the "Saved" line):
Light theme, Off, and the two save errors
Related Issues
Closes #11338
Builds on #19557 by @helenastafford.
Sibling sweep
N/A — a
featPR.Pattern harvest
N/A — a
featPR.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.