errors: classify CDP debugger-detach as transient (retry-able)#1182
Open
gucasbrg wants to merge 1 commit intojackwener:mainfrom
Open
errors: classify CDP debugger-detach as transient (retry-able)#1182gucasbrg wants to merge 1 commit intojackwener:mainfrom
gucasbrg wants to merge 1 commit intojackwener:mainfrom
Conversation
When a daemon command races with another concurrent command, the daemon emits "Detached while handling command id=..." and aborts. The e2e test harness already treats this (and the related "No tab with id" / "Debugger is not attached to the tab") as transient and retries (tests/e2e/browser-public.test.ts `isTransientBrowserDetach`). But `classifyBrowserError` did not list these patterns, so at runtime the CLI surfaced the error to the caller as a hard failure instead of going through the existing daemon-client retry loop. Calling `web read` (or any browser command) with parallelism >1 hit ~10-30% spurious failures even though the next attempt would succeed instantly. Add the three patterns and a regression test mirroring the e2e helper.
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.
Problem
classifyBrowserErrordoes not list theDetached while handling commandpattern (or the relatedNo tab with id/Debugger is not attached to the tab), so when the daemon emits one of them under concurrent load, the CLI surfaces it to callers as a hard failure instead of going through the existing retry loop insendCommandRaw.The e2e test harness
tests/e2e/browser-public.test.tsalready treats these three patterns as transient and retries:So the "transient" judgement is already established — it just was not reflected in the runtime classifier.
Real-world impact
A news collector pipeline that calls
web read --url …for ~20 BBC RSS items in parallel (workers=3) hit ~30-50 % spurious 500 failures even though re-running the failed items individually succeeds instantly. With this patch, daemon-client retries them automatically and end-to-end success is ~100 %.Change
EXTENSION_TRANSIENT_PATTERNSinsrc/browser/errors.ts.src/browser/errors.test.ts. Vitest passes (7/7).No behavioural change for callers that were already reaching the e2e helper; this just brings the runtime classifier into agreement with the e2e helper.