Repository navigation
Conversation
buildTerminalWorkspaceEnv injected buildAgentHookPtyEnv() for every runtime-created terminal, so SSH-hosted terminals received the desktop's 127.0.0.1 hook port, auth token and local endpoint path. On the remote host those point at the remote loopback and a desktop-only file; the relay hook server supplies host-valid coordinates instead. Only the jcode runtime dir was guarded; apply the same local-only gate to the hook env. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The SSH terminal environment change appears ready to merge after normal checks. No actionable regression was identified. Security Architecture ReviewSecurity architecture risk: ⚪ Minimal · up to The change stops desktop hook credentials from being included in SSH terminal requests while preserving local behavior and independently supplied remote credentials. No material security risk was found to be introduced or worsened. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Gate loopback agent-hook env on local scope —
buildTerminalWorkspaceEnvnow computesisLocal = scope.connectionId === nulland only spreadsbuildAgentHookPtyEnv()when local, so SSH terminals no longer receive the desktop's loopback port/token or its local endpoint path. Pane identity is unchanged. - Regression test added —
ssh-terminal-agent-hook-env.spec.tscreates a terminal on an SSH repo and asserts the five hook keys never reachspawnwhileORCA_PANE_KEY/ORCA_TAB_IDdo; wired intoorca-runtime.test.ts.
This matches the existing contract on the local PTY path (buildPtyHostEnv's "do not call for SSH" doc), and remote hooks keep working because the relay's own hook server registers buildPtyEnv() as a PTY env augmenter (src/relay/relay-agent-hook-runtime.ts:76), which wins over renderer-supplied env (src/relay/pty-handler.ts:900). WSL and runtime hosts stay local here, so they are unaffected.
Verified locally against c8bde74: full orca-runtime.test.ts passes (1350 passed, 1 skipped), the new test fails when the gate is ablated (ORCA_AGENT_HOOK_PORT: expected '54321' to be undefined), and oxfmt --check/oxlint are clean on the changed files.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thank you, @matbrgz, this was a real problem with the old design. The legacy SSH relay has since been removed (#27214, #27215): SSH terminals are now spawned by Orca's managed server on the host, which injects its own hook receiver address (agent hooks are set up when it starts, #27319), and the desktop no longer spawns SSH terminals itself, so its loopback hook env can't reach them. Closing as resolved. |

ELI5
Orca gives each terminal a small "address and password" so coding agents inside it can report their status back to the app. That address only works on your own computer. Terminals running on a remote machine over SSH were being handed your computer's address and password anyway. Now they aren't; the remote machine keeps using the address Orca's remote helper gives it.
What Changed
buildTerminalWorkspaceEnvonly adds the local agent-hook env (buildAgentHookPtyEnv()) when the terminal's scope is local (connectionId === null), the same gate already used for the jcode runtime dir.ORCA_PANE_KEY,ORCA_TAB_ID,ORCA_WORKTREE_ID) is unchanged.Why
The hook port/token are a secret for a receiver bound to the desktop's 127.0.0.1, and the endpoint is a desktop file path the hook scripts source. On a remote host they either leak to whatever listens on that remote port or point at nothing. Remote hooks already get host-valid values from the relay's hook server on that host, so nothing remote depends on the desktop values. Gating at the single env builder (used by both create and split) is the smallest change; stripping later at the SSH spawn boundary was considered but would still mint and pass the secret through more layers first.
Linked Issue
Fixes #25519
Visual Proof
N/A — no UI change; this only changes the environment variables passed to SSH-hosted terminal processes.
Testing
Automated tests added/updated, or explained why not below
I manually tested these changes locally
New regression test
src/main/runtime/orca-runtime-tests/ssh-terminal-agent-hook-env.spec.ts(wired intoorca-runtime.test.ts): creates a terminal on an SSH repo with a hook env builder and asserts none of the five hook keys reach the spawn, while pane identity does. Verified it fails before the fix (ORCA_AGENT_HOOK_PORT: expected '54321' to be undefined) and passes after.npx vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime.test.ts— 1350 passed (includes the existing local hook-injection test, still green).pnpm lint— pass.pnpm typecheck— pass.Full
pnpm testandpnpm buildnot run locally; relying on CI.Platforms: macOS only, via unit tests; no live SSH session tested.
AI Disclosure
Implemented with Claude Code (Claude Opus 5.5); reviewed by the author.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred) — lint and typecheck pass locally; full test suite and build left to CI