Skip to content

[Bug]: Subagent completion announce leaks internal runtime context into Control UI chat and persists it in session history #62306

@MojoJojo43

Description

@MojoJojo43

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Subagent completion announce delivery can leak raw internal OpenClaw runtime context into user-visible chat in Control UI/webchat, and the leaked content is persisted into session history as real inbound messages instead of being treated as internal-only event data.

Steps to reproduce

  1. Use OpenClaw Control UI / webchat with a main session.
  2. Spawn or run a subagent that completes and announces its result back to the main session.
  3. Let the subagent complete while the main session remains active in webchat.
  4. Observe the resulting messages in the chat transcript.

Expected behavior

When a subagent completes:

  • the main session should receive one clean internal completion event
  • OpenClaw should convert that into one normal assistant reply for the user
  • internal markers such as <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>, internal task metadata, stats, and action instructions should never be shown in user-visible chat
  • internal completion payloads should never be stored as normal inbound user messages in session history

Actual behavior

In webchat / Control UI, raw internal completion content is exposed directly in the chat transcript, including text like:

  • <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>
  • OpenClaw runtime context (internal):
  • [Internal task completion event]
  • Action: A completed subagent task is ready for user delivery...

The leaked content is not only rendered in the UI. It is also persisted in the session JSONL as inbound messages, so it pollutes transcript history and context.

In the reproduced case, multiple related completion/handoff messages were injected in sequence for the same completion chain, creating repeated or near-duplicate user-visible messages.

OpenClaw version

2026.4.5 (3e72c03)

Operating system

Ubuntu Linux 6.17.0-20-generic (x64)

Install method

npm global

Logs, screenshots, and evidence

Verified locally in session transcripts:

  1. Main session transcript contains the leaked internal block as a stored inbound message, not only a frontend render artifact.
  2. Related agent session shows the same completion chain arriving via inter-session / subagent announce delivery.
  3. Multiple announce/handoff messages for the same completion chain were delivered in sequence.

Representative leaked content included:

<<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>
OpenClaw runtime context (internal):
This context is runtime-generated, not user-authored. Keep internal details private.

[Internal task completion event]
source: subagent
session_key: agent:living-artificial:subagent:...
status: completed successfully
...
Action:
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.
<<<END_OPENCLAW_INTERNAL_CONTEXT>>>

Representative provenance from related session history indicated inter-session delivery from subagent completion / announce paths.

Impact and severity

Severity: High

Impact:

  • leaks internal runtime/meta content into user-visible chat
  • stores leaked internal payloads in session history
  • pollutes future model context
  • creates confusing repeated completion messages
  • makes Control UI/webchat transcripts unreliable and noisy during subagent workflows

Additional information

This appears related to, but distinct from, existing delivery-mirror / webchat duplication issues such as:

Observed behavior suggests a failure in the subagent completion announce transformation path: raw internal completion payload is being forwarded into chat instead of being converted into a single clean assistant response before persistence/delivery.

This was reproduced on a system already running a newer version than several previously reported webchat duplication bugs, so it may be a remaining or neighboring bug in subagent completion announce handling specifically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions