Skip to content

feat(browser): route tunnels through execution hosts - #14513

Closed
Jinwoo-H wants to merge 1 commit into
sta-4150-browser-tunnel-reconnectfrom
sta-4150-browser-execution-host-routes
Closed

Jinwoo-H wants to merge 1 commit into
sta-4150-browser-tunnel-reconnectfrom
sta-4150-browser-execution-host-routes

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1169 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1153
Prod 17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1184 $\color{#cf222e}{\Huge{\mathbf{−}}}$​99 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1085

Summary

Adds the inert execution-host routing layer for STA-4150, stacked on #14507.

  • preserves the exact native v1 attach payload and capability pair
  • adds a separately capability-gated SSH execution-host descriptor
  • binds non-native routes to an exact runtime-minted, lease-generation-scoped grant
  • routes domains through ssh2 forwardOut or one owned standalone system-OpenSSH dynamic forward, keeping DNS on the execution host
  • fences pending and live routes on lease, grant, RPC, provider-epoch, connection-generation, or tunnel-generation loss
  • sanitizes connector errors and releases deferred sockets, probes, processes, handlers, and memory ownership exactly once

Production capability advertisement and RPC registration remain disabled. This PR does not activate client-hosted Electron browsing or change current server/offscreen placement.

Compatibility

  • old clients and servers keep the byte-identical native v1 shape
  • SSH requires both network.browserTunnel.executionHosts.v1 and a live exact grant
  • unknown peers never receive the new descriptor
  • domains are not resolved on the desktop
  • folder workspaces and git worktrees are unaffected; routing keys are structural and platform-independent
  • fix(browser): acknowledge paired tab before navigation #14402 remains the independent Stage 0 server-hosted compatibility fix

Evidence

  • focused execution-host gate: 13 files, 142 tests passed
  • ephemeral Docker sshd: 2/2 passed through real ssh2 and real system OpenSSH to a container-only DNS name
  • full runtime RPC: 138 files, 1,355 passed, 1 skipped
  • mixed-version terminal wire: 5/5 passed
  • Node, web, and CLI typecheck passed
  • native, type-aware, changed-code, reliability, and max-lines gates passed
  • three fresh correctness/security/performance reviews found no P0/P1/P2 publication blocker

Activation blockers

  • both local SOCKS layers are no-auth; the system-SSH listener is outside application stream/rate/memory accounting
  • system-SSH port allocation/readiness cannot yet prove child ownership and remains raceable
  • standalone BatchMode=yes -S none does not preserve every ControlMaster-only, passphrase, PIN, or keyboard-interactive target
  • execution-host grants need bounded, ref-counted page/partition ownership
  • Node stream-internal accounting and strict cross-route fairness are incomplete
  • WSL, browserless serve, headed Linux, physical Windows/macOS, and mixed old/new tunnel journeys are not yet proven
  • Electron route/profile partitions, proxy verification before navigation, exact WebContents registration, crash/reload reconciliation, and no-fallback proof are later stages

Do not merge this layer as feature activation; it is reviewable infrastructure for the staged STA-4150 stack.

@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch 2 times, most recently from 6013180 to 846e314 Compare August 14, 2026 20:14
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch from 846e314 to 5cc6ee2 Compare August 14, 2026 21:01
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch 2 times, most recently from 796314b to f5981f4 Compare August 15, 2026 00:44
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch 2 times, most recently from df598b0 to d155c3e Compare August 15, 2026 02:57
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch from d155c3e to b561ef1 Compare August 15, 2026 03:24
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch from b561ef1 to 343640a Compare August 15, 2026 08:53
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch 2 times, most recently from 6c33380 to 422aafd Compare August 15, 2026 11:34
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch from 422aafd to 2e8e9a7 Compare August 15, 2026 12:30
@Jinwoo-H
Jinwoo-H force-pushed the sta-4150-browser-execution-host-routes branch from 2e8e9a7 to 93ed2f2 Compare August 16, 2026 09:09
@OrcaWin

OrcaWin commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Closing because the execution-host routing layer is already implemented on main (1a723194c32).

I read the complete production patch and body/available discussion and compared the introduced regression intent. Main retains the exact native v1 descriptor and separately negotiated non-native capability; SSH authority still includes target ID, provider epoch and connection generation, with structural tuple keys. The runtime requires an exact grant scoped to the authenticated device's current lease generation, fences pending connector startup when that grant is revoked, and fences live tunnels on grant/lease/provider/connection loss. Current page ownership adds ref-counted grants.

The ssh2 route still passes the original destination hostname and port to forwardOut, captures the exact client and connection authority, and destroys late channels after retirement. The system-OpenSSH route still owns one standalone non-interactive dynamic forward for the route, carries domain names in SOCKS requests, and releases sockets, probe timers, listeners and process on abort/close. Public errors retain the sanitized allowlist. Deferred-socket close-once and late-source destruction remain; current source settlement supports bounded upstream credit.

Later main changes add WSL and native host proxy policy. OpenSSH argument assembly is shared with other forward processes; ExitOnForwardFailure=no deliberately tolerates already-held configured forwards while readiness probes the requested -D listener. The original inactive-registration assertions are superseded by production activation. This closure does not claim the documented local SOCKS trust/port-ownership or authentication limitations were eliminated.

Validation: six focused current suites passed all 47 tests (deferred sockets, native route selection, SSH authority and lifecycle, SOCKS domain transport, dynamic-forward startup/abort and port-forward integration). The preceding runs covered unchanged lease/protocol/grant contracts, 13 tunnel RPC tests including startup revocation/sanitization, and 62 transport tests including real paired-runtime E2EE SOCKS-to-HTTP. Relevant contracts are unchanged in HEAD..origin/main. The Docker remote-only DNS journey and physical/Electron platform matrix were not rerun here.

@OrcaWin OrcaWin closed this Oct 26, 2026
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.

2 participants