Repository navigation
fix(codex): release exact closed thread handoffs - #180204
Conversation
|
🦞👀 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. |
eec6cd9 to
98d6fb2
Compare
Let a successor resume after the retired physical client reports the exact thread closed, without waiting for unrelated sibling leases to terminate the whole process. Retain process-exit fencing when ownership merely disappears, and cover both notification orderings. Co-authored-by: Paul Bohm <[email protected]> Co-authored-by: RomneyDa <[email protected]>
98d6fb2 to
ae872ec
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR remembers exact thread-closure notifications so a later handoff can proceed while sibling sessions keep the retired process alive. Example: The old client reports thread-a closed before its handoff listener is registered, while thread-b keeps that process alive.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses an early-closure handoff gap still present on main, and inspection found no concrete introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Codex plugin's lifecycle layer transfers native-thread ownership between physical app-server clients, consuming closure notifications and client leases before allowing successor resume requests. flowchart TD
A[Native app server] --> B[Client notification dispatch]
B --> C[Physical client closure receipts]
B --> D[Live thread ownership]
C --> E[Thread handoff]
D --> E
F[Retired process exit] --> E
E --> G[Successor thread resume]
Technical reviewBest possible solution: Remember closure on the original physical client and consult it in the existing handoff while preserving process-exit fencing when no exact receipt exists. Do we have a high-confidence way to reproduce the issue? Source shows that closure delivered before handoff registration is forgotten on main, leaving the handoff waiting for process exit while a sibling lease remains; no target code was executed during this review. Is this the best way to solve the issue? The patch narrowly extends the existing handoff contract with bounded, build-shared, physical-client-scoped receipts while retaining claimed-thread, protected-thread, cancellation, and no-closure fencing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 461123273058. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +60, Tests +56. Total +116 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 11:21 PM ET / October 22, 2026, 03:21 UTC. |
Let a successor resume after the retired physical client reports the exact thread closed, without waiting for unrelated sibling leases to terminate the whole process. Retain process-exit fencing when ownership merely disappears, and cover both notification orderings. Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: RomneyDa <[email protected]>
Live proof receiptValidated the merged fix against the pinned real Codex Scenario:
Results:
This directly reproduces the reported sibling-lease blocker and distinguishes the fix from a process-exit-only test. No follow-up fix was needed. |
What Problem This Solves
A Codex thread handoff waits for the retired app-server process to exit. Unrelated sibling leases can keep that process alive after the exact target thread has closed, blocking scheduled or interactive continuation indefinitely.
User Impact
A successor can continue once the old physical client reports the exact target thread closed, while unrelated sibling sessions keep using that process. Ownership loss without a closure signal still preserves process-exit writer fencing.
What Changed
thread/closedreceipts across same-build module copiesValidation
This extracts the exact-thread handoff repair from #174967 while leaving its busy-message behavior decision and security-sensitive changes out. #178764 already covers scheduled session admission; #177351 is Goal/autonomy scope and is intentionally not included.
Limits: synthetic in-process app-server transport; no live Codex binary integration. Exact-head PR CI supplies broad proof.