Repository navigation
fix(codex): preserve child replies during binding updates - #184604
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper re-review Please review current head |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesPreserves native child completion admission during binding metadata updates that keep the same owner. Example: A child finishes with “Result” while its parent binding updates rolloutPath to /workspace/rollout.jsonl.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR addresses a current native-completion admission defect; no actionable correctness finding remains on the reviewed head, and exact-head CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Codex plugin consumes native child events, checks binding and session ownership through plugin-state publication, and transfers accepted completions to durable requester receipts for delivery and recovery. flowchart LR
A[Native child completion] --> B[Codex completion monitor]
B --> C[Plugin state ownership guard]
D[Committed binding and pending effects] --> C
C --> E[Requester receipt admission]
E --> F[Delivery and recovery owner]
F --> G[Channel adapter]
Technical reviewBest possible solution: Keep ownership-preserving admission in the existing publication owner and let accepted durable requester receipts own subsequent delivery. Do we have a high-confidence way to reproduce the issue? Current main exposes the pending-publication rejection path, and the maintainer reports three completion regressions failing with the original fence restored; no target code was executed during this review. Is this the best way to solve the issue? The repair uses existing publication, binding-codec, and requester-custody owners, preserves stricter ordinary reads, and avoids a competing persistence or recovery mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e8764a3fa59c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +149, Tests +797, Docs +11, Other +1. Total +958 across 26 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes: No label 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 HistoryReview history (3 earlier review cycles)Reviewed October 26, 2026, 10:12 AM ET / 14:12 UTC (Revision 4). |
|
@clawsweeper re-review Please review exact head The requested authority evidence is now split at the actual production ownership transfer:
One stronger interpretation of the prior request is deliberately not implemented: an original native binding does not remain the final-I/O authority after the durable requester receipt is accepted. The exact-head compaction CI failure is also addressed. Its unchanged fixture reported the old thread as Final changed-test lint and types pass; independent source review and pre-commit review are clean. The PR body now records these results, the unchanged baseline SDK-budget failures, and the absence of live Telegram/provider or full mock-gateway proof. Direct Codex source inspection used revision |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…84604) * fix(codex): preserve child replies during binding updates * fix(test): align adoption fixture with binding guard contract * test(codex): prove completion receipt admission and owner handoff * fix(sdk): attach guard assertion invariant to cast
Related: #183790
What Problem This Solves
Fixes native child replies and accepted follow-up receipts being lost when their parent binding is concurrently updating metadata.
User Impact
Native child work can finish and admit its reply while ownership-preserving binding updates are pending. Ownership replacement, deletion, expired entries, retired sources and uncertain write outcomes still block native admission. After admission, the exact durable requester receipt owns delivery and recovery. No configuration or migration is required.
Why This Change Was Made
The completion owner used a prepared row read that rejects every pending publication. That read fence is appropriate for data reads, but it can permanently retire completion custody during the owner's own metadata updates.
A private prepared authorization guard now validates committed ownership and every overlapping pending effect derived from the serialized state command. Codex supplies its existing binding-ownership predicate. Ordinary row reads keep their stricter pending-publication fence; queue and worker holds both participate in the guard.
Non-test production changes add 198 and remove 48 lines (net +150): the private ownership boundary and Codex integration account for +149, and one benchmark-adapter line preserves its existing unsupported-operation refusal. Tests add 820 and remove 23 lines; documentation adds 11 lines. No new public SDK subpath, dependency, schema or configuration surface is introduced.
Evidence
pnpm buildpassed. Final changed-test lint and types passed.pnpm tsgo:scriptspass.pnpm plugin-sdk:surface:checkreports three existing public-budget failures: 160 entrypoints > 158, 3827 exports > 3816, and 2219 callable exports > 2212. A same-environment comparison against the exact base source tree proves identical public entry identifiers, totals and failures. Shipped-surface removals and forbidden-subpath checks pass. Budgets are unchanged.The checkpoint predicate proves planning/admission ordering, not arbitrary native revocation after planning or at the worker's final commit. Downstream delivery consumes requester/receipt and principal authority; this PR does not make accepted receipts depend on the original native binding forever. The admission and final-adapter tests are compositional proof, not one end-to-end native-to-channel run.
This proves a source-level race. It does not establish the root cause of the linked production incident; no live provider, Telegram delivery or full mock-gateway QA run is claimed. Codex dependency behavior was checked directly in
codex-rs/core/src/agent/control.rs:418–510,codex-rs/app-server/src/bespoke_event_handling.rs:810–850,codex-rs/app-server/src/thread_status.rs:429–450andcodex-rs/app-server/src/request_processors/thread_processor.rs:2153–2245at414782450952a196bbb64b1605a458c2531c47b6. Exact-head hosted CI remains the landing gate.