Skip to content

refactor(rpc): delete the SSH-bridge caller scope - #27440

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-0-8
Oct 11, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/p399-0-8

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​4 $\color{#cf222e}{\Huge{\mathbf{−}}}$​746 $\color{#cf222e}{\Huge{\mathbf{−}}}$​742
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​13 $\color{#cf222e}{\Huge{\mathbf{−}}}$​535 $\color{#cf222e}{\Huge{\mathbf{−}}}$​522

ELI5

When Orca still had its own relay on SSH hosts, the orca command run on such a host was handed a special limited key so it could only touch that host's own terminals. The relay is gone, so nobody hands out that key anymore. This PR deletes the lock that checked it, and the client code that looked for it.

What Changed

  • Users see no difference. Every caller that exists today (this desktop and its own CLI, phones, paired desktops/web/--host runtime: CLIs) goes through exactly the same permission checks as before.
  • Mechanism: the runtime's permission table had a fourth caller kind, ssh-bridge, produced only when a request carried a credential from sshBridgeCredentials.mint. That function has had no caller since refactor(ssh): connect fails for hosts orcad can't serve; remove the relay client path #27214 deleted the relay client (git log -S sshBridgeCredentials.mint: added in e3639ef, last caller removed in ff27338). So the lookup always missed, the per-call host binding always returned "unbound", and the result filter was always the identity. Removed:
    • rpc/ssh-bridge-{credentials,host-binding,orchestration-binding}.ts, the ssh-bridge row in rpc-caller-scope.ts, and the binding/filter step in the admission prologue and both dispatchers;
    • the bridge-credential lookup in runtime-rpc-request-admission.ts (an unknown token is "Invalid auth token", as it already was in practice);
    • CLI side: cli/ssh-bridge-command-policy.ts and its three call sites, shared/ssh-bridge-credential-env.ts, and its read in cli/runtime/transport.ts;
    • tests for that dead path and their fixture; the bridge cases in rpc-caller-scope, ssh-target-management and dispatcher-transport-parity tests (the one-shot-streaming refusal test now pins a paired caller instead).
  • Kept: the allowRemoteCliControl SSH target field (older peers still send it), and the unrelated persisted ssh_bridge automation owner value.

Net: production +13 / −519, tests +4 / −761.

Why

Every RPC change had to reason about a caller kind that never occurs. Deleting it is the first step before folding the two dispatchers into one (next PR). Alternative considered: keep the scope in case the relay returns. Rejected: the credential was minted and checked inside the same desktop process, so no older or newer peer depends on it, and a future host-scoped CLI would go through orcad, not this table.

Mixed versions / security: no wire format changes. The only observable difference is if someone manually exports ORCA_SSH_BRIDGE_CREDENTIAL on the owner's machine: the CLI used to send it and get "Invalid auth token"; now it ignores it and uses the owner token from the 0o600 metadata file, which that same user can already read. No privilege change.

Linked Issue

Phase 3.99 cleanup, item 0.8 (maintainer, no issue).

Visual Proof

N/A — no UI or behaviour change; dead code removal.

Testing

Dead-code proof:

  • rg over src, config, mobile, tests (including the @ts-nocheck files) for every removed symbol (sshBridgeCredentials, SSH_BRIDGE_*, SshBridge*, readSshBridgeCredential, ORCA_SSH_BRIDGE_CREDENTIAL, kind: 'ssh-bridge', the deleted module paths): no remaining references.
  • pnpm build:cli, pnpm build:electron-vite, pnpm build:orcad all pass; no removed symbol in out/.

Checks: pnpm tc; pnpm test src/main/runtime/rpc src/cli src/main/runtime/runtime-rpc (516 files, 5376 tests pass); pnpm lint (all ratchets pass); pnpm run check:code-quality:changed (0 new findings).

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Review

Self review + independent reviewer, P0/P1 only.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: owner, mobile (incl. delegated) and runtime-paired rows unchanged. SSH: no SSH host ever reached this path after the relay removal. Cross-platform: no platform code touched. Mobile: unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Nothing mints an SSH-bridge credential since the relay client was removed
(#27214), so the 'ssh-bridge' caller kind, its host binders, result filter,
the CLI bridge-mode policy and the ORCA_SSH_BRIDGE_CREDENTIAL env read could
never run. The allowRemoteCliControl target field stays for older peers.
@coderabbitai

coderabbitai Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a8c97fa-d606-4837-8272-ce46c05247bf

📥 Commits

Reviewing files that changed from the base of the PR and between 2148111 and a909e4b.


📒 Files selected for processing (21)
  • config/scripts/ci-shard-timings.json
  • src/cli/index.ts
  • src/cli/runtime/transport-ssh-bridge-credential.test.ts
  • src/cli/runtime/transport.ts
  • src/cli/ssh-bridge-command-policy.test.ts
  • src/cli/ssh-bridge-command-policy.ts
  • src/main/runtime/rpc/dispatcher-transport-parity.test.ts
  • src/main/runtime/rpc/dispatcher.ts
  • src/main/runtime/rpc/methods/ssh-target-management.test.ts
  • src/main/runtime/rpc/rpc-caller-scope.test.ts
  • src/main/runtime/rpc/rpc-caller-scope.ts
  • src/main/runtime/rpc/rpc-request-admission-prologue.ts
  • src/main/runtime/rpc/rpc-streaming-dispatcher.ts
  • src/main/runtime/rpc/ssh-bridge-credentials.ts
  • src/main/runtime/rpc/ssh-bridge-host-binding.ts
  • src/main/runtime/rpc/ssh-bridge-orchestration-binding.test.ts
  • src/main/runtime/rpc/ssh-bridge-orchestration-binding.ts
  • src/main/runtime/runtime-rpc-ssh-bridge-credential.test.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-request-admission.ts
  • src/main/ssh/ssh-bridge-caller-scope.test-fixture.ts
  • src/shared/ssh-bridge-credential-env.ts

💤 Files with no reviewable changes (14)
  • src/main/runtime/rpc/methods/ssh-target-management.test.ts
  • src/main/ssh/ssh-bridge-caller-scope.test-fixture.ts
  • src/cli/runtime/transport-ssh-bridge-credential.test.ts
  • src/cli/ssh-bridge-command-policy.test.ts
  • src/cli/index.ts
  • src/main/runtime/runtime-rpc-ssh-bridge-credential.test.ts
  • src/main/runtime/rpc/ssh-bridge-orchestration-binding.test.ts
  • src/cli/ssh-bridge-command-policy.ts
  • src/main/runtime/runtime-rpc/runtime-rpc-request-admission.ts
  • src/shared/ssh-bridge-credential-env.ts
  • src/main/runtime/rpc/ssh-bridge-credentials.ts
  • config/scripts/ci-shard-timings.json
  • src/main/runtime/rpc/ssh-bridge-orchestration-binding.ts
  • src/main/runtime/rpc/ssh-bridge-host-binding.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

The changes remove SSH bridge credential authentication, CLI command restrictions, and RPC caller-scope and host-binding checks. Runtime RPC admission now accepts the runtime auth token and rejects other tokens as invalid. Standard and streaming unary dispatch return invocation results without applying binding result filters. Related tests and CI timing records are removed or updated.


Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to a909e

No actionable regression was established in the supported SSH or CLI paths. The PR is mergeable after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: removal of the unused SSH-bridge RPC caller scope.
Description check Passed The description is complete and follows the repository template. It explains the change, rationale, user impact, linked work, testing, security considerations, platform impact, and checklist status.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin
OrcaWin merged commit 6ad1a67 into main Oct 11, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant