Conversation
Replace two overlapping error classification systems with a single classifyBrowserError() that returns retry advice (retryable + delayMs): - Extension/daemon transient errors → retryable, 1500ms delay - CDP target navigation errors → retryable, 200ms delay - Non-transient errors → not retryable Deduplicate sendCommand/sendCommandFull retry loop into sendCommandRaw, making both public functions thin return-value wrappers.
classifyBrowserError() now returns a `kind` field: - extension-transient: retried by daemon-client only - target-navigation: retried by page-level settle logic - non-retryable: no retry Page.goto() and Page.evaluate() now only settle-retry on target-navigation, preventing extension/daemon errors from being silently swallowed as settle noise.
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
isTransientBrowserError+isRetryableSettleError) with a singleclassifyBrowserError()that returns{ retryable, delayMs }sendCommand()/sendCommandFull()retry loop (44 lines of identical code) intosendCommandRaw()Design change
Before: two separate systems answering the same question ("is this error transient?") with different pattern lists, different delay strategies, in different files.
After: one function, one pattern list, one place to maintain. Each error category carries its own retry delay:
Files changed
src/browser/errors.tsclassifyBrowserError()→RetryAdvice;isTransientBrowserError()kept as convenience wrappersrc/browser/daemon-client.tssendCommandRaw(), usesclassifyBrowserError().delayMsinstead of hardcoded 1500mssrc/browser/page.tsisRetryableSettleError(), useclassifyBrowserError()with its delay advicesrc/browser/errors.test.tssrc/browser.test.tsTest plan
isTransientBrowserError()still works (backward compat wrapper)isTransientBrowserErrorfrom errors.ts