Skip to content

feat(dashboard): open remote files in a local editor via ssh links - #19557

Closed
helenastafford wants to merge 2 commits into
kirodotdev:mainfrom
helenastafford:feat/remote-editor-links
Closed

helenastafford wants to merge 2 commits into
kirodotdev:mainfrom
helenastafford:feat/remote-editor-links

Conversation

@helenastafford

@helenastafford helenastafford commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: From a dashboard on a remote or headless gateway, open any file-path chip in your own local VS Code or Kiro, editing the remote file over your own SSH session.

When the gateway runs on a remote host (cloud desktop, EC2) and you use the dashboard from a laptop, the file-path menus have no working "open in an editor" action. Open with default app and Reveal shell out on the gateway host, which has no desktop, and the Electron Open in editor bridge targets the laptop's filesystem, where the file does not exist. Every file-open affordance dead-ends at Copy path, so editing a file the agent cannot write (trust-root config such as config.json or .env) means opening a terminal and an SSH session by hand.

This replaces #11345, whose head branch can no longer be updated by its author (see Related Issues).

Why it matters

Running the gateway on a cloud desktop and the dashboard on a laptop is a common setup, and it is where you most need an editor for the files the agent and the read-only Files app cannot touch. Today that is a terminal context switch every time.

Not a goal

  • Expanding ~ or relative paths into absolute ones. The row is offered only for absolute paths; relative and ~ chips keep their current menu.
  • Editors outside the VS Code family. Only editors whose URL scheme accepts the vscode-remote SSH authority are offered.
  • Any new write path through KiroCrew. The edit rides the user's own SSH session.
  • Per-browser storage of the editor and host. Both live in the gateway's config.json because the common setup is one person reaching one gateway from one machine, and gateway config is what the agent, every tab and the branding clamp already read. The host help text states the constraint (an alias must exist on every machine that opens the dashboard); per-browser preferences can follow if a multi-machine user asks.
  • Opening from the desktop app, including its embedded instance panes. Electron denies the renderer's openExternal permission and has no URL-launch bridge for these schemes, and a framed pane's CSP refuses the navigation too, so the row is hidden there rather than shown as a dead click. Browser tabs, the main remote setup, are unaffected.

What changed (motivation → approach → change)

VS Code-family editors accept a remote authority in their URL scheme: vscode://vscode-remote/ssh-remote+<host><path> launches the user's local editor, which connects over the user's own SSH credentials and opens the remote file with full edit rights. KiroCrew grants nothing new; the browser only lacks the SSH authority for the gateway host, so this adds two opt-in settings and one menu row.

  • dashboard.remote_editor.editor: an enum ("" off, vscode, kiro), not a free string, because the value becomes a clickable custom-scheme URL.
  • dashboard.remote_editor.host: restricted to ^[A-Za-z0-9._@+-]*$ so it cannot inject path, query or authority structure into the URL.
  • /api/dashboard/branding returns remote_editor {editor, host} and clamps both: an unknown editor or an unclean host becomes "" before it reaches the client. The frontend also only builds URLs for editor ids it knows.
  • FilePathMenu, plus the MarkdownPanel and FileViewer overflow menus that share its hooks, gain an Open in row whenever both settings are set, placed with the other editor launches. Directories are allowed (a vscode-remote authority opens a directory as a remote workspace); relative paths and paths with a . or .. segment are refused so neither can graft onto or pop the host segment (URL parsing removes dot segments), and a path that cannot be URI-encoded (a lone surrogate from a non-UTF-8 filename) hides the row instead of throwing during render.
  • A custom-scheme link reports nothing back, so after a click the row stays open and reads Sent to with a one-line "check it's installed and can reach the SSH host" hint until the menu closes, an in-place acknowledgment like the Copy row's, also announced through a polite role="status" live region for screen readers. The row is hidden inside an embedded instance pane, where the frame's CSP would refuse the navigation. The Files viewer's ⋯ menu gains an onOpenChange to clear that hint on close, so it now passes guideProbe explicitly to keep the in-app guide able to open the menu (the wrapper turns the probe off whenever something listens to open).
  • The row is not gated on direct_local. A browser on an ssh -L port forward reaches the gateway on loopback and reads as direct-local, which would hide the row in the main setup it exists for. Configuring an SSH host is the user's statement that the gateway is remote, and on a genuinely local session the link still works.
  • Settings → Display gets its own Remote editor pane. It says when an editor is picked but no SSH host is set, names the hostname-only rule when the server refuses a host (any other failed save gets a plain "Couldn’t save the SSH host."), runs each field's saves in order so a slow earlier save cannot overwrite a later pick, and shows a hand-edited non-string or unknown value as off instead of crashing.
