Skip to content

[Bug]: Task flow completion leaks internal routing metadata into Discord channel #59025

@CountofGlamorgan

Description

@CountofGlamorgan

Description

After upgrading to OpenClaw 2026.3.31, ACP task completion events leak internal routing metadata and system instructions into user-facing Discord channels as plain messages.

Environment

  • OpenClaw version: 2026.3.31
  • Channel: Discord (guild channel with thread bindings enabled)
  • ACP backend: acpx with Codex
  • OS: macOS (Apple Silicon)

Steps to Reproduce

  1. In a Discord channel (e.g. #proj-bimaterial), have a conversation with the agent
  2. Agent spawns a Codex ACP session via sessions_spawn — a thread "🤖 codex" is created
  3. Codex completes the task successfully
  4. The channel receives "Background task done: ACP background task (run cdfe1eff)."
  5. Run /status in the channel

Observed Behavior

The agent posts multiple messages (5-6) into the channel containing:

  • The full raw task completion result (internal child result with <<<BEGIN_UNTRUSTED_CHILD_RESULT>>> / <<<END_UNTRUSTED_CHILD_RESULT>>> markers)
  • Internal runtime stats: Stats: runtime 6m14s • tokens 0 (in 0 / out 0)
  • Internal routing instructions: "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. Keep this internal context private..."
  • Runtime configuration metadata: "⚙️ Runtime: direct · Think: adaptive", "👥 Activation: mention · 🪢 Queue: collect (depth 0)"

This internal metadata should never reach user-facing channels.

Expected Behavior

  • Task completion results should be sanitized before delivery — only the human-readable summary should be sent
  • Internal routing instructions (Action: ...) should be stripped
  • Runtime metadata and stats should not be included in user-visible messages
  • The delivery should be a single, clean message summarizing what the agent accomplished

Timeline (UTC+8, 2026-04-01)

Time Event
20:47-20:52 Normal conversation in channel
20:53 Agent spawns Codex, thread "🤖 codex" created
20:59:33 "Background task done: ACP background task" appears in channel
21:00:08-21:00:14 User runs /status → agent dumps 5-6 messages with raw internal metadata into channel

Related

Additional Context

This appears related to the new task flow routing introduced in 2026.3.31 ("route one-task ACP and subagent updates through a parent task-flow owner context"). The completion event is being delivered raw instead of being processed through the normal sanitization/rewriting pipeline.

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