Skip to content

fix(browser): prove post-action target continuity before adopting a tab - #110884

Merged
steipete merged 5 commits into
openclaw:mainfrom
piyushbag:fix/browser-post-action-target-continuity-103785
Aug 26, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
piyushbag:fix/browser-post-action-target-continuity-103785

Conversation

@piyushbag

@piyushbag piyushbag commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

After a browser action or navigation invalidated its selected raw target, route code inferred a replacement from URL matches, newly listed tabs, or the sole surviving tab. None of those prove that the replacement belongs to the page that executed the operation, so a later action could silently run against an unrelated tab. Renderer detachment could also make a legitimate same-tab navigation retry fail by looking up its stale original raw target.

Why This Change Was Made

The lifecycle owner now supplies target continuity:

  • Playwright reads Target.getTargetInfo from the exact acted-on Page after navigation or interaction.
  • Extension operations capture the exact authenticated extension connection, granted tab object, and registered relay instance. Renderer reattachment is accepted only while all three original owners remain current.
  • Detached-frame navigation first reconnects Playwright so relay auto-attach can restore that exact tab, then resolves the captured owner, looks up only its authoritative replacement target, and synchronously revalidates ownership after the awaited lookup.
  • The shared navigation guard checks the same captured owner again immediately before privileged page.goto, after awaited route installation. Revocation during setup fails closed while still removing the exact installed route handler.
  • Revoked/regranted tabs, extension or relay replacement, unavailable capture, and ownership changes during awaited work fail closed. No URL, cardinality, alias, first-page, or tab-list inference is used.
  • Chrome-MCP existing-session handles already belong to their stable page owner; missing handles are never replaced by unrelated same-URL tabs.
  • Navigation responses place the verified target after the backend payload, preventing an unverified field from overriding the owner-selected result.

The public relay target-ID contract, browser profile configuration, and transport protocol remain unchanged.

User Impact

Actions and navigation preserve the selected tab across a legitimate same-owner renderer replacement while unrelated tabs remain untouched. If the tab grant, authenticated extension, relay, or exact operation owner disappears or changes, navigation fails closed rather than silently targeting another tab.

Evidence

  • Three independent regressions were observed failing before their owner fixes: the real backend rejected original-target instead of selecting the proven renderer replacement; the actual HTTP navigation route did not forward relay ownership; and the real shared navigation guard invoked a retained page after access was revoked during awaited route installation. All three now pass.
  • Owner-bound regressions additionally cover successful same-tab renderer replacement, grant revocation, replacement authenticated extension/relay, missing relay capture, ownership replacement during awaited exact-page lookup, synchronous pre-navigation revocation, exact route cleanup, and SSRF denial closing the recovered target rather than the stale original.
  • A real isolated Playwright Chromium instance installed and automatically paired the actual MV3 extension through its native host and authenticated relay. The exact real selected relay-backed Page.goto received a single injected detached-frame failure, and the unchanged production extension-profile HTTP route recovered through real Playwright disconnect, authenticated relay reconnect/auto-attach, exact owner revalidation, and a genuinely different recovered Page object. The selected one of two real browser tabs navigated successfully while the unrelated tab remained untouched; real access revocation also passed.
Before fix: BrowserTabNotFoundError: tab not found: browser tab "original-target" not found
Before fix: actual HTTP /navigate -> captured relay target was not forwarded to navigation
Before fix: retained page.goto ran after owner revocation during awaited route installation

[browser-extension-e2e] chromium launched
[browser-extension-e2e] unpacked extension loaded
[browser-extension-e2e] persisted extension reloaded
[browser-extension-e2e] injected-detach=1 production-reconnect=1 owner-target-preserved=1 unrelated-tab-unchanged=1 status=200
Test Files  1 passed (1)
Tests       1 passed (1)
  • The real production-boundary fault is intentionally injected on the exact actual relay-backed page; reconnect, owner resolution, recovered page, HTTP route, browser tabs, extension, and authenticated relay are all real. Chrome exposes no deterministic public operation that changes a raw debugger target while preserving the same grant: explicit debugger detach retains that ID or revokes access. The live proof does not claim a raw target-ID change; production owner regressions separately prove same-grant replacement identity.
  • The complete affected browser shard passed 193 files and 2,767 tests, with two opt-in files and six tests intentionally skipped. The actual opt-in paired MV3 detached-fault lane also passed separately. Focused owner, HTTP-route, and navigation-guard coverage passed 98 tests.
  • Exact hosted extension/scripts lint, extension production and test typechecking, assertion/max-line safety ratchets, formatting, and fresh independent structured review all passed.
  • Production delta is +135/-76 (net +59), justified by closure-bound ownership across the authenticated extension, granted tab, registered relay, renderer retry, and privileged navigation sink. Test and proof changes are +531/-103.

Thanks to @piyushbag for the original contribution.

Closes #103785

@openclaw-barnacle openclaw-barnacle Bot added size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jul 18, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 7:54 AM ET / 11:54 UTC.

ClawSweeper review

What this changes

The PR replaces browser route heuristics that could adopt an unrelated tab after an action or navigation with operation-owned target continuity from Playwright or the authenticated extension relay.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

This remains necessary: the base-side resolver selected replacements from tab listings, while this branch carries continuity from the exact page or relay owner instead. No concrete patch defect was found, and the posted production-boundary terminal proof is sufficient; retain the PR until its exact-head checks finish and the unavailable Playwright contract/history checks are independently closed.

Priority: P1
Reviewed head: 4fd818dad509b3bb5be7e07b98963f2433048267

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch and its real-boundary terminal proof are solid, with merge readiness awaiting exact-head CI and direct upstream-contract inspection unavailable in this environment.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR contains after-fix terminal evidence from the paired MV3 production route with an injected detached-frame fault, real reconnect, an unchanged unrelated tab, and status 200; the corresponding harness asserts those facts at the production boundary.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR contains after-fix terminal evidence from the paired MV3 production route with an injected detached-frame fault, real reconnect, an unchanged unrelated tab, and status 200; the corresponding harness asserts those facts at the production boundary.
Evidence reviewed 6 items Base behavior and replacement: The exact base-to-head diff removes the URL/cardinality tab-list resolver and replaces it with owner-provided target outcomes; the retained fallback is the acted-on target, not a newly listed tab.
Owner-bound relay continuity: The relay capture closes over the authenticated extension and exact tab instance; the route also verifies that the registered relay handle has not been replaced.
Final-effect revalidation: Detached-frame recovery reconnects, resolves only the captured relay target, revalidates after page lookup, and the navigation guard rechecks ownership immediately before page navigation.
Findings None None.
Security None None.

How this fits together

Browser tool HTTP routes select a tab, invoke either Playwright or the extension relay, and return a target ID that later browser actions may reuse. This change controls how that result remains bound to the operated tab across navigation, renderer replacement, and revocation.

flowchart LR
  A[Browser tool request] --> B[Browser route]
  B --> C[Selected tab]
  C --> D{Execution owner}
  D --> E[Exact Playwright page]
  D --> F[Authenticated relay tab]
  E --> G[Action or navigation result]
  F --> G
  G --> H[Returned target ID]
Loading

Before merge

  • Resolve merge risk (P1) - Required exact-head CI is still queued or running, so this should not merge until those checks conclude.
  • Resolve merge risk (P1) - The review environment could not inspect Playwright 1.62.1 upstream types/source or complete local history/release ancestry because playwright-core is absent and GitHub DNS is unavailable.
  • Resolve merge risk (P1) - The bug repair adds 59 net production lines across the browser ownership path; the owner-boundary rationale is concrete, but the final review should still reject any redundant layer exposed by direct dependency inspection.
  • Complete next step (P2) - No bounded repair is indicated; the remaining work is exact-head validation and a dependency-contract review rather than a code change.
Agent review details

Security

None.

PR surface

Source +59, Tests +428. Total +487 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 7 135 76 +59
Tests 7 531 103 +428
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 666 179 +487

Review metrics

