Skip to content

feat: route process calls directly to browser VMs - #174

Merged
tnsardesai merged 1 commit into
mainfrom
hypeship/tier2-process-direct
Aug 26, 2026
Merged

feat: route process calls directly to browser VMs#174
tnsardesai merged 1 commit into
mainfrom
hypeship/tier2-process-direct

Conversation

@tnsardesai

@tnsardesai tnsardesai commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

summary

  • add process to the default direct-to-VM browser routing allowlist
  • cover process exec, spawn, kill, resize, status, stdin, and stdout streaming through the existing prefix matcher
  • keep fs/* and telemetry/events on the control plane and preserve the environment override/kill switch

testing

  • yarn test (410 passed, 227 skipped)
  • yarn lint
  • live browser validation: exec, spawn, and stdout streaming routed through /browser/kernel/process/... and returned the expected output

release

This PR targets next. After merge, release-please opens or updates the versioned next → main release 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 process to the default direct-to-VM browser routing allowlist in browser-routing.ts, so paths like process/exec and process/.../stdout/stream match the existing prefix rules and are sent to the session VM (JWT on the VM URL, API authorization stripped) instead of the control plane API origin.

fs/* and telemetry/events remain on the API by default; KERNEL_BROWSER_ROUTING_SUBRESOURCES still overrides or disables routing when set.

Tests now expect process in the default list, assert prefix matching for process paths, include process.exec in 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.

@tnsardesai
tnsardesai force-pushed the hypeship/tier2-process-direct branch from 1f9e75b to 9e1a053 Compare August 25, 2026 19:31
@tnsardesai tnsardesai changed the title Route process calls directly to browser VMs feat: route process calls directly to browser VMs Aug 25, 2026
@tnsardesai
tnsardesai changed the base branch from main to next August 25, 2026 19:31
@tnsardesai
tnsardesai marked this pull request as ready for review August 25, 2026 19:48
@tnsardesai
tnsardesai requested a review from Sayan- August 25, 2026 19:48
Sayan-
Sayan- previously approved these changes Aug 26, 2026

@Sayan- Sayan- left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tnsardesai
tnsardesai changed the base branch from next to main August 26, 2026 01:00
@tnsardesai
tnsardesai dismissed Sayan-’s stale review August 26, 2026 01:00

The base branch was changed.

@tnsardesai
tnsardesai requested a review from Sayan- August 26, 2026 01:04
@tnsardesai
tnsardesai merged commit e58d036 into main Aug 26, 2026
11 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.

2 participants