fix(browser): retire owned tabs after recovery - #469
Conversation
Persist explicit target ownership, serialize retirement against new controllers, and save complete recovered output before closing. Preserve borrowed, kept, generating, legacy, and reclaimed targets. Release CDP transports independently of recoverable tabs so incomplete controllers can exit. Fixes #435.
|
🦞👀 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 7, 2026, 10:23 PM ET / September 8, 2026, 02:23 UTC. ClawSweeper reviewWhat this changesSave recovered browser answers before closing explicitly owned tabs, preserve shared or retained tabs, and disconnect browser transports independently of tab cleanup. Merge readiness✅ Ready for maintainer review The PR remains useful: pinned main and v0.19.0 lack post-recovery retirement. No blocking defect was found, and the supplied final-head proof covers recovery and preservation of other targets. Priority: P2 Review scores
Verification
How this fits togetherOracle’s browser engine sends consultations through Chrome and stores session information for later recovery. Reattach and harvest recover completed answers; this change connects successful persistence to safe cleanup of the original tab. flowchart TD
A[Interrupted browser consultation] --> B[Reattach or harvest]
B --> C[Save full answer and completed session]
C --> D[Check target identity and active controllers]
D --> E[Reserve current tab ownership]
E --> F[Close owned idle tab]
D --> G[Preserve other targets]
E --> G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep recovery available until the answer is saved, then retire only the currently owned idle target while preserving legacy sessions and other controllers. Do we have a high-confidence way to reproduce the issue? Yes: an owned persistent-profile run can time out, release its lease, and later recover without main retiring its tab. Source inspection supports that path, and the supplied baseline CLI run reports it; this review did not execute target code. Is this the best way to solve the issue? Yes: explicit ownership plus save-before-close ordering fits the existing recovery lifecycle without adding a retention policy or migrating older sessions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fe2c8d990562. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Final-head proof for
Fixes #435. Changelog and thanks @lhysin are collected in #470, to merge last. |
Recoverable browser failures can release their lease while leaving an Oracle-created tab indefinitely, even after a successful harvest or reattach. Browser-level CDP connections could also keep an incomplete controller alive after its page connection was detached.
Record explicit target ownership and save the full recovered answer plus completed session metadata before retiring the captured target. Per-tab claims survive document replacement and reserve retirement against a new controller; current session/lease ownership and generation checks preserve borrowed, kept, legacy, reclaimed, or active targets. Connection cleanup now releases the browser transport independently of whether its tab must remain available for recovery.
There is no automatic retention TTL. An interrupted retirement reservation remains conservative: the saved answer is available, and a new run should use another tab. Host ownership details remain excluded by the existing bridge result allowlist.
Fixes #435. Thanks @lhysin for the detailed lifecycle report.
Validation:
3f5529fb195fd7605d2d67fb0568cef9d8896bd6: https://github.com/steipete/oracle/actions/runs/34178930225.The changelog entry is deferred to the final notes PR so sibling implementations do not conflict.