Repository navigation
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 14, 2026, 2:44 PM ET / 18:44 UTC. Summary PR surface: Source +12, Tests +332. Total +344 across 5 files. Reproducibility: yes. from source with high confidence: current ordering mutates lastTargetId before final-URL policy validation on the affected creation paths, and the focused regressions exercise that sequence; the submitted live run provides convincing after-fix confirmation rather than a recorded current-main failure. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Refresh the branch onto current main and land the adopt-after-validation ordering with the focused Chrome MCP, CDP, and live redirect regressions intact. Do we have a high-confidence way to reproduce the issue? Yes from source with high confidence: current ordering mutates lastTargetId before final-URL policy validation on the affected creation paths, and the focused regressions exercise that sequence; the submitted live run provides convincing after-fix confirmation rather than a recorded current-main failure. Is this the best way to solve the issue? Yes. Deferring the existing state mutation until the existing final-URL policy check succeeds is the narrowest maintainable fix and aligns the Chrome MCP/CDP paths with the established raw /json/new invariant without adding new policy or configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against af3d796e199f. Label changesLabel justifications:
Evidence reviewedPR surface: Source +12, Tests +332. Total +344 across 5 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (5 earlier review cycles)
|
4d5ce66 to
f1dc66f
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f1dc66f to
b8085d1
Compare
b8085d1 to
4f00b59
Compare
8a6388e to
004f04a
Compare
92b0ca2 to
d2b43d8
Compare
d2b43d8 to
795c2cf
Compare
Co-authored-by: NIO <[email protected]>
Co-authored-by: NIO <[email protected]>
|
Land-ready maintainer proof for repaired head What changed:
Proof:
Hosted-CI diagnosis:
Known boundary: client-side navigation scheduled after the short committed-document stability window remains best-effort; later browser actions still apply current-URL guards. Closing rejected targets is intentionally a separate product decision. |
|
Merged via squash.
|
…nclaw#105301) * fix(browser): do not sticky-adopt policy-blocked openTab targets * test(browser): narrow sticky redirect proof Co-authored-by: NIO <[email protected]> * fix(browser): validate tab adoption after navigation Co-authored-by: NIO <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
…nclaw#105301) * fix(browser): do not sticky-adopt policy-blocked openTab targets * test(browser): narrow sticky redirect proof Co-authored-by: NIO <[email protected]> * fix(browser): validate tab adoption after navigation Co-authored-by: NIO <[email protected]> --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
openTabcould mutate sticky-target, alias, or managed-tab-cleanup state before the browser's final result was safe and authoritative. A blocked redirect, late cancellation, failed discovery, or provisional CDP descriptor could therefore reject the open while still changing which tab a later targetless action selected.Why This Change Was Made
All browser backends now converge on one final adoption boundary. Chrome MCP and Playwright results are adopted only after their final URL passes policy. Direct CDP attaches to the exact created target and reads browser-owned
Page.getFrameTreestate; raw/json/newobserves the returned page WebSocket. Direct discovery is pure until the target is rediscovered and both authoritative URL views pass policy.The refactor also moves stable alias ownership into
target-id.ts, validates labels before browser mutation and again inside the exported alias-state owner, propagates endpoint-policy and cancellation errors, and keeps uncertain targets explicit but unadopted. The mixed helper and the synthetic committed live test were deleted.User Impact
Before: A rejected, aborted, blocked, or undiscovered tab open could replace the previous implicit target, inherit an alias, or trigger managed cleanup.
After: Sticky target, alias, and cleanup state change together only after final navigation and target discovery are validated. Unsettled or undiscovered targets can still be returned explicitly, but cannot silently become the next implicit tab.
Evidence
e0154b92fe2f6bc567d56346a309a9b159ff5993.pnpm check:changed: passed in 2m09s, including format, prod/test tsgo, lint, SDK/dependency/database/runtime-sidecar/import-cycle guards.Real Chrome proof
Chrome
144.0.7559.96exercised the production CDP/navigation path:openTab: rejection preserved the prior sticky target, aliases, targetless selection, and managed-tab set.{"proof":"real-chrome-cdp-frame-tree-navigation","serverRedirectFinal":"http://127.0.0.1:35715/blocked","clientRedirectFinal":"http://127.0.0.1:35715/blocked","slowMainDocumentFinal":"http://192.168.127.119:35715/slow","slowSubresourceDelayMs":4000,"slowObservationElapsedMs":293}{"proof":"production-openTab-rejects-blocked-frame-final","finalHost":"127.0.0.1","stickyPreserved":true,"aliasesPreservedUntilExplicitList":true,"targetlessSelectionPreserved":true}The temporary real-Chrome harness was removed after proof; committed tests remain deterministic. The CDP ownership assumptions were checked against the official
Page.getFrameTreeandFramecontracts: the main frame exposes the current loader, document URL, separate fragment, and failed-navigation URL.Known boundary
A client-side navigation scheduled after the short committed-document stability window is inherently best-effort; later browser actions retain their current-URL safety checks. This change deliberately does not close rejected targets because target disposal is a separate product decision.