Metric Value Why it matters
Production versus test delta production +135/-76 (net +59); tests +531/-103 (net +428) The production growth implements closure-bound ownership through the relay, retry, and response paths, while most added code is focused regression and live-boundary coverage.

Stored data model

Persistent data-model change detected: serialized state: extensions/browser/src/browser/extension-relay/relay-bridge.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Finish exact-head validation (recommended)
    Let the pending required checks finish, then verify the Playwright 1.62.1 page-CDP contract from a trusted dependency source before merge.
  2. Accept the remaining evidence gap
    Merge with the known inability of this review environment to inspect upstream Playwright types and local release ancestry.

Technical review

Best possible solution:

Keep target identity owned by the operated page or captured relay tab, never by route-level tab enumeration; merge only after exact-head validation and a trusted Playwright contract check confirm that the added page-CDP reads preserve that contract.

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

Yes—source evidence is high-confidence: the exact base diff shows the former resolver could select a sole listed tab, and the branch replaces it with an owner-bound outcome. This review did not execute the external contributor branch locally.

Is this the best way to solve the issue?

Yes, subject to the remaining dependency-contract check. Moving continuity to the exact page or relay owner is safer and more maintainable than preserving route-level URL or cardinality inference.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against e2e5d1bca685.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR contains after-fix terminal evidence from the paired MV3 production route with an injected detached-frame fault, real reconnect, an unchanged unrelated tab, and status 200; the corresponding harness asserts those facts at the production boundary.
  • 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. Sufficient (terminal): The PR contains after-fix terminal evidence from the paired MV3 production route with an injected detached-frame fault, real reconnect, an unchanged unrelated tab, and status 200; the corresponding harness asserts those facts at the production boundary.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: An incorrect returned target can direct later browser actions at an unrelated tab in an active workflow.
  • merge-risk: 🚨 compatibility: Existing callers can receive the selected stale target instead of the old heuristic replacement, intentionally changing the route-result contract.
  • merge-risk: 🚨 session-state: Returned target IDs can be retained for subsequent browser actions, so an incorrect continuity result would mis-associate browser workflow state.
  • 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. Sufficient (terminal): The PR contains after-fix terminal evidence from the paired MV3 production route with an injected detached-frame fault, real reconnect, an unchanged unrelated tab, and status 200; the corresponding harness asserts those facts at the production boundary.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR contains after-fix terminal evidence from the paired MV3 production route with an injected detached-frame fault, real reconnect, an unchanged unrelated tab, and status 200; the corresponding harness asserts those facts at the production boundary.

Evidence

What I checked:

