Repository navigation
fix(subagents): prevent completed requester replay after delivery failure - #85308
fuller-stack-dev merged 5 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed September 15, 2026, 8:44 AM ET / 12:44 UTC (Revision 24). ClawSweeper reviewWhat this changesPrevent completed requester agents from repeating tools after missing required message-delivery evidence, while retaining subagent results for explicit retry or dismissal. Merge readiness✅ Ready for maintainer review This remains a useful, supported fix: current main still permits the reported replay path. The refreshed implementation addresses the prior findings, preserves the reviewed files through integration, and has relevant Gateway restart proof. No blocking patch defect was found. Priority: P1 Review scores
Verification
How this fits togetherSubagent completion delivery passes a child’s result to the requesting agent and records whether the required reply reached its destination. Its lifecycle and SQLite state determine whether work resumes after failure or restart. flowchart TD
A[Child finishes] --> B[Requester processes result]
B --> C{Required delivery confirmed?}
C -->|Yes| D[Record delivery]
C -->|Completed without receipt| E[Persist suspended completion]
E --> F[Block automatic requester replay]
E --> G[Explicit retry or dismissal]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +75, Tests +657. Total +732 across 12 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use the existing suspended-completion owner to retain results, prevent implicit re-execution, and expose recovery through the established Tasks retry and dismissal controls. Do we have a high-confidence way to reproduce the issue? Yes: a completed requester that omits required message-tool evidence can fall through to another execution, and suspension can schedule another wake on current main. Source inspection and the supplied baseline/after-fix Gateway evidence support this path; no target code was executed during this review. Is this the best way to solve the issue? Yes: the patch repairs classification and settlement in the existing owners, preserves legitimate pending work, and keeps explicit recovery without adding another store or delivery mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c0be265998d0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (23 earlier review cycles; latest 8 shown)
|
|
ClawSweeper PR egg ✨ Hatched: 💎 rare Pearl Branchling Hatch commandComment Hatchability rules:
Rarity: 💎 rare. What is this egg doing here?
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
9a7bbc6 to
b84c800
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
26be1d0 to
c58c79a
Compare
|
Final final clean rewrite after latest main movement. Current head: Same narrow 8-file subagent diff. Validation rerun on
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Updated the PR body for current head |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@steipete, could you confirm the intended contract at this boundary before we produce the final runtime proof? After the requester completion turn has already run without required message-tool evidence, the current PR head
The alternative would require a new persisted delivery-only envelope/operation so the visible send can be retried independently. Is terminal visible-delivery failure acceptable as the narrow replay-safe contract for this PR, or should the patch instead introduce that separate delivery-only retry boundary? Once the direction is confirmed, we will attach redacted exact-head gateway/restart proof matching the chosen contract. |
|
@DolencLuka thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
Refreshed onto current parent @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Hosted exact-head CI completed with 80 successful checks and 39 intentionally skipped checks. One The exact-head local changed-file gate, including lint, formatting, production/test type checks, and repository guards, passed; focused agent tests passed 262/262. As an external contributor I cannot rerun the parent-repo Actions job, so a maintainer rerun of the canceled lint/check-shard is the remaining CI action. No code or branch change was made in response to the runner cancellation. |
|
Ported the fix onto current @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…lure Integrate DolencLuka’s completion-replay repair with the current atomic completion owner. Persist recoverable missing-message delivery failure before the announce tail, fence ordinary and delayed wakes, retain genuine yielded work, and preserve explicit retry/dismissal. Includes real requester tool, SQLite reopen and shipped Gateway restart regression. Original contributor ancestry retained; exact-head hosted/native gates remain required.
|
Merged via squash.
|
Summary
Prevent a completed requester from running tools again when its subagent completion turn omits required message-tool delivery evidence. This updates DolencLuka's original fix to the maintained subagent owners and preserves the contributor's original commit ancestry.
payload_jsonauthoritative. No schema, dependency, public API, message-tool bypass, retention policy, or sibling startup-recovery change.Reproduction and observed fix
Qualification uses isolated, no-role AWS Crabbox with no credential hydration. Product source was pinned to
e53f50fbecad54000a499602062738794e586700, then overlaid with this candidate. Final publication binds every changed file to the qualified/reviewed afterimage. The final mock type annotations/formatting preserve assertions. A subsequent consolidation of duplicated handoff guards preserves the original conditions and branch order; it received its own independent review and focused branch qualification. Exact-head hosted CI and native preparation are separate required gates.execappend; suspended delivery, retained child result/payload; SQLite reopen and shipped Gateway restart with explicit follow-up do not repeat the effectInspectable scenario result
Fixed Gateway broker run
run_cf6a217447d7on leasecbx_f2ddde34944breturned exit 0. Vitest report: 1 passed, 0 failed, assertion duration 15.729 seconds. These are the executed scenario assertions, not a separate simulation:Source assertions: real Gateway scenario, lifecycle/atomicity/recovery scenarios.
Original distinct focused coverage: 4 lifecycle + 4 direct/pending controls + 1 Gateway = 9 passing cases. Subsequent handoff-consolidation qualification: 50 passed, 0 failed in the selected direct/pending/settled/yielded/failed-continuation cases (overlap is not double-counted). The first fixed lifecycle run had 3 passes and one test-contract failure; only that failed case was rerun after correcting
status: succeededversusterminalOutcome: blocked. Historical failed attempts and zero-selected/fixture failures are retained, not counted as proof. No baseline or lifecycle/Gateway passes were replayed just for integration; the changed handoff branch received the necessary focused requalification.Required changed-file checks: passed across all 33 declared gates; the retained full run passed 32 and failed only final root-test lint, whose six mechanical issues were corrected and passed targeted root lint/typing. Earlier failed attempts remain recorded. Independent security/source review and test-delta review are scoped-clean. Fresh exact-head CI/ClawSweeper and native LAND verification remain required.
Limits
The deterministic local HTTP model controls the scenario; the requester
exec, child lifecycle, SQLite owners, and shipped Gateway restart are real. This is not an authenticated external model/channel delivery or UI test. It proves no repeated requester tool effect for this failure path, not global exactly-once delivery. User-requested retry remains explicitly possible and carries existing duplicate-risk semantics.Release-note impact
Subagent completions that finish requester execution without required message-tool evidence stay recoverably blocked instead of replaying requester tools automatically. Credit: DolencLuka.
CHANGELOG.mdremains release-owned and untouched.Historical contributor description and proof (original head 44d14a3; not current-head execution)
Summary
payload_jsonauthoritative; do not restore parallel wake/visible fields or typed-column hydrationWhat problem this solves
For group/channel subagent completions, visible replies must still go through the message tool. If the requester completion turn already ran but omitted required message-tool evidence, replaying that whole turn can repeat arbitrary tools, tasks, or messages.
Current
mainalready owns a canonical suspendedpermanent_failurestate and explicit recovery/dismissal flow. This port latches the missing-delivery result into that owner boundary so restart cannot re-run requester orchestration.Delivery contract
disposition: "permanent_failure"suspendedwith its pending payload retainedpayload_jsonremains the only authoritative persisted delivery stateEvidence
Exact-head restart and SQLite proof
Head:
44d14a34a6da5e2dab59f668288c4a7e5dff5222Base:
aa7cf44c75a123a2724f20b05cd10d66cf7e65f3(openclaw/openclaw:main)Relationship: base is an ancestor; branch is one commit ahead.
The exact checkout exercised production delivery, lifecycle, task projection, restart admission, and SQLite persistence code. The restart integration closes and reopens the SQLite-backed registry, then verifies that requester delivery and Gateway delivery are not called again.
Redacted assertion summary:
The predecessor head also had an isolated production-Gateway proof of the no-replay failure class. This current-main port changes the persistence owner—not the safety goal—and adds exact-head restart coverage at the canonical suspended-delivery boundary requested in review.
Verification
tsconfig.core.json): passedtest/tsconfig/tsconfig.core.test.json): passedgit diff --check: passedHosted CI for this refreshed head is running and remains authoritative for the full repository matrix.
Review findings addressed
payload_jsonremains authoritative.Scope
Prerequisite integration
Signed head
89f6cfd8f3a5cf840742a1c258574507473c03d7integrates mained264cc3ca59b51648a366d7ed86df9e58c76390, including canonical fixture repairs #149020 and #149049 by @vincentkoc. All 12 replay-fix afterimage Git blobs and SHA256s are unchanged from the reviewed/publishede0155c75candidate; original contributor ancestry and focused proof are retained.The preceding CI run 34964825167 recorded the thinking-route auth fixture failure, the model-catalog root-work assertion, and two checkout timeouts before tests. Those failed attempts are preserved, not relabeled as passing. The integrated head requires its own hosted review/CI and native landing gates; no standalone baseline or passing focused proof was replayed for this integration.