Repository navigation
fix(cli,engine): pin the page server's direct host to an explicit port and the Studio's own origin - #7945
Merged
Conversation
…t and the Studio's own origin The bypass entry for a restricted browser's page server now always names its port, so a default port no longer admits every port on the host. Studio thumbnails take the server's own origin, not a request's Host header. A stop signal that lands while the temp profile is being made removes it and launches no Chrome. The wiring test follows renamed and namespaced calls, requires the callback to pass on the network's args and profile, and refuses an unset pageServerUrl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
vanceingalls
approved these changes
Nov 16, 2026
vanceingalls
left a comment
Collaborator
There was a problem hiding this comment.
Approved at 92b2660. All the #7941 notes are addressed:
- pageServerDirectHost fills in 80/443 and keeps an explicit port and IPv6 brackets. Both bypass sites (CLI pageNetwork, engine browserManager) use it.
- The thumbnail direct host is pinned to the Studio server's own origin.
- A stop during profile creation skips the Chrome launch and removes the profile. The test asserts both.
- The wiring test follows namespace imports and renames, and treats undefined/null pageServerUrl as missing.
- localhost vs 127.0.0.1 fails closed: the other spelling still goes through the proxy and is refused.
Merge once the pending checks are green.
Non-blocking:
- launchCaptureBrowser.ts:58 still uses
new URL(localOrigin).host. It's safe today, since localPage writes 127.0.0.1:, but route it through pageServerDirectHost so the default-port case can't come back. - A stop that lands while Chrome is launching, after the profile exists, still leaves that browser running (pre-existing).
- The wiring test misses
const f = launchManagedBrowseraliases and computedengine["acquireBrowser"]calls.
Contributor
Edit accuracy: accurate 267 (base branch 267), smooth 103 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (2)
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 16, 2026
Collaborator
Author
|
Taken out of the merge queue at Miguel's request so the v0.9.58 release (#7932) can land first; any OSS merge before it forces another re-cut. Re-queue once 0.9.58 is on npm. — Rames |
2 of 4 tasks
Merged
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.
What
Review follow-ups to #7941:
--proxy-bypass-listashostname:port, with the port always written, through a new engine helperpageServerDirectHost.URL.hostdrops a scheme's default port, so a page server athttp://localhost/gave the entrylocalhost, which Chrome reads as every port on that host. It now giveslocalhost:80.localhost:4100and127.0.0.1:4100no longer close each other's browser.launchWithPageNetworkthen refuses to launch Chrome, so a Ctrl-C at that moment leaves no profile behind.engine.acquireBrowser(…)counts. It flags any import or destructuring that renames a watched function. AlaunchWithPageNetworkcallback must pass on bothnetwork.argsandnetwork.userDataDir. ApageServerUrlofundefined,nullorvoidcounts as missing.Why
From the reviews of #7941: a bypass entry with no port widens the direct host to the whole host, a request's Host header could pick the thumbnail page's direct host, a stop that lands during profile creation leaks that profile, and the wiring test checked only where a launch sat, not whether it used the fence.
Related work
Refs #7941, #7935
How
pageServerDirectHost(url)in@hyperframes/engine/public-networkreturnshostname:port, filling in 80 or 443. The engine's pool browser (createBrowserLaunchFingerprint) and the CLI helper both use it.launchWithPageNetworkkeeps the profile's promise. The memoized release awaits it before removing the folder, and a launch that finds the release already ran throws instead of starting Chrome.getThumbnailBrowsertakesoptions.origin?.() ?? previewUrland keys reuse onnew URL(…).origin.Test plan
fails without the fix:
browserManager.test.ts"names the page server's port even when the URL leaves out the default".http://localhost/gavelocalhost; nowlocalhost:80,127.0.0.1:443and[::1]:4321.fails without the fix:
pageNetwork.test.ts"names the page server's port in the bypass entry even when the URL leaves it out".fails without the fix:
pageNetwork.stop.test.ts. The profile creation is held until the stop cleanup has started. On main the profile stays on disk; with the fix it's removed and Chrome isn't launched.fails without the fix:
studioServer.test.ts"gives the thumbnail browser the server's own origin, whatever host a request named". Three requests naming127.0.0.1:4100,localhost:4100andlocalhost:9999launch one browser withpageServerUrl: http://127.0.0.1:4100.fails without the fix:
pageNetwork.wiring.test.tswith...network.argsremoved fromlayout.ts. The positive control now also covers a namespace call,pageServerUrl: undefined, a renamed import, a renamed destructuring and a callback that dropsnetwork.args.CLI
src/browser/,studioServer.test.tsand the real-ChromecaptureCompositionFrame.pageNetwork.browser.test.tswith chrome-headless-shell 157: 297 pass. EnginebrowserManager.test.tsandpublicNetwork: 197 pass. The pre-commit hook passes (typecheck, lint, format, fallow), and so do the comment citation and ratchet checks.Not exercised: a real Studio session with the flag on.
Unit tests added/updated
Manual testing performed
Comments follow CONTRIBUTING.md "Comments"
— Rames Jusso (hyperframes)
🤖 Generated with Claude Code