Repository navigation
fix(browser): navigation fails with Invalid InterceptionId when a page cancels a document request - #193068
Conversation
Chromium retires a paused Fetch request's id when the page cancels it before the navigation fence resumes it. Treat Invalid InterceptionId on continue/fail as settled instead of failing the whole navigation; policy denials and other protocol errors still surface.
The navigation fence now treats Invalid InterceptionId as settled. On the extension relay, that native error fenced the whole Fetch lease, so later live requests were reported settled without reaching Chromium. Retire only the ended pause and keep the lease usable; other native errors still fence.
…uest RelaySessionOwner retired the whole physical attachment on any Fetch sender failure, before RelayFetch could retire just the ended pause. Exempt only Invalid InterceptionId; genuine sender failures still retire the scope.
…e cancels a document request OpenClaw-Publication: 82dd8cac-f3d1-4a43-b483-5f10abea97de
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesTreat already-ended Chromium document interceptions as settled while keeping healthy relay requests and attachments usable. Example: Navigate to https://www.dmv.ca.gov/portal/ while the page cancels a paused iframe document request.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR repairs a current browser-navigation failure with a focused change. The previous test-allocation finding is fixed, the exact-head CI gate passes, and this review found no actionable defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe browser plugin checks document navigation policy before resuming Chromium Fetch interceptions; the extension relay additionally owns logical-client request leases and physical debugger attachments. flowchart TD
A[Browser open or navigate] --> B[Navigation policy fence]
B --> C[Direct CDP session]
B --> D[Extension relay]
D --> E[Fetch lease and attachment owners]
C --> F[Chromium document request]
E --> F
Technical reviewBest possible solution: Land the focused settlement repair in the existing fence and relay owners while preserving policy checks and unrelated-error handling. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the exact failure path, and the supplied Chromium trace shows cancellation preceding the rejected continuation; this read-only review did not execute target code. Is this the best way to solve the issue? The smallest complete repair recognizes the ended interception once, settles it in the existing fence, and retires only its relay pause instead of poisoning healthy requests or attachments. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3543fda490ec. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +56, Tests +285, Other +2. Total +343 across 9 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 5, 2026, 3:03 PM ET / 20:03 UTC (Revision 2). |
285 net regression-test lines cover the fence, relay lease, relay attachment, owner-close cleanup and real-Chromium cancellation paths; each fails when its fix is reverted.
OpenClaw-Publication: 7c653425-61ef-4947-bd9c-d5ea649e8aa0
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…e cancels a document request (openclaw#193068) * fix(browser): tolerate page-cancelled document interceptions Chromium retires a paused Fetch request's id when the page cancels it before the navigation fence resumes it. Treat Invalid InterceptionId on continue/fail as settled instead of failing the whole navigation; policy denials and other protocol errors still surface. * fix(browser): retire only ended interceptions in the extension relay The navigation fence now treats Invalid InterceptionId as settled. On the extension relay, that native error fenced the whole Fetch lease, so later live requests were reported settled without reaching Chromium. Retire only the ended pause and keep the lease usable; other native errors still fence. * fix(browser): keep relay attachments when Chromium ended a paused request RelaySessionOwner retired the whole physical attachment on any Fetch sender failure, before RelayFetch could retire just the ended pause. Exempt only Invalid InterceptionId; genuine sender failures still retire the scope. * fix(browser): finish relay owner cleanup for already-ended requests * fix(browser): navigation fails with Invalid InterceptionId when a page cancels a document request OpenClaw-Publication: 82dd8cac-f3d1-4a43-b483-5f10abea97de * test: allocate stale interception regression lines 285 net regression-test lines cover the fence, relay lease, relay attachment, owner-close cleanup and real-Chromium cancellation paths; each fails when its fix is reverted. * Publish openclaw/nova-crab OpenClaw-Publication: 7c653425-61ef-4947-bd9c-d5ea649e8aa0
What Problem This Solves
Fixes:
browser open/browser navigatefails withFetch.continueRequest: Invalid InterceptionIdon pages that start and then cancel a document request, such as an iframe the page removes or re-targets (reproduced 3/3 on https://www.dmv.ca.gov/portal/ in the managedopenclawprofile).User Impact
User impact: guarded navigations and actions now complete on these pages instead of failing. Pages that are blocked by navigation policy are still blocked and reported, and other CDP errors still fail the navigation as before.
Why This Change Was Made
The navigation authority fence pauses each document request, runs an async policy check, then resumes it with
Fetch.continueRequest(or cancels it withFetch.failRequest). If the page cancels the request while it is paused, Chromium drops the interception, so the later continue/fail is rejected withInvalid InterceptionId. The fence treated that as a fatal navigation error.Chromium rejects an unknown interception id before it changes anything, and the cancelled request can no longer load. That means there is nothing left to allow or deny, so the fence now treats that one error as settled. Policy denial is still recorded before the cancel is attempted, so a denied document is still reported (and its source still counts as preserved). There are no retries or delays.
The extension relay carries the same Fetch commands, so it needed matching changes or the fix would make things worse there:
RelayFetchretires only the ended pause instead of marking the whole lease uncertain. Before this, later live requests got the stored error back without reaching Chromium, and the fence would now have read that as "settled".RelaySessionOwnerno longer retires the whole physical attachment for this error.Every other native Fetch error still fences, retires, or surfaces exactly as before.
Test-line allocation:
config/test-lines-allocations/browser-stale-interception-193068.txtgrants exactly this PR's 285 net regression-test lines. They cover four separate failure points: the direct fence, the relay lease, the relay attachment, and relay owner-close cleanup. They also include a real-Chromium cancellation test, because the bug only shows up with real browser timing. Each test fails when its fix is reverted. The shared scalar is unchanged.Real-Chromium trace (DMV portal, standalone CDP mirror of the fence)
The page cancels a second document request 2 ms after it is paused. The fence's continue arrives about 20 ms later.
Evidence
pw-session-navigation-stale-interception.live.test.tscovers three cases: a guarded goto, a guarded action, and a denied document, each where the page cancels a paused child document. All 3 fail on the base commit with the production error (or with source-preservation lost in the denied case) and pass with the fix.gotoPageWithNavigationGuardagainst the live DMV portal in an isolated headless Chromium 1248 (not the Gateway's profile). Before the fix it failed. After the fix it went 3/3ok 200 https://www.dmv.ca.gov/portal/.RelayFetch: a retired pause leaves the lease usable;ExtensionRelayBridge: a cancelled request does not detach the attachment or other pauses, and owner close finishes cleanup without detaching peers.OPENCLAW_LIVE_TEST=1 pnpm test:live -- …stale-interception.live.test.ts …navigation-cors.live.test.ts …navigation-authority.live.test.ts: 3 files, 20 tests passed.pnpm test:extension browser: 2976 + 158 passed, 114 skipped, 2 failed. The 2 failures are insystem-profiles.test.ts(leftover cookie snapshot scratch directory). They are inherited: they fail identically on the base commit8c9310ee363, and this PR does not touch that file.pnpm check:test-lines-ratchet --base 8c9310ee363 --stagedwith the allocation: OK (slack 18).pnpm format:check,node scripts/run-oxlint.mjs --tsconfig extensions/tsconfig.json <changed files>,pnpm tsgo:extensions,pnpm tsgo:extensions:test: clean.Accepted edge case: the error is matched by its Chromium message text (
Invalid InterceptionId). CDP has no structured code for it. Any other error text keeps the existing fail-closed handling.