Repository navigation
refactor(remote): clients connect through a paired-connection handle, not a pairing offer - #27533
Conversation
de51381 to
1eb704a
Compare
8766bff to
6c02776
Compare
6c02776 to
69eb366
Compare
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This refactor changes how remote connection call sites receive their connection data, and the reported behavior is unchanged. No concrete merge-blocking risk was found in the supplied context. Pre-merge checks |
|
69eb366 to
bb54fd8
Compare
… not a pairing offer Desktop, CLI, web and runtime transports now take a PairedRuntimeConnection (endpoint, pinned host key, credential) instead of a PairingOffer. Offers stay on the pairing input path (codes, QR, links, environment add) and are converted with pairedRuntimeConnectionFromOffer. The credential is token-only today; request envelopes still carry the same deviceToken, so the wire is unchanged. This lets device-key and ticket credentials replace the token later without touching every connect call site again.
bb54fd8 to
1e289ba
Compare
ELI5
To talk to a paired Orca host, every client used to carry around the whole "pairing offer", the thing you scan or paste once when you pair. This PR gives clients a small "connection" object instead: where the host is, which host key to expect, and the credential to prove who you are. Pairing offers are still read when you pair; after that, everything connects with the connection object. Nothing changes for users, and nothing changes on the wire.
What Changed
src/shared/paired-runtime-connection.tswithPairedRuntimeConnection = { endpoint, hostPublicKeyB64, credential, pairedDeviceId? }. The credential is the shared handshake'sPairedE2EEAuthCredential, which is{ kind: 'token', deviceToken }today.pairedRuntimeConnectionFromOffer(offer)converts at the pairing boundary.getPreferredPairedRuntimeConnection(environment)next togetPreferredPairingOffer. The web client hasgetPreferredWebRuntimeConnection.PairingOffer.PairedRuntimeConnection. Every place that sends the token readsconnection.credential.deviceToken, so request envelopes and the auth frame carry the same bytes as before.PairingOffer(by design):orca environment addand the environment stores, which persist what was paired;verifiedPairingis nowverifiedConnection.Why
The next pairing steps replace the token with a per-device key (browser first, then desktop and CLI) and add single-use tickets. If every connect call site still took a pairing offer, each of those steps would edit about 50 files and mix a mechanical change with a security change. Moving to a handle first keeps those later PRs small: they change what goes in
credential, not every caller.The alternative was to add optional credential fields to
PairingOffer. That type is also the pairing wire format and the stored record, so widening it would leak client-only state into what hosts and old clients parse.Linked Issue
Part of #17394 / #17399 (preparation). No user-visible fix on its own.
Visual Proof
N/A: a type-level refactor with no UI or behaviour change.
Testing
src/shared/paired-runtime-connection.test.ts(written first): offer to handle, the token accessor, and the environment's preferred endpoint.Updated every transport, IPC, SSH, browser and web test that passed an offer to a connect path; test servers now hand out a connection (and the offer where a test re-encodes a code).
pnpm tc, focused vitest oversrc/shared,src/cli,src/main/{ipc,ssh,browser,runtime},src/renderer/src/{web,runtime}, oxlint,pnpm run check:code-quality:changed,pnpm lint.No cross-version test added: nothing on the wire changes. The B2 cross-version suite (stacked below) still covers the handshake bytes.
Automated tests added/updated
Agent skill upstream boundary
Notes
Stacked on #27523. SSH: managed-server probes and tunnel identity checks connect through the handle; the tunnel endpoint override is applied to the handle exactly as it was to the offer. Windows/Linux/macOS: no platform code.
Checklist
N/Afor visuals, with reason