Repository navigation
fix(browser): keep close results bound to closed tab - #124064
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 2:44 AM ET / 06:44 UTC. ClawSweeper reviewWhat this changesThe PR preserves the closed tab’s identity in browser close responses and removes that exact tab from agent-session cleanup tracking. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessKeep open. The focused close-path repair is correct on review, directly addresses the linked close bug, and should proceed through normal maintainer review once exact-head checks complete. Priority: P1 Review scores
Verification
How this fits togetherThe browser plugin routes agent tool actions to managed browser tabs and records tool-owned tabs for session cleanup. A close result returns through the route to the tool, which must retire the same tab rather than touch a surviving one. flowchart LR
Agent[Agent browser action] --> Tool[Browser tool]
Tool --> Route[Browser action route]
Route --> Tab[Managed browser tab]
Tab --> Result[Close result]
Result --> Session[Session tab cleanup]
Session --> AgentResult[Agent-visible result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +88. Total +98 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the close-specific owner-boundary repair after exact-head CI passes, while leaving the broader post-action continuity redesign to #103785. Do we have a high-confidence way to reproduce the issue? Yes—source-reproducible: current main routes close through a resolver whose sole-tab fallback can adopt an unrelated survivor, and the PR adds focused route and lifecycle regressions for that path. Is this the best way to solve the issue? Yes for the stated close-only scope: terminal close bypasses identity inference and the lifecycle owner untracks the exact returned target, while broader navigation continuity remains separately tracked. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f6ed40d649f9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Closes #124052
Related: #103785 and #110884
What Problem This Solves
Fixes an issue where users closing a managed browser tab could receive the sole surviving tab as the close result, causing later browser work and session cleanup to use the wrong tab identity.
The broader post-action identity redesign remains tracked by #103785 and #110884. This PR intentionally fixes only close outcomes; navigation and renderer-swap continuity are unchanged.
Why This Change Was Made
Close is a terminal target outcome, not navigation. The browser route now keeps direct and closed-batch results bound to the target that actually closed, while the agent-tool lifecycle retires that exact target for direct close,
act:close, and batch close. Non-close action/navigation activity continues through the existing resolver unchanged.This is the maintainer-approved bounded subset of the broader target-identity work: no extension-relay identity contract, browser security/profile policy, protocol, configuration, Plugin SDK, or persistence behavior changes.
Production LOC: +14/-4 (net +10) | Tests: +89/-1 (net +88)
The production growth is the close-specific lifecycle callback and three existing entry-point integrations; it avoids adding a parallel resolver, fallback, or compatibility path.
Provenance: the close route began resolving every managed action through the navigation resolver in #106964 (code author/PR author/merger
@steipete, 2026-07-14). Generic post-action activity tracking was carried forward by #114814 (code author/PR author/merger@obviyus, 2026-07-28), and closed-batch outcomes were added in #113749 (@steipete, 2026-07-25).User Impact
Closing a tab no longer reports or touches an unrelated surviving tab. Session lifecycle cleanup stops retaining a tab that has already closed, while successful navigation and renderer-replacement behavior remain as before.
Evidence
Candidate head:
31134240c5a95dd84bbe5d9733430a216fa8fa90Main baseline:
2e806ef0e2c99ea2968766944573e8ef16c33126— main CI passed.Blacksmith Testbox:
tbx_01m02125w4srvejt7z28hcjqcf— hydration/run.Before
With only the three production hunks reversed against the candidate tests:
After
The exact five-file changed gate passed extension production/test typechecks, zero-warning lint, formatting, dependency and plugin-boundary guards, dead-export scan, database-first guard, runtime sidecar checks, and zero runtime import cycles.
Fresh structured autoreview reported no accepted/actionable findings.
Real browser lifecycle proof
A source-built Gateway used task-owned state, a task-owned headless Chrome profile, a synthetic local page, and four verified-free ports. The run proved:
curlexit 28) followed by a successful snapshot;Sanitized synthetic evidence (SHA-256
3b39d8ada441c620bdd7195763f639a7849a36689e2278d44a22a10080893a9b):No changelog edit: release generation owns
CHANGELOG.md.AI-assisted implementation and review; the code path, dependency contract, focused regressions, exact changed gate, and real Chromium behavior were independently inspected and verified.