fix(bridge): unify active ensure and reconnect recovery (Layer 1b)#2032
Merged
Conversation
ceb989e to
563402b
Compare
563402b to
879024c
Compare
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
Layer 1b for Browser Bridge stability, stacked on #2031.
This rewrites the earlier readiness-only patch into a full active ensure path:
src/browser/config.ts) soruntime.tsanddaemon-client.tsshare timeout constants without a runtime/browser import cyclesrc/browser/daemon-transport.ts, preserving the fix(browser): enforce fixed daemon bridge port #2031 fixed-port +OPENCLI_DAEMON_PORTfatal guardwaitForBridgeReady+ pre-dispatch error classification insrc/browser/bridge-readiness.tsBrowserBridge._ensureDaemon()logic intoensureBrowserBridgeReady()indaemon-lifecycle.tssendCommandRaw()use the full ensure path for pre-dispatch daemon errors and localTypeErrorbefore resending with a fresh transport idcommand_result_unknownand client-sideAbortErrornon-retryable0.5minutes) and reschedules pending slow timers to fast cadence after/pingsucceedsOPENCLI_BROWSER_CONNECT_TIMEOUTfrom 30s to 45s so the CLI has margin over Chrome's 30s alarm wake floorVerification
HOME=$(mktemp -d) npx vitest run --project unit src/browser/bridge-readiness.test.ts src/browser/daemon-client.test.ts src/browser.test.ts src/cli.test.tsnpx vitest run --project extension extension/src/background.test.tsnpx vitest run --project extension extension/src/npm run typechecknpm run buildcd extension && npm run buildHOME=$(mktemp -d) npm test-> 527 files / 5542 passed / 1 skippedOPENCLI_DAEMON_PORT=19999 node dist/src/main.js daemon status-> clean actionable error, exit 78OPENCLI_DAEMON_PORT=19999 node dist/src/daemon.js-> clean actionable error, exit 2Note:
cd extension && npm run typecheckcurrently fails in this checkout because the extension package does not have its own installed@types/chrome; root typecheck, extension build, and extension vitest pass.