Area Files
Config keys and validation src/kiro_crew/config/sections.py, src/kiro_crew/config/loader.py, config-baseline.json, src/kiro_crew/change_card_catalog.py (editor classed cannot-widen; host classed code_exec like dashboard.terminal.shell, since it picks where the user's editor presents their SSH keys)
Branding payload and clamp src/kiro_crew/dashboard/handlers/core.py, website/src/api/client/themes.ts, website/src/hooks/useBranding.tsx
Menu row website/src/components/FilePathMenu.tsx, website/src/components/MarkdownPanel.tsx, website/src/apps/file-explorer/FileViewer.tsx
Settings pane website/src/pages/settings/DisplayPanel.tsx, website/src/i18n/ (all locales, en.context.json)
Screenshot harnesses website/scripts/capture-remote-editor-menu.mjs, website/scripts/capture-remote-editor-settings.mjs, website/capture/remote-editor-menu.{html,tsx} (the shots are PR attachments, not committed)
Regenerated indexes src/kiro_crew/docs/settings-registry.generated.json, src/kiro_crew/docs/ui-index.generated.json, website/src/components/commandPalette/settingsRegistry.gen.ts
Menu row on a remote session Before After
Open with default app / Reveal 🟥 hidden 🟥 hidden
Open in <editor> 🟥 absent 🟩 shown when configured
Copy path 🟦 only real option 🟦 unchanged

Backwards compatibility

Compatible: both keys are new and optional, default to off, and no existing key, route field or menu row changes meaning.

Removes nothing: the diff only adds two config keys, one branding field, one menu row and one settings pane.

Tests

  • test/test_config_patch.py::TestRemoteEditor: the editor enum accepts each valid value and "" and rejects unknowns; the host accepts hostnames and aliases and rejects / : ? #, whitespace and over-length values; the two sub-keys nest without clobbering each other.
  • test/test_change_card_setting_classes.py: a change card for dashboard.remote_editor.host carries the code_exec risk and one for the editor stays normal, with the class membership pinned.
  • test/test_config_schema.py: both keys flatten into first-class schema entries carrying the enum and the host pattern.
  • test/test_dashboard_branding.py: off by default, forwards a configured pair, clamps an unknown editor and a dirty host to "".
  • website/src/test/FilePathMenu.test.tsx: the row shows with editor and host set, including on a direct-local session; it is labelled per editor, grouped with the editor launches, hidden when either setting is empty, the path is unencodable (Copy path stays) or the dashboard is an embedded pane or the Electron app, shown for a directory, and routes the exact URL on select. A click keeps the menu open and swaps the label to the sent hint, which stays past any delay and resets once the menu closes and reopens; the same hint reaches a polite role="status" region. remoteEditorUrl unit tests cover URL shape, per-editor scheme, segment encoding, unknown editors, relative paths, dot segments (including a .. path that would otherwise pop the host), dotted names that stay allowed, and lone surrogates.
  • website/src/test/DisplayPanel.remoteEditor.test.tsx: the pane renders, PATCHes the nested key, queues a second editor PATCH (paused in the mutation cache) until the first settles, which fails without the mutation scope, renders non-string and unknown server values as off/empty, shows the missing-host hint only when an editor is set without a host, and names the host format rule only on a 400 (a 500 shows the plain notice).

Manual verification

From a macOS client, code --remote ssh-remote+<cloud-desktop-fqdn> <path> (the command the row's URL triggers) opened the gateway host's config file in local VS Code over the user's SSH session, and edits saved back to the remote host. For Kiro: its bundled product.json declares "urlProtocol": "kiro", and the gateway host used for testing carries a ~/.kiro-server install left by Kiro's remote-SSH connection, so Kiro does reach this host over SSH. Neither proves the kiro://vscode-remote/ssh-remote+… link itself opens Kiro, and clicking the row in a live remote session (VS Code or Kiro) is still to do.

Screenshots / video

Reproducible with node website/scripts/capture-remote-editor-settings.mjs (built SPA plus the shared API stub) and node website/scripts/capture-remote-editor-menu.mjs against a vite dev server (the real MarkdownRenderer, FilePathMenu, MarkdownPanel and FileViewer inside the real BrandingProvider, only the transport stubbed). Each harness asserts the content and applied theme before shooting. The shots are GitHub attachments, not committed files.

Settings → Display → Remote editor, configured:

Remote editor pane configured, dark

File chip menu on a remote session, and the same row right after a click:

File menu with Open in VS Code, remote

Row after a click: Sent to VS Code hint, menu still open

Every other state: the two ⋯ menus and their sent hint, both save errors, the missing-host hint, the rail, ssh -L forward, directory chip, off state and light theme

MarkdownPanel overflow menu with Open in VS Code

MarkdownPanel overflow menu after a click: Sent to VS Code hint

FileViewer overflow menu with Open in VS Code

FileViewer overflow menu after a click: Sent to VS Code hint

Host rejected: inline error naming the hostname-only rule

Editor save failed: inline notice under the Editor select

Editor picked, host empty: the set-a-host hint

Display rail with Remote editor selected

File menu with Open in VS Code, ssh -L forward (direct-local, so local open and reveal rows also appear)

Directory menu with Open in Kiro

Remote editor pane off, dark

File menu, light

Remote editor pane configured, light

Related Issues

Fixes #11338

Supersedes #11345 (same change, rebased onto current main and redesigned for the ssh -L case and the split Display settings; the original head branch lives in kirodotdev/KiroCrew, where the author no longer has push access).

Related: #9411 (remote path-chip actions fail silently)

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

i18n notes

The new settings.display.remoteEditor.* keys are translated across all locales; editor names are interpolated, never translated.

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license; see the Licensing section of CONTRIBUTING.md.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 12, 2026
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 6c46613761c8399263ead5a174f6da00798e701a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the feature is opt-in and off by default, it clamps both new values on the server before the browser builds a link, and it removes nothing.

Notes

  • remoteEditorUrl accepts only paths that start with /, so a gateway running on Windows (paths like C:\…) never gets the row. Say so in the Settings help text so a Windows user isn't left looking for a row that won't appear.

[DESIGN-REVIEWED] 6c46613

Description read

[DESCRIPTION-READ] c196385481e30d94ddeeb893fd2c7fe1e0ac9eccec35805753d2fc3971f02829

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 6c46613761c8399263ead5a174f6da00798e701a via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. This fork lane has no blind read, so nobody new to the controls has read the menu row or the settings pane. Pushing the branch to this repository runs that read.

Notes

  • No screenshot shows the non-400 host error ("Couldn’t save the SSH host."). It uses the same error notice as the format error in attachment-08, so it is not a gap, but attaching a still would cover every string the PR adds.

[UX-REVIEWED] 6c46613

Description read

[DESCRIPTION-READ] 4f50c6d7896e23aea12709b4346698d38512e402886c550507301064cb6bd60c

That sha256 names everything this verdict read: the PR description, plus the 19 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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 6c46613761c8399263ead5a174f6da00798e701a via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Opt-in addition, off by default. Every item ties to the stated remote-gateway dead end, and nothing in the base repo already builds this link.

What this change ships

Inventory (9 items) — 9 justified

Intent: let someone using a dashboard on a remote or headless gateway open a file or folder from a path chip in their own local VS Code or Kiro, over their own SSH session. This is an ADDITION.

  1. The file-path chip context menu gets an "Open in VS Code/Kiro" row once an editor and an SSH host are both set — justified
  2. The same row appears in the MarkdownPanel ⋯ menu and the Files viewer's "More options" menu — justified
  3. After a click the row stays open and reads "Sent to …", and a screen-reader live region announces it — justified
  4. The row is hidden in the desktop app and in embedded instance panes — justified
  5. Settings → Display gets a new "Remote editor" pane with an Editor picker and an SSH host field — justified
  6. New config keys dashboard.remote_editor.editor (enum) and .host (pattern-restricted), off by default — justified
  7. /api/dashboard/branding now returns remote_editor, with an unknown editor or unclean host clamped to empty — justified
  8. A change card for an agent-proposed SSH host carries the code_exec risk, and the editor key is classed cannot-widen — justified
  9. Regenerated settings and UI indexes, the feature-map row, an i18n lint allowlist entry, and capture harnesses (the existing website/capture/ convention) — justified

[FIRST-PRINCIPLES-REVIEWED] 6c46613

Description read

[DESCRIPTION-READ] 0896c280d725e09fff6d5f231769d43199282a6eb925b708d8acf6a923f64df1

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 6c46613761c8399263ead5a174f6da00798e701a via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 6c46613

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings (all downgraded on adjudication)

Reviewed 6c46613761c8399263ead5a174f6da00798e701a via the fork AI-review pipeline; updated in place on each push.

Opus 5.5 adjudication downgraded every blocking finding. Downgraded: the remedy each one needs is disproportionate to the harm it prevents. Adjudication downgraded all 1 blocking finding(s): the remedy each one requires is disproportionate to the harm it prevents.

Review details

BLOCKING -- website/src/hooks/useBranding.tsx:36 -- Remote-editor links retain an obsolete SSH destination

host: data.remote_editor?.host ?? '',
Trigger: Open two dashboard tabs with remote editing configured, change the SSH host in Settings → Display in one, then click the other tab’s editor row; useRemoteEditorOpen builds its URL from that tab’s cached branding.
Outcome: The editor connects to the previous host. Branding stays fresh indefinitely, stops polling after loading, and is excluded from refresh/reconnect invalidations; the save refreshes only the saving tab.
Anchor: defect
Fix: Broadcast remote-editor setting changes and invalidate branding in receiving tabs, including reconnect recovery.

[BLOCK-MERGE-DOWNGRADED] 6c46613
[GPT-REVIEWED] 6c46613

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 — LOW. Every condition must hold at once: two tabs are open, the SSH host is changed in one, and the other tab is used without a reload. Branding is cached forever at website/src/hooks/useBranding.tsx:23-24 (staleTime: Infinity, polling stops once data loads). The row's URL is built from that cache at patch useRemoteEditorOpen (remoteEditor.host, patch lines 1848/1864). Only the saving tab refreshes (patch lines 2591/2630, invalidateQueries(['branding'])). The other tab opens the previous host, which the user chose themselves, so nothing leaks to an attacker. The user can see which host the editor opened, and a reload fixes it. No recovery code covers this case.
The real fix needs a new cross-tab broadcast: the existing mc-config-changed event stays inside one window (website/src/pages/chat/ChatSettings.tsx:344). It would also need branding invalidation on reconnect. That is a new mechanism serving one rare path, on a cache that is already deliberately never-stale for every branding field, so the cost exceeds the harm.

[ADJUDICATION] 6c46613761c8399263ead5a174f6da00798e701a total=1 uphold=0 downgrade=1
DOWNGRADE F1 website/src/hooks/useBranding.tsx:36 reason=disproportionate-remedy
[GPT-ADJUDICATED] 6c46613761c8399263ead5a174f6da00798e701a

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 12, 2026
@helenastafford
helenastafford force-pushed the feat/remote-editor-links branch from 6c87f5f to d9d96af Compare October 12, 2026 23:26
@helenastafford

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Non-UTF-8 filenames crash Files during render — fixed in d9d96af

fixed: remoteEditorUrl wraps the per-segment encodeURIComponent in a try/catch that returns null on URIError only (anything else rethrows), so a lone-surrogate path hides the row instead of throwing during FileViewer's render.
Tests: remoteEditorUrl returns null for /home/u/bad\udcffname; a FilePathMenu for that path renders without throwing, shows no "Open in VS Code" row, and keeps Copy path.
No other render-time encode of the path exists in this diff.

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • Clicking the row with no handler does nothing visible — fixed in d9d96af

fixed: after a click the row stays open (preventDefault, like the Copy row) and its label becomes "Sent to — if nothing opened, check it's installed and can reach the SSH host." for 2.5s, in all three menus (file chip, MarkdownPanel overflow, FileViewer overflow).
A custom-scheme handoff reports nothing back to the page, so the row itself is the only honest acknowledgment; the hint names what to check.
Evidence: temp-screenshots/remote-editor-menu/file-menu-sent-dark.png; test "acknowledges the click in place and keeps the menu open, then resets".

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • The FileViewer and MarkdownPanel rows are different from each other — rebutted

rebutted: each row follows its own menu's existing convention. MarkdownPanel's file-location group is iconless by design (comment at MarkdownPanel.tsx above the Open in Files row) and orders destinations before fallbacks: Open in Files, Open, Reveal, Open in , Copy path, Copy content, Download.
FileViewer's menu carries a glyph on every row with the same order: Open, Reveal, Open in , Download. In both, the row sits after the gateway-host rows and before the fallbacks.
Lining them up would mean changing an existing menu's style, which is outside this PR's goal. Evidence: markdown-overflow-menu-dark.png, fileviewer-overflow-menu-dark.png.

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • remote_editor_editor_desc: cut it to one sentence — fixed in d9d96af

fixed: the description is now "Opens the gateway's files in your local editor over your own SSH session." in en and every locale; the host requirement lives only in the hint shown when an editor is picked without a host (04-remote-editor-host-hint-dark.png).
The generated settings registry and agent registry carry the same string.

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • Store the SSH host per browser instead of in config.json — rebutted (out of goal)

rebutted: the goal is one gateway reached from the user's own machine, where one host value is correct; a gateway-wide host also lets the agent and every browser tab share one setting the user set once.
Per-browser storage is a new surface (a second persistence path, sync semantics, a settings UI that differs by browser) for the multi-laptop case, which no user has reported; it can follow as its own change if one does.
Keeping the host server-side also keeps its charset clamp on the server, where the link is minted from config.

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • kiro ships as a selectable editor without proof Kiro accepts kiro://vscode-remote/ssh-remote+… — rebutted with evidence

rebutted: Kiro is a Code-OSS build, and the vscode-remote URL authority is handled in Code-OSS core (the main-process protocol-URL handler), not in a Microsoft extension, so <urlProtocol>://vscode-remote/<authority>/<path> reaches the same code path in Kiro as in VS Code; Kiro's bundled product.json declares "urlProtocol": "kiro".
The test gateway host carries a ~/.kiro-server install left by Kiro's own remote-SSH connection, so Kiro's ssh-remote authority resolver reaches this host.
A live click of the row in a remote session (VS Code and Kiro) is the one check still pending; the PR's Manual verification section says so.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 12, 2026
@helenastafford
helenastafford force-pushed the feat/remote-editor-links branch from d9d96af to 36f299a Compare October 13, 2026 01:17
@helenastafford

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Fixed 50 ms promise-sleep before an absence assertion — fixed in 36f299a

fixed: the ordering test now waits (waitFor) until the second editor mutation is present and state.isPaused === true in the test QueryClient's mutation cache, then asserts the PATCH count is still 1. No timers remain in the test.
Verified: passes with the scope on the mutation; fails when the scope is removed.

@helenastafford

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Normalize retained non-string editor values before rendering — fixed in 36f299a

fixed: DisplayPanel normalizes the server values before the overlay sees them: editor is '' unless it is a string in the select's own option list ('', vscode, kiro); host is '' unless it is a string.
Confirmed the path is real: loader.py only checks that remote_editor is a dict, so nested values reach the config GET uncoerced.
Tests: seeding {editor: {name: 'vscode'}, host: 42} renders the pane with host '' ; an unknown id ('cursor') renders as Off.

@helenastafford

Copy link
Copy Markdown
Contributor Author

self-added: yes

  • Synchronize the second mutation before asserting serialization — fixed in 36f299a

fixed exactly as proposed: the test captures the helper's queryClient and awaits the second mutation's paused state before asserting the PATCH count and releasing the first request. The fixed sleep is gone.

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • The host error gives no next step — fixed in 36f299a

fixed: a rejected host now reads "Couldn’t save the SSH host. Use a hostname or ~/.ssh/config alias only, without a port, path or scheme; put a port in ~/.ssh/config." in en and every locale.
Evidence: temp-screenshots/remote-editor-settings/06-remote-editor-save-failed-dark.png (re-captured).

@helenastafford

Copy link
Copy Markdown
Contributor Author
  • The "sent" hint is long for how briefly it shows — fixed in 36f299a

fixed: the timer is gone. The "Sent to — if nothing opened…" hint stays until the menu closes and resets when it reopens, in all three menus, so the troubleshooting text is on screen while the user checks whether the editor opened.
Test: the hint survives fake timers advanced well past the old 2.5 s and reads "Open in VS Code" again after Escape and reopen.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 20, 2026
@iamwhatever
iamwhatever force-pushed the feat/remote-editor-links branch from e70fdb0 to e81a236 Compare October 20, 2026 03:05
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 20, 2026
@iamwhatever
iamwhatever force-pushed the feat/remote-editor-links branch from e81a236 to ffcbc2f Compare October 20, 2026 04:07
@iamwhatever

Copy link
Copy Markdown
Contributor

span=c64d27627a62

  • The command palette shows these settings as a bare "Editor" and "SSH host" — rebutted

rebutted: each palette entry carries its description beside the label (settingsRegistry.gen.ts display.ssh-host: "The name you'd use with ssh to reach the gateway…"; display.editor: "For a gateway on another machine: adds an option to file menus…") and opens Display → Remote editor (params.sub: remote-editor).
The labels come from the generator, the same way as every other Display entry (Terminal's fields too); renaming them only for the palette would split one label into two.

@iamwhatever

Copy link
Copy Markdown
Contributor

span=0e4c72dbcafa

  • The plain "Couldn’t save the SSH host." error for non-400 failures is in no screenshot — rebutted

rebutted: as the item says, it is the pictured 400 notice (06-remote-editor-save-failed-dark) minus its second sentence, in the same ErrorNotice slot; DisplayPanel.remoteEditor.test.tsx pins both texts (HTTP 400 and 500). A second frame would show the same component with a shorter string.

@iamwhatever

Copy link
Copy Markdown
Contributor

span=36722ff6f0b6

  • remote_editor_editor_desc: start with what it does, not who it is for — rebutted

rebutted: the previous UX round on this PR asked for the opposite order ("start the description with when to use it, e.g. 'For a gateway on another machine: adds…'"), and that is what ships, in all 12 locales. Flipping it back would churn every locale for a wording preference with no new defect.

@iamwhatever

Copy link
Copy Markdown
Contributor

Maintainer decision needed: keep or drop the kiro editor choice. Design and First Principles both pass on head ffcbc2f45, and both ask the same one thing before merge: nobody has yet clicked a kiro://vscode-remote/ssh-remote+<host>/<abs path> link and seen Kiro open the remote file over SSH. Please pick one:

  1. Keep kiro: someone with Kiro installed clicks that link once (any OS, named Kiro version) and notes the result here.
  2. Drop kiro: ship VS Code only. That is a small follow-up push on this PR: remove kiro from REMOTE_EDITOR_IDS / REMOTE_EDITORS and the tests that name it.

The UX lane is at CONCERNS only because this fork lane has no blind first-time read; each of its items is answered above.

@github-actions github-actions Bot added readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 20, 2026
@dodgeblaster

Copy link
Copy Markdown
Contributor

Stewarding review for #11338 (open remote files in a local editor via vscode:// / kiro:// ssh-remote links).

I reviewed this PR as part of the T1/T2 sweep. Summary: the implementation is correct and the security design is sound, but this cannot be merged from here — it is a fork PR, currently CONFLICTING against main, and it introduces a new external-URL scheme in the UI, which is a maintainer/product decision. Review only.

State

  • Fork PR (isCrossRepository: true, head helenastafford:feat/remote-editor-links) → we cannot push a rebase to the branch or merge it; that needs the author (rebase) + a maintainer (merge).
  • mergeable: CONFLICTING / mergeStateStatus: DIRTY → needs a rebase onto current main by the author before it can go anywhere.
  • reviewDecision: REVIEW_REQUIRED, no reviews or review threads yet.
  • Checks: 89 pass, 12 skipping, 0 failing (the skips are the usual fork fast-path skips, not reds).

Security review (the link-injection surface)

The vscode://vscode-remote/ssh-remote+<host><path> URL is built from server-provided host/path, so I checked both the write boundary and the render boundary. Defense in depth is present and correct:

  1. Config boundary — dashboard.remote_editor.editor is an enum (vscode, kiro), not a free scheme string, so a config write cannot mint a link to an arbitrary protocol handler. dashboard.remote_editor.host is anchored-fullmatch against ^[A-Za-z0-9._@+-]*$, so it cannot carry /, :, @-authority or query structure into the URL. change_card_catalog classes host as code_exec (it selects where the user's editor presents their SSH keys) and editor as cannot-widen.
  2. Branding clamp (_remote_editor_branding in dashboard/handlers/core.py) — re-applies both checks server-side: an unknown editor → "", a non-charset-clean/non-string host → "", so the client receives values it can trust verbatim.
  3. Frontend remoteEditorUrl (FilePathMenu.tsx) — editor re-checked against a fixed REMOTE_EDITORS allowlist (scheme never comes from user data, so no javascript:); path must be absolute; ./.. segments are rejected (prevents dot-segment collapse from popping/grafting the ssh-remote+<host> authority, e.g. /x/../../ssh-remote+evil/y); each segment is encodeURIComponent'd with a lone-surrogate URIError caught (row hidden, not a render throw); the built URL is then re-parsed and verified to have host === 'vscode-remote' and a pathname starting with /ssh-remote+<host>/.

Tests back this: website/src/test/FilePathMenu.test.tsx, test/test_dashboard_branding.py, test/test_config_patch_remote_editor.py, plus settings-UI and change-card-class tests.

Scope note

The issue text floated cursor/windsurf; this PR scopes the enum to vscode/kiro (as the PR body states). The row is off by default (editor: ""), hidden in Electron / embedded panes where the scheme navigation would be refused, and deliberately not gated on direct_local (an ssh -L forward reads as local, which is exactly the remote topology this exists for).

Recommendation

Correct, well-tested, security-sound. Blocked on two human actions: (1) author rebases onto current main to clear the conflict, and (2) a maintainer makes the product call on adding a new external-URL (vscode:///kiro://) scheme to the dashboard and approves + merges. Not approving here, because approving a PR that is CONFLICTING and awaiting a maintainer product decision would be misleading.

…inks (kirodotdev#11338)

Adds dashboard.remote_editor.editor (vscode/kiro, empty = off) and a
charset-clamped dashboard.remote_editor.host, exposed through the branding
payload. FilePathMenu, MarkdownPanel and FileViewer gain an "Open in <editor>"
row once both are set, building vscode-remote ssh-remote+<host><absolute path>
links so edits ride the user's own SSH credentials. The row is not gated on
direct_local, which reads true through an ssh -L forward. Settings > Display
gains a Remote editor pane that says when a host is still needed. After a
click the row stays open and reads "Sent to <editor>" with a hint, since a
custom-scheme handoff reports nothing back. A path that cannot be
URI-encoded (a lone surrogate from a non-UTF-8 name) hides the row.

Closes kirodotdev#11338
…nu row

- capture-remote-editor-settings.mjs drives the real built SPA against the
  shared stub and shoots Settings > Display > Remote editor in its off,
  configured, host-missing, save-failed, side-rail and light-parity states.
- capture/remote-editor-menu.{html,tsx} + capture-remote-editor-menu.mjs mount
  the real MarkdownRenderer + FilePathMenu inside the real BrandingProvider
  with only the transport stubbed, including a directory chip, the
  sent-hint row, and the MarkdownPanel and FileViewer overflow menus.
@iamwhatever
iamwhatever force-pushed the feat/remote-editor-links branch from ffcbc2f to 6c46613 Compare October 30, 2026 19:29
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 30, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto main 57c3c08f7 to clear the new merge conflict (head now 6c4661376, same two commits, author kept). Main had split more files, so the same hunks moved with the code:

  • _EDITABLE_CONFIG now lives in dashboard/handlers/core_config_schema.py; the two dashboard.remote_editor.* entries and their imports moved there. api_branding and _remote_editor_branding stay in handlers/core.py.
  • _CANNOT_WIDEN_SETTINGS / _CODE_EXEC_SETTINGS now live in change_card_catalog_kinds.py; remote_editor.editor and remote_editor.host moved there.
  • The card-risk cases moved with main's test_newly_classified_paths_read_their_class_on_the_card cases into test/test_change_cards.py; the class-pin test stays in test_change_card_setting_classes.py.
  • Feature map, en.manual.json, en-XA.json: kept main's new rows/keys beside this PR's. Settings registry and ui-index.generated.json regenerated (gen-ui-index.mjs --check up to date).

Local: PR backend suites (448 passed), all generated-file / facade / size-cap suites (9089 passed), FilePathMenu + DisplayPanel remote-editor vitest (49 passed), related vitest (2338 passed), tsc and eslint clean.

The open question above is unchanged: a maintainer still needs to keep or drop the kiro editor choice (someone clicks one kiro://vscode-remote/ssh-remote+<host>/<path> link in a real Kiro, or we drop kiro and ship VS Code only).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🔴 BLOCK (blocking)

Which legitimate operations does 6c46613761c8399263ead5a174f6da00798e701a newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

the review scope was never resolved: the generate job did not finish (it timed out, failed or was cancelled), so no leg ran; its log names the step that stopped

No [SCOPE-REVIEWED] marker for this head was produced, so the model's text is withheld: it cannot be shown to describe this revision. See the job logs.

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Oct 30, 2026
@bolichen97

Copy link
Copy Markdown
Contributor

[operator: bolichen97] Continuing this in #31141; thanks for the start.

@iamwhatever

Copy link
Copy Markdown
Contributor

Thanks for this work! The same change has since landed on main in #31141 ("feat: open remote gateway files in a local editor over ssh"), which closed the linked issue #11338. Closing this one as superseded. Please reopen if something here is still missing from main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open remote files in a local editor (vscode://kiro:// ssh-remote links) from file-path menus

4 participants