Repository navigation
fix(agents): retain final replies for nested tool runs - #140399
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. Reviewed September 6, 2026, 4:23 PM ET / 20:23 UTC. ClawSweeper reviewWhat this changesKeeps nested agents’ final summaries and fallback replies within the child’s own live execution and transcript-writing scopes after the launching turn finishes. Merge readiness✅ Ready for maintainer review This PR remains useful, with no actionable introduced defect found. The updated discussion resolves the previous attribution constraint; no additional review blocker remains. Priority: P2 Review scores
Verification
How this fits togetherThe embedded agent runner turns completed tool work into a final assistant response. Its finalization stage writes the summary or fallback to the session transcript and prepares the reply for delivery. flowchart TD
A[Child completes tool work] --> B{Final answer available?}
B -->|Yes| F[Prepare reply for delivery]
B -->|No| C[Child-owned tool-free summary]
C --> D{Child admission and writer still valid?}
D -->|Yes| E[Persist summary or fallback]
D -->|No| G[Reject stale completion]
E --> F
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +65, Tests +316. Total +381 across 4 files. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep finalization under the independently admitted child, preserving existing cancellation, writer-supersession, and no-tool-replay guarantees. Do we have a high-confidence way to reproduce the issue? Yes, source inspection supports the closed-parent/independently admitted-child sequence, and the supplied regression reports failure on the unchanged baseline. This review did not execute a reproduction. Is this the best way to solve the issue? Yes. Reusing the existing child admission and transcript owner repairs the lifecycle boundary without introducing another recovery mechanism, configuration option, or storage format. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9ca3a9ef5794. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
Keep tool-free finalization and fallback persistence in the child's own live admission and committed transcript-writer scope after its parent finishes. Preserve cancellation, writer supersession, and completed tool actions. The regression fixture requires the actual runner-prepared session key. Fixes #140398 Worked on by: - @Takhoffman Co-authored-by: Tak Hoffman <[email protected]>
93f3a25 to
737507b
Compare
|
@clawsweeper re-review The sole current review follow-up—the PR body’s attribution constraint—is resolved by the requester’s explicit acceptance of the unchanged native workflow’s existing source-author credit. The required final squash trailer remains exactly: Co-authored-by: Tak Hoffman [email protected] I inspected the actual composed squash body and verified the exact line with The PR body now records that acceptance and full successful CI for current head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Keep nested tool-turn finalization in the child's live caller and committed writer scopes, preserve cancellation, and avoid replaying completed actions. Fixes openclaw#140398 Worked on by: - @Takhoffman Co-authored-by: Tak Hoffman <[email protected]> Co-authored-by: roboclaw-bot <[email protected]>
Closes #140398
Related: #133520, #139309, #138511
What Problem This Solves
Fixes an issue where nested or scheduled agent turns can finish their tools but fail to produce a final response after the launching turn has closed. Both isolated summary recovery and its fallback could inherit the launching turn's stale execution or transcript-writer context.
Why This Change Was Made
Finalization now enters the same child-owned transcript boundary as ordinary dispatch and binds the original child admission for the tool-free summary. The actual summary receives the committed writer fence, including first-write sessions. Fallback persistence uses one canonical fenced target and checks that the child admission remains live at the commit edge. Queue cancellation still preserves the original cancellation outcome.
This does not extend the parent's authority, re-admit the child, replay completed tools, change configuration or database schemas, or disable Code Mode.
User Impact
A child can deliver its summary or existing honest fallback after its parent finishes. A cancelled, superseded, removed, or no-longer-admitted child remains fenced.
Evidence
SessionTranscriptWriterClaimReboundError; both pass after the scope correction. The tool action executes once.git diff --check, conflict-marker check, and targeted lint pass (0 warnings/errors).sessionKeywas optional. Follow-up head93f3a2523da5917c72d4eeb00a74ae788efc2dadexplicitly requires the actual runner-prepared key before append; all three affected ownership regressions pass again. No production code changed in that follow-up. Exact-head hosted CI completed successfully.check:changedis blocked at package-manager bootstrap by the host's minimum-release-age policy. Direct installed-tool core typechecking also refuses the shared external dependency symlink. Neither policy was weakened. The completed hosted CI run passed production/core-test typechecks and the required gate for head93f3a2523da5917c72d4eeb00a74ae788efc2dad.Review and merge status
ClawSweeper reviewed the current head and found no actionable introduced defect or security finding. Its sole follow-up concerned the previously documented attribution constraint, resolved by the requester’s explicit acceptance below.
On September 6, 2026, the requester explicitly accepted the native workflow’s additional existing source-author credit, provided the final squash commit preserves the exact human co-author trailer. No merge tooling or preservation guard is changed or bypassed.
Current head
737507b5ae4503755ec73d91a7d897cd143cbf7cconsolidates only the task-owned commit metadata; the repository tree is unchanged (89dd4fb4b4b6bfd1e3d87745803230ccc8a2c846). All 30 focused tests passed again, and full current-head hosted CI passed.The actual native-composed squash body has been inspected, and
git interpret-trailers --parserecognizes exactlyCo-authored-by: Tak Hoffman <[email protected]>in its terminal trailer block after all prose. The unchanged native workflow also preserves the branch author from GitHub’s preview, which the requester has accepted. The exact human trailer will be checked again at prepared head and on the landed commit; a PR comment is not a substitute for commit-level verification. No merge request has yet been submitted.Worked on by:
Co-authored-by: Tak Hoffman [email protected]