Skip to content

Subagent announce leaks internal prompt and stats to user chat #6669

Description

@dloomis

Description

When a subagent completes and announces its result back to the chat, the raw output includes:

  1. Internal prompt instructions (e.g., "Summarize this naturally for the user...")
  2. Stats/metadata (tokens, session IDs, transcript paths)

These should not be visible to the end user.

Expected Behavior

Only the clean, summarized result should appear in the user's chat. The internal prompt and stats should be processed/hidden.

Actual Behavior

User sees raw output like:

NIN Concert Details
Based on the calendar search, I found the following:
[... actual content ...]

Stats: runtime 7s • tokens 11.2k (in 12 / out 516) • sessionKey agent:main:subagent:60de587e-... • sessionId 3a68b616-... • transcript /Users/phil/.openclaw/agents/main/sessions/...

Summarize this naturally for the user. Keep it brief (1-2 sentences). Flow it into the conversation naturally.
Do not mention technical details like tokens, stats, or that this was a background task.
You can respond with NO_REPLY if no announcement is needed (e.g., internal task with no user-facing result).

Steps to Reproduce

  1. Configure subagents with Haiku model in openclaw.json
  2. Have main agent spawn a subagent via sessions_spawn
  3. Subagent completes and announces result
  4. Observe raw output in chat client (webchat)

Environment

  • openclaw version: 2026.1.30
  • Platform: macOS
  • Channel: webchat

Suggested Fix

Either:

  1. Add config option to control announce verbosity (e.g., subagents.announce.showStats: false)
  2. Process the announce step through main agent before displaying to user
  3. Strip internal prompts and stats from user-facing output

Workaround Attempted

Tried adding to config (no effect):

"subagents": {
  "announce": {
    "showStats": false,
    "verbose": false
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions