feat: route process calls directly to browser VMs - #160
Merged
Conversation
tnsardesai
force-pushed
the
hypeship/tier2-process-direct
branch
from
August 25, 2026 19:31
5d878a2 to
f833c55
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
Collaborator
There was a problem hiding this comment.
Verified at f833c55. All 7 public process paths map to matching instance paths, the control-plane handlers have no gating or persistence, 29 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: routing.py:263 overwrites a caller-supplied jwt, unlike Node and Go.
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
pytest(678 passed, 2952 skipped)ruff checkandruff format --checkon touched files/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 PyPI package.Note
Medium Risk
Changes default request routing for all process browser APIs without an env override; misconfigured VMs or prefix edge cases could break exec/streaming until clients adjust
KERNEL_BROWSER_ROUTING_SUBRESOURCES.Overview
Adds
processto the default direct-to-VM browser routing allowlist, sobrowsers/{session}/process/...calls (e.g.exec, nested paths likeprocess/proc-1/stdout/stream) are rewritten to the cached browser VM base URL with JWT query auth—same ascurl,computer, andplaywright.fs/*andtelemetry/eventsstay on the control plane; emptyKERNEL_BROWSER_ROUTING_SUBRESOURCESstill disables routing.Tests now expect default
processrouting (prefix matcher,rewrite_direct_vm_options, and integration viaKernel.browsers.process.exec), and process was removed from the “stays on API origin” default test.Reviewed by Cursor Bugbot for commit f833c55. Bugbot is set up for automated code reviews on this repo. Configure here.