Likely related people:

  • steipete: The reviewed head is authored by Peter Steinberger, and the related merged browser lifecycle repair was also authored by this contributor. (role: current implementation author and related browser-fix contributor; confidence: high; commits: 4fd818dad509, 056184bccc38; files: extensions/browser/src/browser/extension-relay/relay-bridge.ts, extensions/browser/src/browser/pw-tools-core.snapshot.ts, extensions/browser/src/browser/routes/agent.snapshot-target.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Finish the pending exact-head checks and have a trusted reviewer inspect the Playwright 1.62.1 page-CDP contract before merge.

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 (42 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-15T11:22:06.042Z sha 2a29071cfe412050bc1003121ab329ee2084cf1d :: needs real behavior proof before merge. :: [P1] Preserve relay continuity across renderer replacement
  • reviewed 2026-08-16T01:58:56.963Z sha 2a29071cfe412050bc1003121ab329ee2084cf1d :: needs real behavior proof before merge. :: [P1] Preserve relay continuity across renderer swaps
  • reviewed 2026-08-16T04:20:17.824Z sha 2a29071cfe412050bc1003121ab329ee2084cf1d :: needs real behavior proof before merge. :: [P1] Preserve relay continuity across renderer replacement
  • reviewed 2026-08-18T12:41:25.364Z sha 2a29071cfe412050bc1003121ab329ee2084cf1d :: needs real behavior proof before merge. :: [P1] Preserve relay continuity across renderer replacement
  • reviewed 2026-08-24T05:59:05.993Z sha 2a29071cfe412050bc1003121ab329ee2084cf1d :: needs real behavior proof before merge. :: [P1] Preserve relay continuity across renderer replacement
  • reviewed 2026-08-26T09:17:43.970Z sha 26d5126 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-26T09:55:09.858Z sha 25b11de :: needs real behavior proof before merge. :: [P1] Rebind the retry to the captured relay tab
  • reviewed 2026-08-26T11:20:37.459Z sha d32be59 :: needs real behavior proof before merge. :: none

@piyushbag

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added redacted live-browser proof under Evidence (real Chrome over CDP): the acted-on tab A is closed while unrelated tab B survives and B is never adopted, and a renderer swap where the page reattaches at the navigated URL is still adopted. PR body sections and headings updated.

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 18, 2026
@clawsweeper

clawsweeper Bot commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 18, 2026
@piyushbag

Copy link
Copy Markdown
Contributor Author

Proof is done: live Chrome/CDP harness is in the PR Evidence section and ClawSweeper marked proof: sufficient.

Maintainer decision needed before I change scope. Please choose one:

  • (A) Accept the narrower heuristic continuity fix in this PR and merge as-is.
  • (B) Prefer the backend-owned target-outcome refactor across managed Playwright / extension relay / Chrome MCP. Happy to follow your preferred design if you want that path.

I will not expand scope without that direction.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 18, 2026
@piyushbag
piyushbag force-pushed the fix/browser-post-action-target-continuity-103785 branch from 7b75f01 to 6a2516c Compare July 19, 2026 01:15
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jul 19, 2026
@piyushbag

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head 6ca8c1b7c29: CI is fully green after the lint/harness rename. Live Chrome/CDP proof in the PR Evidence section is unchanged and still sufficient.

Awaiting maintainer direction on the A/B scope choice (heuristic continuity vs backend-owned target outcomes) before any further product changes.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@piyushbag

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Head d76faac6ca6: implemented the recommended backend-owned target-outcome path. Removed both route-level heuristics (newly appeared tab + URL-cardinality renderer swap). Playwright navigate/act now return operation-owned raw target ids via Target.getTargetInfo; routes apply resolveOperationTargetOutcome. MCP existing-session and extension-relay stable tab identity deferred to backend owners.

Please confirm this matches the intended contract. @steipete or browser owner: does Playwright page CDP identity cover your relay continuity needs, or should we prioritize wiring MCP/relay outcomes next?

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 19, 2026
@piyushbag

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

CI unblock on c59565940c8:

  • check-test-types: act mock now always returns { targetId: string | undefined } (empty opts no longer returns {}).
  • check-lint / oxfmt: formatted proof-103785-target-continuity.test-harness.mts.
  • Chrome MCP existing-session: after navigate/act, routes now pass operation-owned target ids from tab-list membership (readChromeMcpOperationTargetId); close reports operationTargetId: null so stale acted-on id is preserved when the tab is gone.
  • Extension-relay profiles already go through Playwright readPageTargetId (wired in prior commit); no relay-bridge change needed in this pass.

Local proof: pnpm check:test-types, oxfmt check on touched files, node scripts/run-vitest.mjs extensions/browser/src/browser/routes/agent.snapshot.test.ts extensions/browser/src/browser/server.agent-contract-core.test.ts (30/30 pass).

Remaining steipete/maintainer ask: if Chrome MCP tab-list membership is insufficient as the backend-owned signal (vs explicit MCP page-id continuity), please confirm whether this satisfies the relay/MCP continuity bar or whether a deeper chrome-devtools-mcp contract change is required before merge.

@clawsweeper

clawsweeper Bot commented Jul 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 30, 2026
@piyushbag
piyushbag force-pushed the fix/browser-post-action-target-continuity-103785 branch from dab7edc to b8151ab Compare July 30, 2026 16:39
@piyushbag

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review please

Rebased onto current openclaw/main (head b8151ab8a). Ported post-action target-continuity changes onto the refactored browser module layout (readPageTargetId export, pw-tools-core.interactions.execution owned-target wiring).

Existing MV3 proof harness included (extensions/browser/scripts/proof-103785-target-continuity.test-harness.mts). Option A: backend-owned operationTargetId after navigate/act; no fabricated proof.

@clawsweeper

clawsweeper Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 18, 2026
@steipete

Copy link
Copy Markdown
Contributor

The original ClawSweeper owner-boundary concern is now addressed without changing public relay target IDs: continuity is accepted only from the exact acted-on Playwright Page or a closure bound to the exact live extension connection, granted TabState, and registered relay instance. Revocation/regrant, extension replacement, relay replacement, and unavailable capture fail closed. Chrome-MCP handles remain stable by their existing page-owner contract; six pre-existing route expectations were corrected because they previously required adopting an unrelated same-URL tab. Actual HTTP response precedence and relay lifecycle regressions are covered; the complete browser extension shard passes 2,730 tests across 195 files; and real isolated Chrome/CDP behavior was exercised. A live paired MV3 extension was unavailable and is not claimed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

Addressed the latest actionable renderer-retry P1 at exact head d32be594166722459d8b5ac6a05821e3dd9b3624.

Detached-frame recovery now reconnects Playwright first, allowing relay auto-attach to restore the original granted tab. It then resolves the captured authenticated-extension/tab/relay owner, selects only that exact replacement target, and revalidates the same owner after awaited lookup. The shared navigation guard checks ownership synchronously again immediately before page.goto after awaited route setup; revocation rejects without navigating and removes its exact handler.

All three previously failing regressions now pass: the real navigation backend, the actual HTTP route, and the real shared guard with revocation during awaited setup. The full browser suite passed 2,728 tests. A real isolated Chromium instance installed and auto-paired the actual MV3 extension, navigated the selected one of two real tabs through the production relay/route, preserved the unrelated tab, and verified real revocation. Chrome does not expose a deterministic same-grant raw-target replacement trigger: explicit debugger detach preserves the raw ID or revokes the grant, so renderer replacement itself is proven by the production owner/backend lifecycle regressions rather than falsely claimed as live.

Exact hosted lint, production/test typechecking, safety ratchets, and a fresh independent review are clean.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

The outstanding real-behavior-proof request is now satisfied at exact signed head 4fd818dad509b3bb5be7e07b98963f2433048267 by an actual paired-MV3 production-boundary detached-frame fault run:

[browser-extension-e2e] chromium launched
[browser-extension-e2e] deterministic native host pre-registered
[browser-extension-e2e] unpacked extension loaded
[browser-extension-e2e] Secure Preferences identity verified
[browser-extension-e2e] persisted extension reloaded
[browser-extension-e2e] injected-detach=1 production-reconnect=1 owner-target-preserved=1 unrelated-tab-unchanged=1 status=200
[browser-extension-e2e] launcher probe passed

Test Files  1 passed (1)
Tests       1 passed (1)
Duration    41.35s

The isolated real Chromium installed and automatically paired the real MV3 extension through its native host. The test injected one detached-frame error onto the exact actual authenticated-relay-backed Playwright Page.goto, then called the unchanged production extension HTTP /navigate route with two real browser tabs. The real owner performed its real disconnect, fresh authenticated relay connection and auto-attachment, closure-bound exact target selection, and synchronous pre-navigation ownership check. The recovered real Page was a different object, the exact selected target remained owned, the unrelated real tab was untouched, and the HTTP response succeeded.

For comparison, observed failing-before evidence was:

BrowserTabNotFoundError: tab not found: browser tab "original-target" not found
actual HTTP /navigate: captured relay target was not forwarded to navigation
owner revoked during awaited page.route: retained page.goto incorrectly executed

The full refreshed browser shard passes 2,767 tests. The unrelated failed core lint stripe came from a broken historical main snapshot; the branch now contains the already-landed main repair, and the exact previously failing core stripe passes. All original contributor commits and attribution remain intact; no production code changed for the injected-fault proof. Chrome cannot deterministically force a different raw target for the same grant, so this proof honestly claims an injected real production-boundary detach and real reconnect, not an artificial raw-ID change.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: browser merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

[Bug]: Browser post-action target resolution can adopt an unrelated sole tab

2 participants