Repository navigation
refactor(terminal): paste reads the live transport - #27572
Conversation
Paste and drop planning no longer re-derive an SSH connection from the worktree. After C1 no pane transport carries a relay connection, so the 'ssh' paste kind, the worktree fallback and terminal-paste-ssh-platform.ts are gone.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable paste or drop regression was identified. The PR is mergeable after normal checks. Pre-merge checks |
|
ELI5
When you paste or drop files into a terminal, Orca decides how to format the text for the machine the terminal runs on. It used to look at two things: the terminal's live connection, and a guess based on the workspace's SSH setting. The guess only mattered for the old SSH relay, which is gone. This PR removes the guess, so the terminal's live connection is the only source.
What Changed
resolveTerminalPasteRuntimetakes only the live transport and the PTY id. It no longer takesconnectionIdorremotePlatform, and it has no'ssh'kind. The kinds left are local, WSL and remote runtime.terminal-paste-ssh-platform.ts.resolveTerminalDropTargetShelldropsremotePlatform. A relay-erassh:row now always gets POSIX quoting.useTerminalPaneGlobalEffectsandhandleTerminalProgrammaticTextPasteno longer take aworktreeId. Their only use for it was the removed lookup.Before and after for users: no visible change. Since #27489 (C1), no pane transport carries a relay connection. Local and WSL panes use the IPC transport, which is never given a
connectionId, and paired runtime panes reportgetConnectionId() === null. So the'ssh'branch could only run on a relay-erassh:row. That row's pane holds an inert transport that rejects every write, and its file upload goes throughimportExternalPathsSsh, which already throws in production. On those rows the paste or drop still fails exactly as before. The only difference is the label and quoting the paste planner computes before the write is refused.Net lines: production −66 (+8/−74), tests −338 (+15/−353).
Why
This is Phase 3.99 C3 (design K17 / survey R3). Every paste entry point copied the same fallback, and the live transport already overrode it. Keeping it meant each new paste path had to repeat a relay-era lookup. I chose to remove the
'ssh'kind instead of leaving it unreachable, because a kind that can never be produced makes readers think SSH panes still paste through it. Managed SSH hosts paste asremote-runtime.Linked Issue
Maintainer PR. Part of Phase 3.99 (stack entry C3, depends on C1 #27489).
Visual Proof
N/A: no reachable UI or interaction change (see above).
Testing
Proof that the code is dead:
rgforterminal-paste-ssh-platform/getTerminalPasteSshRemotePlatformover the whole repo, including the@ts-nocheckfiles, returns nothing. No@ts-nocheckfile calls a changed signature.pnpm run build:electron-vitepasses. The change is renderer-only, so CLI and orcad bundles are unaffected.No caller depends on the fallback when it has no transport. A paste with no live transport still writes nothing (
terminal-programmatic-text-paste.test.ts: "does not direct-paste through xterm when the pane has no live transport").pnpm tc,pnpm lint,oxlint,pnpm run check:code-quality:changed(0 new findings).Focused tests: all 22 suites that import a changed module pass (205 tests). The paste runtime suite keeps the local, WSL and remote-runtime cases. The coordinator matrix swaps its two SSH rows for a Windows remote-runtime row. Tests that only covered Windows relay-SSH quoting were removed (1 shell, 1 internal drop, 2 native drop).
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Self-review plus an independent reviewer. Reports are under
.build/runtime-strategy/phase399/reviews/C3-*.md.Agent skill upstream boundary
Notes
Remote SSH: managed SSH hosts are paired runtimes and keep the remote-runtime paste kind and timeout. Windows: WSL detection is unchanged. Folder workspaces: unaffected, because the classification depends only on the transport. No wire change.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)