Repository navigation
fix(browser): preserve successor tabs during stale cleanup - #155307
Conversation
Carry the current subagent cleanup owner through Browser activation, dashboard reconciliation, and tab claims. Let already admitted closes settle against their captured tab ownership without removing later registrations.
|
🦞👀 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. Reviewed September 21, 2026, 8:45 PM ET / September 22, 2026, 00:45 UTC. ClawSweeper reviewWhat this changesThe PR prevents stale subagent cleanup from claiming successor browser tabs while preserving settlement of already-admitted closes and later tab registrations. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix absent from current main and the latest release. No blocking defect was found in the introduced patch; the maintainer-authored PR should remain open for normal landing. Priority: P2 Review scores
Verification
How this fits togetherSubagent completion asks the Browser plugin to close session-owned tabs. Cleanup passes through lazy plugin activation, dashboard reconciliation, and tab ownership checks before issuing browser close requests. flowchart TD
A[Subagent completion] --> B[Current run ownership]
B --> C[Lazy Browser activation]
C --> D[Dashboard reconciliation]
D --> E[Admit tab cleanup]
B --> E
E --> F[Close captured browser target]
F --> G[Retire matching registration]
B --> H[Stop stale cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +31, Tests +325, Docs +4. Total +360 across 15 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep cleanup admission with the current run and settlement with the existing exact tab owner, preserving callback-free SDK callers. Do we have a high-confidence way to reproduce the issue? Yes, from source: suspend Browser activation, replace or reset the subagent session, then resume cleanup; current main forwards no run-currentness guard. This review did not execute that scenario. Is this the best way to solve the issue? Yes. The patch extends existing ownership checks across the actual asynchronous boundaries and reuses the existing tab claim and settlement owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 000a635e3423. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…155307) Carry the current subagent cleanup owner through Browser activation, dashboard reconciliation, and tab claims. Let already admitted closes settle against their captured tab ownership without removing later registrations. Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
An older subagent run can close a newer run's browser tabs when its cleanup resumes after plugin activation or another asynchronous wait.
User Impact
Replacing or resetting a subagent session stops its previous run from claiming more tabs for cleanup. A close already admitted still settles against that tab's captured ownership and preserves later registrations.
Why This Change Was Made
Carry the existing run-currentness callback through lazy Browser SDK activation, dashboard reconciliation, and tab-claim boundaries. Keep exact tab ownership and admitted-close settlement with the existing Browser cleanup owner. The optional SDK callback preserves existing callers.
Related: #150153.
Evidence
Retained qualification includes 521 passing owner/sibling cases across 12 files, nine expected pre-fix regression failures, five final registered-completion fixtures, 15 SDK compatibility fixtures, the selected changed gates, and a full build (538.83 seconds).
Isolated Linux qualification also exercised the emitted Browser APIs with Chromium 153.0.8010.12 through an isolated HTTP route: two actual tab deletions, survival after owner revocation, closure by a fresh owner, and preservation of an untracked tab. That browser proof uses volatile tracking. Durable claim and replacement behavior is covered separately by the SQLite regressions. The emitted synthetic HTTP boundary is recorded separately from real Chromium.
The refresh onto
bf9611abc45ce668af7d7e8b6a322786aabf91b9preserves all 15 qualified postimages and the exact patch. P2 review remains clean. Runtime/build evidence stays bound to the original32c12d3eba7e78093e41393cbbaf9ff033a651c3source and candidate tree234a50240ccb20fc4274ebab687934043b96c86d; current-head CI remains part of landing.No production Gateway or personal Chrome instance was changed. The owned Testbox was stopped and independently confirmed completed. A controller-tooling refresh during qualification was recorded; the product checks used the frozen remote source and lockfile.