Repository navigation
[ENG-21269] fix(gateway): parent agent forgets finished sub-agent results after yielding - #314
Merged
Merged
Conversation
…ielding A parent agent that spawns sub-agents and calls sessions_yield is idle while the children run. When a child finishes, the gateway agent method runs a parent turn with the child result. That turn did not save its prompt to the parent transcript. The model saw the result once, in that turn only. On the next wake the result was gone, so the parent waited for children that had already finished and never sent its final answer. The suppression came from upstream "fix: hide subagent announce handoff prompts" (openclaw#79618). Its goal was to hide the handoff prompt in chat history. The chat display projection already hides user rows with subagent_announce provenance, so dropping the transcript row is not needed for that goal. Upstream removed the same suppression in openclaw#181673. Remove the automatic suppression for sub-agent completion handoffs. The completion turn now saves a user row with inter_session / subagent_announce provenance that carries the child result. Callers that pass suppressPromptPersistence explicitly keep their behavior.
The deferred-gap TODO in the embedded runner attempt needs an eslint/no-warning-comments suppression. The production suppression allowlist test lists each such file explicitly, so add the attempt file next to the other deferred-gap entries.
There was a problem hiding this comment.
Review Summary
Verdict: Approved (Ready to merge)
Analysis & Implementation
- Root Cause: In
src/gateway/server-methods/agent.ts,shouldSuppressAgentPromptPersistencewas suppressing prompt persistence for anysubagent_announcecompletion handoff. As a result, child completion turns were never written to the parent session transcript, causing the parent to lose previous results across wakes after yielding. - Fix: Removed
shouldSuppressAgentPromptPersistenceso completion turn prompts are persisted in the transcript by default, matching upstream openclaw#181673. Explicit caller suppression (request.suppressPromptPersistence === true) remains respected. - UI & Chat Projection: User-facing WebChat and Control UI projections remain clean:
chat-display-projection.tsalready dropssubagent_announceprovenance records from visible history. - Deferred Gap Documented: Documented the steering queue replay behavior upon
sessions_yieldabort with a TODO comment inrun/attempt.tsand updated the production lint suppression allowlist intest/scripts/lint-suppressions.test.ts.
Verification
- Test Suite:
src/gateway/server-methods/agent.test.ts: 344 passed (including the new parameterized test covering both default and explicit suppression).test/scripts/lint-suppressions.test.ts: 3 passed.src/agents/subagent-announce-delivery.test.ts: 112 passed.
- CI Status: All GitHub check runs completed successfully (clean green across lint, types, shrinkwrap, guards, and test shards).
- Commit Signatures: Both commits (
55c1a7f,c5d5733) are signed and verified by GitHub.
LGTM!
a-bernike
approved these changes
Oct 30, 2026
orswn
added a commit
that referenced
this pull request
Nov 2, 2026
Cut the fork release for the 6 PRs merged to boon since v2026.6.35-boon.2: - #313 (ENG-21904, ENG-21905): no fallback after the run deadline, no late replies from timed-out sub-agents, and no false error notice after a recovered context precheck. - #314 (ENG-21269): a parent that yielded keeps finished sub-agent results on later wakes. - #315 (ENG-21129): skip the failure notice on channels that report their own turn outcome, and say the work continues while the failed turn's sub-agents still run. - #311: qs override 6.16.1 (CVE-2026-82417). - #317: follow-redirects override 1.16.2 (GHSA-mrwp-f3q8-3g9p). - #312: Docker base digests to Node 24.22.1. Bump the root package.json and npm-shrinkwrap.json, all 136 bundled plugin manifests (scripts/sync-plugin-versions.ts), and the version and openclaw peer floor in every extension npm-shrinkwrap.json. Add the 2026.6.35-boon.3 CHANGELOG.md section. No source or dependency change beyond what already merged in the PRs above.
orswn
added a commit
that referenced
this pull request
Nov 2, 2026
Cut the fork release for the 6 PRs merged to boon since v2026.6.35-boon.2: - #313 (ENG-21904, ENG-21905): no fallback after the run deadline, no late replies from timed-out sub-agents, and no false error notice after a recovered context precheck. - #314 (ENG-21269): a parent that yielded keeps finished sub-agent results on later wakes. - #315 (ENG-21129): skip the failure notice on channels that report their own turn outcome, and say the work continues while the failed turn's sub-agents still run. - #311: qs override 6.16.1 (CVE-2026-82417). - #317: follow-redirects override 1.16.2 (GHSA-mrwp-f3q8-3g9p). - #312: Docker base digests to Node 24.22.1. Bump the root package.json and npm-shrinkwrap.json, all 136 bundled plugin manifests (scripts/sync-plugin-versions.ts), and the version and openclaw peer floor in every extension npm-shrinkwrap.json. Add the 2026.6.35-boon.3 CHANGELOG.md section. No source or dependency change beyond what already merged in the PRs above.
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: ENG-21269, ENG-20773
What Problem This Solves
Fixes an issue where a parent agent that splits work across sub-agents forgets finished results and never sends its final answer.
sessions_yieldand goes idle.Seen on customer Slack threads and in the PDF coverage agent regression scenario, which times out at 900 s while its children finish in about 5 minutes.
Why This Change Was Made
The gateway
agentmethod suppressed transcript persistence for the turn that delivers a sub-agent completion to its parent. The model saw the child result in that turn only, and the result was never saved.That suppression came from upstream "fix: hide subagent announce handoff prompts" (openclaw#79618), whose goal was to keep these internal prompts out of chat history. The chat display projection already hides user rows with
inter_session/subagent_announceprovenance, so the transcript row can be saved without showing it. Upstream removed the same suppression in openclaw#181673.inter_session/subagent_announceprovenance. The row holds the child result.suppressPromptPersistenceexplicitly (gateway boot, sub-agent orphan resume) keep their behavior.display: false. That code lives in a gateway module this fork does not have yet. Display is already hidden by provenance here.Trade-off, not fixed here: when a completion delivery stays pending (for example a session with no deliverable channel and target), the agent steering queue re-sends it on each wake. A
sessions_yieldabort returns the leased items to the queue, so the next wake replays them again. That replay is now saved in each wake row too, so results can repeat in the transcript, up to 24,000 characters per wake. In the runtime check below, Slack thread wakes were marked delivered and carried no replay. ATODOmarks the release on the yield abort; fixing it changes the steering lease rules.User Impact
sessions_historytool does not show the internal completion rows.Evidence
suppressPromptPersistence: truemeans it is suppressed. It failed on the base commit (expected true to be false) and passes on this branch.node scripts/run-vitest.mjsover the gateway agent, chat history, server methods, sub-agent announce delivery, agent command, and input provenance tests: 864 tests pass.tsgo(core, core tests),oxlint,oxfmt --check, andgit diff --checkpass.subagent_announceuser rows in the parent transcriptchat.historyOpenClaw Control UI view of the same two parent sessions. Left: base build. Right: this branch. The completion handoff rows stay hidden in both.
The last right-hand tile starts with a steering queue block for the third child. The local test had no Slack adapter, so that child's final reply could not be delivered and was queued for replay. The block holds only
RESULT-CHARLIE-9902. The other two results reach the recall turn from the saved transcript.Summary by cubic
Fixes a bug where a parent agent that spawns sub-agents and calls
sessions_yieldforgets finished children's results, then never sends its final answer.The gateway
agentmethod suppressed transcript persistence for the turn that delivers a sub-agent completion to its parent, so each child result was visible to the model only in that single turn. That suppression came from upstream commit openclaw#79618, which hid subagent announce handoff prompts from chat history; the chat display projection already hides these rows by provenance, so the row can now be saved without appearing in chat.The completion turn now persists one user row with
inter_session/subagent_announceprovenance carrying the child result, so the parent keeps every finished result across wakes. Callers that passsuppressPromptPersistenceexplicitly keep their behavior. The rows remain hidden from web chat, the Control UI, andsessions_history.Known trade-off, not fixed here: when a completion delivery stays pending (a session with no deliverable channel), a
sessions_yieldabort returns leased steering items to the queue, so the next wake replays and repersists them. ATODOinattempt.tsmarks that release for a follow-up fix.Written for commit c5d5733. Summary will update on new commits.