Repository navigation
fix(agents): complete nested final replies after owned work settles - #174487
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR finishes an input after its nested final reply and owned work settle, without requesting another model response. Example: Code Mode reads input.txt and sends “RESULT: VERIFIED INPUT” with final:true.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current nested-reply completion gap, preserves input ownership, and has no actionable defect found in review; exact-head CI remains pending. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe agent loop launches tools, Code Mode owns nested execution, and delivery records confirmed replies; the existing completion hook combines those facts to finish or continue the input. flowchart TD
A[Accepted input] --> B[Agent tool batch]
B --> C[Code Mode cell]
C --> D[Message delivery]
D --> E[Private delivery fact]
C --> F[Cell and sibling settlement]
E --> G[Completion hook]
F --> G
G --> H[Finish or continue]
Technical reviewBest possible solution: Land the focused completion repair once the existing exact-head CI gates pass. Do we have a high-confidence way to reproduce the issue? Current main lacks the nested-delivery completion bridge, and the added production-owner composition provides a deterministic scenario; no target code was executed during this review. Is this the best way to solve the issue? The repair extends the existing completion hook, preserves delivery facts at their producer, and binds invocation identity before awaited admission without adding a public setting or competing delivery path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1956ba00b72b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +213, Tests +772. Total +985 across 18 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 (1 earlier review cycle)
Reviewed October 16, 2026, 7:53 PM ET / 23:53 UTC (Revision 2). |
Baseline-Refresh: f0ddebc9c896862dc0b0ff5c7bcb6a73714dff72
|
@clawsweeper re-review Please review exact head |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
What Problem This Solves
Fixes an unnecessary model turn after Code Mode has delivered a final reply to the current conversation and finished its work.
Related: #119057. This addresses the demonstrated completion defect, not the old PR's entire scope.
User Impact
A completed final reply can finish its input without another model request. Progress replies still continue, sibling work still settles, and a later accepted input cannot inherit an earlier input's completion.
No configuration, schema, or protocol changes are required.
Why This Change Was Made
Nested delivery bypassed the direct message-tool completion path. The existing completion owner now consumes private delivery facts only after the originating cell and its sibling work settle. Those facts retain the input accepted at invocation, including across waits and failed result publication, rather than borrowing whichever input is current later.
The same accepted-input identity is committed before fallible message publication. Cancelled or context-only input does not advance it. Generic all-terminal batch behavior is unchanged.
Evidence
adb3ddfb027b163c3a17c969e8cc685ea13ad5f6. Subsequent reviewed mechanical corrections remove an invalid fixture receiver binding (this: void), use a local boolean accumulator, and remove an await of a synchronous test emitter. Completion policy, owner joins, and assertions are unchanged.e224b4fe17822fd065720899c90043c6108932f1. Renewal: https://github.com/openclaw/openclaw/actions/runs/38937821299.pnpm buildcompleted on tree2af1c1af28a9806bda280b5fedcff9722c68cb6c. Workload: https://github.com/openclaw/openclaw/actions/runs/38939150438. Its wrapper exited 1 during subsequent GitHub custody settlement; the retained claim is not a build failure or cleared custody claim.07bd31c03f437956fc5d850d380c06c41edec8aaincorporates frozen mainece4639ff9306103c9773e6fff1c53b79bdb19ff, including the canonical fixture preparation from test(gateway): prepare tool invocation state snapshots #174645 and perf(subagents): reuse child admission facts and batch setup writes #174412. Independent review verified the conflict-free 18-file repair and preserved completion ownership. This is source equivalence, not a new runtime pass.07bd31c03f437956fc5d850d380c06c41edec8aain merge tree829e093c25329c7039a08bc6ec381ec576b46d7f. Build, production/test types, lint, and the aggregate gate passed.The integration uses real execution, message delivery, and SQLite owners with a scripted model transport. It does not claim live provider or physical network-delivery proof. Testbox workload results are separate from hosting-workflow teardown and custody settlement.
Scope and ownership
Production: +222/-9 lines. Tests: +774/-2 lines. The added production state is private invocation, cell, and batch authority needed to preserve input ownership across asynchronous delivery and settlement; it is not a new public feature or protocol. Public result fields cannot forge completion. Progress, pending siblings, accepted/cancelled steering, same-input continuation, and new-input recovery are covered.