Repository navigation
fix(subagents): settle missing completion sources once - #174850
Conversation
Persist permanent non-delivery for legacy individual completions without an original operator source. Preserve execution results and delivered receipts, suppress unauthorized notifications, and retain transient settlement retries. Prove durable suppression across two restarts.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d08f4d1df9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: blocked before merge. What this changesThis PR durably settles individual completions missing their original operator evidence while preserving results and delivery receipts. Example: The stored legacy-delivered run lacks operator evidence and has deliveredAt and announcedAt equal to 260.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR addresses a distinct restart-recovery defect still present on main; I found no introduced code defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway startup restores saved subagent runs; the completion owner reconciles authority, queue receipts, and cleanup into durable registry state. flowchart TD
A[Gateway startup] --> B[Restore subagent registry]
B --> C[Completion source owner]
C --> D[Existing completion writer]
C --> E[Existing queue settlement]
D --> F[Durable registry state]
E --> F
F --> G[Cleanup and later restart]
Technical reviewBest possible solution: Keep durable refusal with the existing completion writer and preserve the queue, store-retirement, and cleanup owners. Do we have a high-confidence way to reproduce the issue? Current main reaches the warning again after each cold restoration because the individual missing-source refusal is only process-local; the PR reports matching startup logs and a failing baseline regression. Is this the best way to solve the issue? The fix belongs in the existing restoration and completion owners, and the reviewed implementation retains transient retries and established delivery ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d25901823822. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +51, Tests +204, Docs +5. Total +260 across 10 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 HistoryReview history (1 earlier review cycle)
Reviewed October 16, 2026, 8:19 PM ET / October 17, 2026, 00:19 UTC (Revision 2). |
Defer pending notifications to the existing store-retirement owner and retain its durable suspension across restarts. Keep unfinished handoffs eligible for original-authority restoration. Correct the rejection probe typing and extend the existing restart fixtures.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
* fix(subagents): settle missing completion sources once Persist permanent non-delivery for legacy individual completions without an original operator source. Preserve execution results and delivered receipts, suppress unauthorized notifications, and retain transient settlement retries. Prove durable suppression across two restarts. * fix(subagents): retain queued completion settlement ownership * fix(subagents): preserve replaced-store completion settlement Defer pending notifications to the existing store-retirement owner and retain its durable suspension across restarts. Keep unfinished handoffs eligible for original-authority restoration. Correct the rejection probe typing and extend the existing restart fixtures.
What Problem This Solves
Fixes repeated subagent completion-authority warnings on every Gateway restart when legacy individual runs have no saved original operator source. Two consecutive startup logs contained 127 and 129 distinct affected runs; all 127 from the first startup recurred in the second.
Related: #174177, which settles requester cohorts rather than individual completion restorations.
User Impact
Individual terminal completions now persist permanent non-delivery through the existing completion writer. Subsequent restarts skip their missing-source restoration while retaining the child execution outcome and captured result. Quiet completions receive the same durable suppression; already-delivered receipts and their timestamps survive both restoration and cleanup. No requester message is synthesized without authority.
Why This Change Was Made
The restoration owner previously recorded this refusal only in process memory. It now commits the existing blocked-completion state with current database, Gateway, lifecycle, and run ownership. Correlated queued deliveries retain their queue owner until settlement, including success already acknowledged before restart; failed individual queue settlement also suppresses unauthorized notifications. Cohort settlement and replaced-store notifications retain their existing owners. Durable replaced-store suspension is preserved across later boots without skipping authority restoration for unfinished handoffs. Temporary worker overload, unavailable access policy, and rejected settlement writes remain retryable; unfinished execution retains its normal interruption owner.
No schema, configuration, retention, or permission changes. Production LOC: +51 net (65 added / 14 removed, excluding tests and docs). This growth implements the missing durable transition, its no-notification cause, delivery-receipt preservation, and existing store-retirement precedence; it reuses the native completion writer rather than adding another state owner or cache.
Evidence
subagent-registry.completion-authority.test.tsandsubagent-completion-admission.expired-receipt.test.ts(91.12 s Vitest wall time). After review, the 2 expanded restart cases and delivered-receipt cleanup regression passed (7.15 s + 14.13 s shard wall time; cleanup test 44 ms). Changed-file oxlint, oxfmt, andgit diff --checkpassed.