Skip to content

fix(browser): keep new tabs accessible during their first navigation - #150233

Merged
steipete merged 1 commit into
mainfrom
ci-burden/bootstrap-chromium-revoke-race
Sep 16, 2026
Merged

steipete merged 1 commit into
mainfrom
ci-burden/bootstrap-chromium-revoke-race

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #150158, #133490, #149820.

What Problem This Solves

Fixes an agent-created extension tab intermittently losing access during its first navigation. The motivating Chromium CI failure returned HTTP 500 with Page.navigate: tab … access was revoked while opening a tab in Selected tabs mode, before the later pause/revoke step.

User Impact

Normal navigation keeps new tabs available in either access mode. This changes relay/access behavior without changing the extension UI, configuration, or permission rules.

Why This Change Was Made

The native root-frame commit can retire initial-blank admission before Chrome's tab metadata catches up. A fresh tabs.get or discovery snapshot can still report about:blank with the confirmed destination in pendingUrl; the access owner then rejects its own navigation or drops the tab from discovery. The existing revision guard only catches a commit that overtakes the individual read.

Reuse the existing native-root snapshot reconciliation for access reads and discovery. It applies only to the same tab with a pending URL matching the recorded native root commit. Identity, group, incognito, access epochs, explicit blank events, and attachment retirement keep their existing checks.

The access-policy modules predate #149820. This reproduces a product race matching the CI error; it does not establish that refactor as the introducing change or prove the CI run's exact internal scheduling.

Evidence

  • Natural full-file Chromium runs: 0/10 failures before, 0/10 after, using OPENCLAW_BROWSER_EXTENSION_E2E=1 node scripts/run-vitest.mjs extensions/browser/chrome-extension/bootstrap.chromium.test.ts.
  • Forced native-commit/lagging-snapshot regression through the registered relay command handler: both matching-destination cases failed before the fix, including the exact selected-mode tab 101 access was revoked message; both pass afterward. Four missing/different-destination negative cases pass. The regression also checks continued discovery and subsequent commands.
  • 334 tests in eight owner/lifecycle files and two compiled sibling E2E tests passed, including native-host registration and relay coexistence.
  • Production and test typechecks, formatting, line-cap/max-lines ratchets, import cycles, and the remaining changed-scope guards passed. git diff --check passed.
  • Local check gap: node scripts/check-changed.mjs stops at lint declaration preparation because this nested worktree resolves a candidate @types/events/package.json through the parent checkout's node_modules. The same native lint command fails on unchanged modules/tab-eligibility.js. Moving the checkout was outside the authorized worktree scope; no boundary guard was disabled. CI needs to complete lint from its isolated checkout.
  • Codex P1 autoreview: local and final branch passes are scoped-clean, with no findings. The branch pass included the complete access, provenance, lifecycle, debugger, command-handler, and fixture context.
  • Sibling preflight repeated against refreshed origin/main and current open/recently merged PR searches for bootstrap, revoke, paused tab, tab access, and relay: no covering fix found.

@clawsweeper

clawsweeper Bot commented Sep 16, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: browser size: S maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 3:08 PM ET / 19:08 UTC (Revision 2).

ClawSweeper review

What this changes

The Chrome extension reconciles lagging tab metadata with confirmed navigation events so newly created tabs remain accessible during their first navigation, with regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix that current main does not contain. No introduced correctness or security defect was found, and the related merged work addresses different races.

Priority: P2
Reviewed head: a5e1bce153726964ebd602e4c78db962aeb268f9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful positive and negative regression coverage and no blocking findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Reported Chromium runs cover production tab creation and subsequent snapshots; the forced lagging-metadata regression uses mocked Chrome APIs. No unresolved authority violation requiring additional final-effect proof was identified.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Reported Chromium runs cover production tab creation and subsequent snapshots; the forced lagging-metadata regression uses mocked Chrome APIs. No unresolved authority violation requiring additional final-effect proof was identified.
Evidence reviewed 7 items Current main still lacks the repair: The fetched main revision retains raw tab snapshots in access reads and discovery. Comparing the two production owners with the reviewed head shows precisely the introduced reconciliation changes, so the central fix remains necessary.
Reconciliation remains subordinate to access controls: Reconciliation requires the same tab ID, an about:blank snapshot, and a pending URL equal to the recorded native root URL. Native events enter through the current attachment epoch; attachment retirement clears the recorded URL. Access inspection still checks epochs, pause state, selection, incognito status, and URL eligibility before command dispatch.
Regression coverage exercises the registered command boundary: Six parameterized cases cover both access modes with matching, different, and absent pending URLs. Successful cases assert navigation acknowledgement, continued discovery, no debugger detach, and a subsequent command. The existing harness mocks Chrome and WebSocket APIs; these cases are regression coverage, not live Chromium proof.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Chrome extension receives browser commands through an authenticated relay. Its tab-access owner combines Chrome metadata, navigation events, and user access controls to decide which tabs can receive commands and appear in discovery.

flowchart TD
  A[Authenticated browser commands] --> B[Tab access owner]
  C[Chrome tab snapshots] --> D[Navigation reconciliation]
  E[Native root navigation events] --> D
  D --> B
  F[Pause and selected group controls] --> B
  B --> G[Debugger commands]
  B --> H[Accessible tab discovery]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +6, Tests +61, Docs +1. Total +68 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 19 13 +6
Tests 1 61 0 +61
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 81 13 +68

Review metrics

None.

Technical review

Best possible solution:

Keep navigation reconciliation in the existing document-provenance owner, with current access controls governing both command execution and discovery.

Do we have a high-confidence way to reproduce the issue?

Yes, through a controlled source-backed sequence: commit the destination before Chrome’s about:blank snapshot catches up, then complete navigation access checks. The supplied regression reports this failure before the fix; this review did not execute it or reproduce the natural CI timing.

Is this the best way to solve the issue?

Yes. Reusing the existing native-root reconciliation for access reads and discovery is a narrow repair that avoids another eligibility policy, retries, or configuration surface.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f0a8b6d9abfc.

Labels

Label justifications:

  • P2: This repairs a bounded Chrome-extension navigation race that can reject commands and remove newly created tabs from discovery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Reported Chromium runs cover production tab creation and subsequent snapshots; the forced lagging-metadata regression uses mocked Chrome APIs. No unresolved authority violation requiring additional final-effect proof was identified.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-16T18:53:01.824Z sha ab8d0f3cba546ba9d093950228eb3912eea0c6bb :: needs maintainer review before merge. :: none

Reconcile lagging Chrome tab reads and discovery with the native root commit so initial navigation stays accessible. Keep pending URL, tab identity, and existing access checks intact. Cover acknowledgement and discovery through the relay command handler in both access modes.

Related: #150158, #133490.
@steipete
steipete force-pushed the ci-burden/bootstrap-chromium-revoke-race branch from ab8d0f3 to a5e1bce Compare September 16, 2026 19:01
@steipete
steipete merged commit 89d03c3 into main Sep 16, 2026
102 checks passed
@steipete
steipete deleted the ci-burden/bootstrap-chromium-revoke-race branch September 16, 2026 19:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 17, 2026
…penclaw#150233)

Reconcile lagging Chrome tab reads and discovery with the native root commit so initial navigation stays accessible. Keep pending URL, tab identity, and existing access checks intact. Cover acknowledgement and discovery through the relay command handler in both access modes.

Related: openclaw#150158, openclaw#133490.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: browser maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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