Repository navigation
fix(agents): record empty subagent completion delivery - #126179
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 19, 2026 04:14
Contributor
Author
|
Land-ready for
This is the single follow-up discovered while rebasing merged PR #126122 over #126075. No protocol, config, storage, schema, docs, or changelog change is required. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 20, 2026
* fix(agents): preserve delivery after incomplete completion * test(qa): distinguish failed delivered completions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #126122
Related: #126075
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Fixes a stacked regression where an empty-after-side-effect subagent completion visibly sent its terminal representation but never recorded delivery after #126075 made the underlying tool-bearing turn fail closed. The
subagent-completion-direct-fallbackQA scenario therefore timed out after 60 seconds on current main even though the outbound marker had committed.This is the single follow-up commit discovered while rebasing and proving #126122. That PR was independently merged before this second repair could be added.
Why This Change Was Made
The incomplete-turn diagnostic from #126075 remains correct: a tool-bearing assistant turn without a later final reply is a failed execution. Delivery is a separate lifecycle fact, so a source-matched final message already committed through the message tool now settles the detached task as delivered even when automatic delivery diagnostics report failure.
The QA scenario now asserts both authoritative outcomes for the empty case:
taskStatus: failedandtaskDeliveryStatus: delivered. It continues to require exactly one terminal representation, no replay after restart, and no internal metadata leak.Production LOC: +7/-5 (net +2). Tests/QA: +40/-7 (net +33). No protocol, config, storage, or schema changes.
AI-assisted: Codex. The implementation and evidence were inspected locally before publication.
User Impact
Operators still receive the correct incomplete-turn diagnostic for an empty side-effect-bearing subagent, while the terminal representation is delivered exactly once and the task ledger no longer remains pending.
No screenshot is attached because this is lifecycle accounting behind channel delivery. The repo-native QA scenario exercises the mock provider, ephemeral Gateway, transport boundary, task ledger, restart, and QA bus end to end.
Evidence
subagent-completion-direct-fallbackrun timed out twice after 60 seconds. Gateway logs showed the empty-case marker was sent, while the task remained unobservable through the scenario's completed-only delivery query.records a committed direct completion when the announce turn ends incompletefailed on current main withdelivery.delivered: expected false to deeply equal true.visible,silent,fallback,restart,empty) passed. Empty recordedtaskStatus: failed,taskDeliveryStatus: delivered, and oneQA-SUBAGENT-TERMINAL-EMPTY-REPRESENTEDsend; restart replay/unexpected counts were zero.PATH=/opt/homebrew/opt/node@24/bin:$PATH OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build qaRuntime— pass.PATH=/opt/homebrew/opt/node@24/bin:$PATH node scripts/run-vitest.mjs src/agents/subagents/announce/subagent-announce-delivery.test.ts src/agents/subagents/announce/subagent-announce-delivery.runtime.test.ts src/agents/subagents/registry/subagent-gateway-context-binding.test.ts— pass, 3 files / 174 tests across 2 shards.PATH=/opt/homebrew/opt/node@24/bin:$PATH pnpm check:changed— pass through the fail-safe all-lanes plan, including all typecheck, lint, dead-export, import-cycle, storage, and architecture guards..agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --stream-engine-output— clean; no accepted/actionable findings, patch judged correct at 0.98 confidence.