Skip to content

fix(browser): navigation fails with Invalid InterceptionId when a page cancels a document request - #193068

Merged
jalehman merged 7 commits into
mainfrom
openclaw/nova-crab
Nov 5, 2026
Merged

jalehman merged 7 commits into
mainfrom
openclaw/nova-crab

Conversation

@jalehman

@jalehman jalehman commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes: browser open / browser navigate fails with Fetch.continueRequest: Invalid InterceptionId on 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 managed openclaw profile).

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 with Fetch.failRequest). If the page cancels the request while it is paused, Chromium drops the interception, so the later continue/fail is rejected with Invalid 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:

  • RelayFetch retires 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".
  • RelaySessionOwner no longer retires the whole physical attachment for this error.
  • Owner-close and retirement cleanup treat an already-ended pause as cleaned up, instead of detaching peers.

Every other native Fetch error still fences, retires, or surfaces exactly as before.

Test-line allocation: config/test-lines-allocations/browser-stale-interception-193068.txt grants 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)
     6 requestPaused interception-job-1.0  Document https://www.dmv.ca.gov/portal/
    27 continued interception-job-1.0
  5055 requestPaused interception-job-78.0 Document https://www.dmv.ca.gov/portal/
  5057 Network.loadingFailed B71260A7…  Document net::ERR_ABORTED canceled
  5076 CONTINUE FAILED interception-job-78.0 cdpSession.send: Protocol error (Fetch.continueRequest): Invalid InterceptionId.
  5279 goto ok 200 https://www.dmv.ca.gov/portal/

The page cancels a second document request 2 ms after it is paused. The fence's continue arrives about 20 ms later.

Evidence

  • New real-Chromium live test pw-session-navigation-stale-interception.live.test.ts covers 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.
  • Temporary probe (not committed): gotoPageWithNavigationGuard against 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/3 ok 200 https://www.dmv.ca.gov/portal/.
  • Unit and composed regressions:
    • fence: a retired id is settled on both resume paths, a denied document is still reported when its cancel hits a retired id, and other protocol errors still fail;
    • 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.
    • Each new test fails when its production change is reverted.
  • The existing "removes the paused-request listener before detachment" test now asserts that no commands are sent after detach, so the new tolerance cannot mask that regression.
  • 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 in system-profiles.test.ts (leftover cookie snapshot scratch directory). They are inherited: they fail identically on the base commit 8c9310ee363, and this PR does not touch that file.
  • pnpm check:test-lines-ratchet --base 8c9310ee363 --staged with 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.
  • Four independent review passes. Each finding (relay lease fencing, relay attachment retirement, relay owner-close cleanup, weakened listener test) was fixed with a regression test. The final pass on the head commit was 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.

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
@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Treat 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.

  • Before: Navigation fails with Fetch.continueRequest: Invalid InterceptionId.
  • After: Navigation completes while policy denials and unrelated protocol errors still surface.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, useful repair with real Chromium boundary evidence, distinct regressions, resolved prior feedback, and passing exact-head gates.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied production-guard probe uses isolated headless Chromium against the DMV portal and records three successful navigations after repair; real-CDP cancellation regressions additionally exercise guarded goto, actions, and denied-document preservation, with relay lifecycle tests supporting the transport-specific changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Browser open and navigate fail on pages that cancel a document request while its policy check is pending.
Reason: The repair restores valid navigation without changing allowed destinations, configuration, public APIs, or persisted data.

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
Reviewed head: 283787ae5b45ddde173c3da505b5554190151602

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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
Loading

Technical review

Best 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

  • Document-only navigation interception keeps the original intent (ae3561e: Preserve native CORS while keeping document navigation, redirects, and cleanup under one operation-owned fence.)
  • Relay Fetch error fencing and attachment retirement changes intended behavior with a stated reason (2a6fc9b: Protect logical-client ownership and retire physical state when native command completion is uncertain; this PR explains why Chromium's missing-interception lookup is a settled exception.)
  • Relay request-operation placement keeps the original intent (3f199f0: Keep private operation handling with its existing owner instead of maintaining single-use forwarding layers.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Agustin Rivera: Raw commit ae3561e adds extensions/browser/src/browser/pw-session-navigation-fence.ts:144 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ae3561e289dc; files: extensions/browser/src/browser/pw-session-navigation-fence.ts)
  • Peter Steinberger: Raw commit 2a6fc9b adds extensions/browser/src/browser/extension-relay/relay-session-owner.ts:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2a6fc9b92f89; files: extensions/browser/src/browser/extension-relay/relay-session-owner.ts)

PR surface

Source +56, Tests +285, Other +2. Total +343 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 4 79 23 +56
Tests 4 286 1 +285
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 9 367 24 +343

Preflight source

Source 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

Metric Value Why it matters
Production versus regression growth Production +79/-23; tests +286/-1 Growth covers distinct fence, relay-lease, attachment, cleanup, and real-Chromium cancellation failures without adding persistent state or configuration.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A page cancelling a document request can fail otherwise valid browser navigation; the affected behavior is specific and the repair is bounded.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-05T00:13:51.879Z sha daca6be :: needs changes before merge. :: [P2] Allocate the added regression test lines

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
@jalehman

jalehman commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 5, 2026
@jalehman
jalehman merged commit d3d8c1f into main Nov 5, 2026
123 of 124 checks passed
@jalehman
jalehman deleted the openclaw/nova-crab branch November 5, 2026 23:35
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: browser P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant