feat: route process calls directly to browser VMs - #174
Merged
Conversation
tnsardesai
force-pushed
the
hypeship/tier2-process-direct
branch
from
August 25, 2026 19:31
1f9e75b to
9e1a053
Compare
tnsardesai
marked this pull request as ready for review
August 25, 2026 19:48
Sayan-
previously approved these changes
Aug 26, 2026
Sayan-
left a comment
Contributor
There was a problem hiding this comment.
Verified at 9e1a053. All 7 public process paths map to matching instance paths, the control-plane handlers have no gating or persistence, 23 tests pass. Method coverage is adequate: process/exec covers routed POST, telemetry/stream already covers routed GET and SSE.
Worth pinning: the fallback replays on any 401/403 carrying a jwt, which is safe only because metro-api rejects in verifySession before reaching the VM and no process endpoint declares 401/403 on the instance. If either changes, a replayed exec double-executes.
Pre-existing: matchesDirectVMPrefix doesn't trim its prefixes, unlike Python's.
Sayan-
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
processto the default direct-to-VM browser routing allowlistfs/*andtelemetry/eventson the control plane and preserve the environment override/kill switchtesting
yarn test(410 passed, 227 skipped)yarn lint/browser/kernel/process/...and returned the expected outputrelease
This PR targets
next. After merge, release-please opens or updates the versionednext → mainrelease PR. Merging that release PR publishes the npm package.Note
Medium Risk
Default routing for all
process/*browser calls changes from control plane to VM, which affects latency, failure modes, and auth for existing SDK users unless they override env; scope is limited to browser subresource routing with existing JWT fallback behavior.Overview
Adds
processto the default direct-to-VM browser routing allowlist inbrowser-routing.ts, so paths likeprocess/execandprocess/.../stdout/streammatch the existing prefix rules and are sent to the session VM (JWT on the VM URL, APIauthorizationstripped) instead of the control plane API origin.fs/*andtelemetry/eventsremain on the API by default;KERNEL_BROWSER_ROUTING_SUBRESOURCESstill overrides or disables routing when set.Tests now expect
processin the default list, assert prefix matching for process paths, includeprocess.execin the default VM routing integration test, and drop process from the “stays on API origin” case.Reviewed by Cursor Bugbot for commit 9e1a053. Bugbot is set up for automated code reviews on this repo. Configure here.