openclaw - 💡(How to fix) Fix Bug: sub-agent announce completion causes parent session to generate out-of-context replies [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74286Fetched 2026-04-30 06:26:04
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
2
Author
Timeline (top)
commented ×2cross-referenced ×1mentioned ×1subscribed ×1

Root Cause

File: `dist/subagent-announce-Dim2fAZI.js` (compiled, not TypeScript source)

In `buildAnnounceReplyInstruction()` (line 29-32), the injected instruction tells the parent session to "convert the result into your normal assistant voice" — but the injection message (`triggerMessage`) only contains:

  1. The task result/findings
  2. The system instruction

It does NOT include the parent session's recent conversation history.

The parent session then generates a reply with essentially zero context about what the user was doing.

Fix Action

Workaround

Set `delivery.mode: "none"` on cron jobs, so they only send messages via `message` tool internally without triggering the parent session announce reply mechanism.


  • OpenClaw version: 2026.4.26 (be8c246)
  • Channel: Feishu
  • Session type: Cron job with sub-agent
RAW_BUFFERClick to expand / collapse

Bug Description

When a sub-agent or cron job with `delivery.mode: "announce"` completes, the parent session receives an `inter_session` injection containing only the task result, without any of the parent session's conversation context. This causes the parent session to generate replies that are completely irrelevant to what the user was actually discussing.

Steps to Reproduce

  1. Have an active main session conversation (e.g., user is debugging a cron issue)
  2. Spawn a sub-agent with `delivery.mode: "announce"` to execute a task
  3. Sub-agent completes and triggers the announce mechanism
  4. Result: The parent session generates a reply based ONLY on the task result + system instruction, with no awareness of the ongoing conversation. The reply often makes no sense in context.

Evidence

In this case, the user was debugging why a cron task failed. The main session was actively investigating. When a sub-agent completed, the parent session was injected with:

"A completed subagent task is ready for user delivery. Convert the result above into your normal assistant voice and send that user-facing update now."

But it had NO visibility into:

  • What the user was previously asking
  • The current debugging context
  • The conversation topic

So instead of acknowledging the cron investigation context, it generated: "你这cron是几分钟跑一次?感觉比我心跳还频繁 😅 要不要调低频率省点token?" — completely unrelated to what the user was actually doing.

Root Cause

File: `dist/subagent-announce-Dim2fAZI.js` (compiled, not TypeScript source)

In `buildAnnounceReplyInstruction()` (line 29-32), the injected instruction tells the parent session to "convert the result into your normal assistant voice" — but the injection message (`triggerMessage`) only contains:

  1. The task result/findings
  2. The system instruction

It does NOT include the parent session's recent conversation history.

The parent session then generates a reply with essentially zero context about what the user was doing.

Suggested Fix

When building the `triggerMessage` for the parent session, inject a summary of the parent session's recent conversation context (last N messages) so the parent session can generate contextually appropriate replies.

Specifically, modify `buildAnnounceReplyInstruction` or the `internalEvents` construction in `enqueueOrBypassSubagentAnnounce()` to include parent session conversation history in the trigger message.

Workaround

Set `delivery.mode: "none"` on cron jobs, so they only send messages via `message` tool internally without triggering the parent session announce reply mechanism.


  • OpenClaw version: 2026.4.26 (be8c246)
  • Channel: Feishu
  • Session type: Cron job with sub-agent

extent analysis

TL;DR

Modify the buildAnnounceReplyInstruction function to include the parent session's recent conversation context in the triggerMessage to generate contextually appropriate replies.

Guidance

  • Review the buildAnnounceReplyInstruction function in dist/subagent-announce-Dim2fAZI.js to understand how the triggerMessage is constructed.
  • Consider modifying the internalEvents construction in enqueueOrBypassSubagentAnnounce() to include the parent session's conversation history.
  • To verify the fix, test the sub-agent with delivery.mode: "announce" and check if the parent session generates contextually appropriate replies.
  • As a temporary workaround, setting delivery.mode: "none" on cron jobs can prevent the parent session announce reply mechanism from being triggered.

Example

No code snippet is provided as the issue does not include the relevant code, but the suggested fix involves modifying the buildAnnounceReplyInstruction function to include the parent session's conversation context.

Notes

The suggested fix requires modifying the compiled JavaScript file dist/subagent-announce-Dim2fAZI.js, which may not be straightforward. Additionally, the issue is specific to the OpenClaw version 2026.4.26 and the Feishu channel.

Recommendation

Apply the workaround by setting delivery.mode: "none" on cron jobs until a permanent fix can be implemented, as this prevents the parent session announce reply mechanism from being triggered and generating irrelevant replies.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Bug: sub-agent announce completion causes parent session to generate out-of-context replies [2 comments, 3 participants]