Repository navigation
fix: keep one child completion failure from dropping sibling results - #201563
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. |
Codex Review Summary: ✅ CompletedThis 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: f34d322858
ℹ️ 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".
| retired.has(getSubagentRunRuntimeKey(entry)) === isRetired && | ||
| (resolver && getCanonicalGatewayContextResolver(resolver)) === gateway && |
There was a problem hiding this comment.
Preserve final attachments when partitioning a yielded cohort
For a Talk consult that yields a multi-child batch, splitting otherwise same-authority children by Gateway binding can drop the spoken completion. promoteRequesterFinalAttachment records the full frozen cohort, but maybeWakeRequesterAfterAllChildrenSettledBound now passes only the selected partition's IDs to transferRequesterFinalAttachment and, subsequently, finalizeRequesterFinalAttachment. Both require an exact batch-ID match, so a bound child's successful continuation cannot append its final to the Talk attachment when another child's binding has been retired. Update the attachment ownership alongside this partitioning so successfully delivered sibling results still reach the waiting Talk caller.
Useful? React with 👍 / 👎.
|
Please review the final head The two CI issues are resolved:
The unchanged retry-lifetime suite passes all 17 tests, the five affected requester-wake regressions pass, the session-identity ratchet and final @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR separates child completion batches by Gateway ownership so one failed member cannot discard successful siblings. Example: A yielded requester awaits run-bound and run-unbound, whose Gateway owner was retired.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete completion-delivery failure, and the earlier Talk attachment finding is resolved; no new actionable code defect was found. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe subagent registry receives child completion facts, selects requester continuation batches, persists their outcomes, and forwards successful finals to the requester conversation and any waiting Talk attachment. flowchart TD
A[Child completion] --> B[Subagent registry]
B --> C[Gateway ownership partition]
C --> D[Requester continuation]
C --> E[Failure notice]
D --> F[SQLite settlement]
E --> F
F --> G[Talk final attachment]
Technical reviewBest possible solution: Keep partition selection, atomic settlement, failure reporting, and Talk consumption in their existing owners while preserving pending siblings. Do we have a high-confidence way to reproduce the issue? Current-main selection can combine bound and unbound members, whose shared resolver rejects incompatible bindings; the supplied native regressions report red on the base and green on the patch, but no tests were run during this read-only review. Is this the best way to solve the issue? The repair addresses the owning invariant by separating incompatible members before dispatch and settling only admitted members, with no replacement manager, schema, or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7f059c01cd03. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -12, Tests +148, Docs +1. Total +137 across 17 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 18, 2026, 9:50 PM ET / November 19, 2026, 02:50 UTC (Revision 2). |
|
Addressing all three open items from the review on
Validation: the complete requester-wake suite passes 41 tests; attachment, dispatch, yield and Talk controls pass 92; restoration/resume controls pass 4. Final @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…penclaw#201563) * fix(subagents): isolate mixed Gateway completion batches * fix(subagents): preserve chat-addressed failure diagnostics * fix(subagents): retain Talk finals across settle partitions
…201563) * fix(subagents): isolate mixed Gateway completion batches * fix(subagents): preserve chat-addressed failure diagnostics * fix(subagents): retain Talk finals across settle partitions (cherry picked from commit 5724f95) Co-authored-by: RomneyDa <[email protected]>
…licy subagent-registry-lifecycle-wake.rejection-write is green at the pure candidate bc7e568 and red from the stage-2 merge ddd0ec7, on Bun and Node 24: "subagentRuns.selectCompletionAuthorityBatch is not a function" at subagent-registry-lifecycle-wake.ts:352. Upstream openclaw#201563 (5724f95) admits the requester wake's batch through that registry method, which upstream openclaw#200873 (f444d3b) added. The test replaces the process-wide subagentRuns with { confirmRetirement } only, so the wake threw before it reached settlement. The fixture's subagentRuns now delegates selectCompletionAuthorityBatch to the real policy with no completion custody, which is what this row holds. That admits the single-member batch, as the real registry does here. The product behavior the test pins is unchanged: the failed wake still records its rejection through settlement with outcome { delivered: false, path: "none" }. A probe that admits an empty batch turns it red ("expected vi.fn() to be called 1 times, but got 0 times"). Refs openclaw#129388 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…penclaw#201563) * fix(subagents): isolate mixed Gateway completion batches * fix(subagents): preserve chat-addressed failure diagnostics * fix(subagents): retain Talk finals across settle partitions Release adaptation: Split reviewed partition cluster: retired-owner failure settlement, selected-member attachments and cancellation caller adapters. Review corrections preserved. (cherry picked from commit 5724f95) Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
A yielded requester could lose several finished child results when one member of its completion batch had no live Gateway binding. This can happen after restoration, but also during ordinary visible spawning or binding cleanup. The whole batch failed together, and a later requester turn could prevent the failure notice from appearing before the child rows were retired.
User Impact
Bound children now deliver their results independently of incompatible siblings. Unbound children settle separately, and retired children leave a visible failure that tells the user to inspect their saved results. No configuration or schema changes are required.
Why This Change Was Made
Visible spawning and watched follow-ups now preserve the caller's captured Gateway binding at registration. The registry partitions frozen batches by Gateway owner and retirement state before dispatch or failure settlement. Native settlement commits the admitted partition while leaving other members pending; the existing sibling wake mechanism advances them.
Failure reporting uses the existing required-completion owner for yielded batches, including when the original requester turn has ended. It verifies that the notice was appended and preserves the existing recovery receipt if publication fails. Failure notices preserve the existing chat-addressed contract across transcript replacement; live writer and completion-delivery lifecycle protections remain intact. Missing or stopped chats receive no notice. This removes the duplicate stable-batch notice path and redundant whole-wave validation; production code is net −12 lines.
Talk final attachments now follow admitted partitions while retaining pending siblings, exact full-cohort revocation, and consume-before-append replay protection. A retired row can resume its settle wake to record a visible failure, while ordinary delivery remains blocked.
Related: #195275. This fixes the separate mixed-binding failure before completion dispatch.
Evidence
Five regression cases fail on base
0b18f610and pass with this change: restored unbound membership, live never-bound membership, live binding retirement, visible-spawn registration, and a failed settle after a newer requester yield. The native registry harness asserts actual bound-result delivery and a visible transcript failure for a retired row. Focused persistence, requester-wake and affected tool suites pass (96 tests). All four real-Gateway turnover controls also pass, including model error, reset and Stop. Finalpnpm check:changed, the session-identity ratchet and isolated Codex autoreview through P2 pass. CI exposed a regression in the consolidated failure-notice path: it must follow the current chat after reset or compaction and preserve the original error detail. The unchanged retry-lifetime suite now passes (17 tests), along with five affected requester-wake regressions rerun after that repair.Hosted Codex and ClawSweeper identified the Talk attachment contract. The repair adds success-first/failure-first replay controls and extends all three native mixed-binding cases to assert the Talk callback. Those cases fail on the earlier PR head and pass after the repair, including restoration processed first. The complete requester-wake suite passes 41 tests, attachment/dispatch/yield/Talk controls pass 92 tests, and restore/resume controls pass 4 tests. The existing serial-delegation Talk regression from #142830 remains green. Persisted row types, codec and schema are unchanged; the restored case writes, removes the in-memory owner, reloads through the native store, and verifies both delivered siblings and a visible retirement failure.
The 30-minute ordinary completion expiry can defer settle wakes while another delivery owner holds the row. This repair isolates the eventual batch failure; it does not change that timeout or claim to establish the cause of every delayed completion.
Final-head synthetic measurement used a 35.2 GiB agent database, 5,000 sessions, 6,000 retained runs and 62,000 workspace files (1.116 GB), with no production data. Five fresh-process A1/A2/B cycles each used six warmups and 30 measured four-child waves through the real settle owner and native SQLite mutations, with scripted delivery.
Values are medians of five process medians. Allocation was measured separately with V8 sampling; CPU includes worker threads. The fixture ran on APFS, not btrfs, and host load varied. The fixed wall median is 0.53–0.66 ms higher than A/A, while allocation falls between the controls. Timing was noisy: baseline A2 process medians ranged from 5.66 to 22.91 ms and fixed medians from 5.84 to 27.81 ms; all runs, including contention during local checks, are retained. This does not support a speedup claim or a precise causal estimate of the small median difference. These are owner measurements, not model/network latency.