feat: relay runtime calls through the editor socket - #102
Merged
Conversation
Chromium gates a public page's connection to 127.0.0.1 behind a local access permission, per origin (Chrome 142+, websockets from 147). The launch page is a separate origin from the editor, so runtime tools needed a second grant that was requested silently during a popup's page load — when it wasn't given, the launch page simply never connected and the failure was indistinguishable from a server that wasn't running. The editor peer can now declare that it relays for the launch page. `runtime:*` frames ride the editor socket unchanged, so only the editor origin ever needs the permission. A `hello` frame advertises the capability on connect; an editor that doesn't answer it keeps opening its own runtime socket, so older editor builds work untouched. Failure text now names the permission instead of only blaming popups, and launch_start reports whether it adopted an already-running app.
This was referenced Aug 24, 2026
The launch page no longer opens its own websocket. The editor holds the only socket and relays runtime:* over it, so the runtime role, the _relay flag and the hello/relay negotiation are gone — the relay is the sole path.
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.
Chromium gates public→loopback behind a per-origin permission (Chrome 142+, websockets from 147), so the launch page needed a second grant — requested silently while a popup loaded, and silent when refused.
The editor peer can now declare that it relays for the launch page:
runtime:*frames ride the editor socket, so only the editor origin needs the permission. Ahelloframe advertises the capability; editors that ignore it keep opening their own runtime socket, and older servers send no greeting, so both directions still work (verified against the published 0.6.1).Failure text now names the permission instead of only blaming popups, and
launch_startreportsadopted.Pairs with playcanvas/editor#2217.
Smoke test
mcp_port, the screenshot returns.adopted: true, no second window.adopted: false, the old window closes.launch_startfirst and mentions no launch-page permission.