Repository navigation
Conversation
createTab() and a raw Target.createTarget sent through the bridge both recorded the new targetId in registry.current() when the reply arrived. If the runtime switched task space while the request was in flight, the tab was filed under, and made active in, the space selected at reply time. Remember the requesting space and file the tab there; when that space has been removed meanwhile, the tab is not moved into another one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to spawn ensureBrowser() attached no 'error' listener to the child it spawns. A browser path that does not exist or cannot be executed made Node emit an unhandled 'error' event (ENOENT or EACCES) and the process exited with a stack trace instead of ensureBrowser() rejecting. Listen for the error, end the readiness polling with it, and keep a late error from becoming an unhandled rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Two independent defects in
ego-windows-host, one commit each:ensureBrowser()crashed the process with an unhandled'error'event when the browser executable could not be spawned, instead of rejecting.Related issue
None: issues are disabled on this repository.
Changes
1. New tabs are filed under the space that created them (
src/ego-bridge.ts)createTab()and a rawTarget.createTargetsent throughsendCDPMessage()both recorded the newtargetIdwithregistry.trackTarget(id)andregistry.setActive(id)when the reply came back. Both default toregistry.current(). If the runtime switched task space while the request was in flight, the tab was added to, and made active in, the newly selected space.createTab()now files the tab under the space it read before sending the request. For a rawTarget.createTarget, the bridge keeps the sending space next to the request id and files the reply under that space. If that space was removed in the meantime, the registry ignores the tab instead of moving it into another space.2.
ensureBrowser()rejects when the browser fails to spawn (src/chrome-launcher.ts)No
'error'listener was attached to the spawned child. A browser path that does not exist or cannot be executed made Node emit an unhandled'error'event, and the process exited with a stack trace.ensureBrowser()now listens for that error, stops polling for the DevTools endpoint, and rejects with it. A later error is still handled after the polling loop ends.Reproduction: call
ensureBrowser({ port: 1, userDataDir, browserPath: () => "/nonexistent/msedge.exe", timeoutMs: 3000 })inside atry/catch. Onmain, thecatchnever runs:On this branch,
ensureBrowser()rejects withspawn /nonexistent/msedge.exe ENOENTabout 20 ms after the call.Verification
Run from
package/ego-windows-hostafter buildingpackage/ego-browser, on Linux, as the workflow'subuntu-latestleg does.mainnpm test(build, typecheck, tests)main's sourceprettier --checkon the changed filesThe new tests use the existing fakes, so nothing here needs a real browser. They have not been run on a Windows machine; the
windows-latestleg of the Windows Host workflow covers that.Impact
No public API change. Tabs stay in the space that created them across a space switch, and a browser that cannot be started is reported as an error instead of ending the process.
🤖 Generated with Claude Code