Skip to content

[Bug]: Sub-agent completion announce unreliable on Telegram — sometimes silent, sometimes delivers 3x duplicate #90103

Description

@ksiyuna-claw

Describe the bug

When spawning sub-agents via sessions_spawn from a Telegram DM session and then sessions_yield, the completion announce back to the parent session is unreliable:

  • Pattern A (silent loss): Sub-agent completes successfully, but the parent session never wakes up. The user gets no notification. Only when the user manually sends a follow-up message does the parent realize the child finished.

  • Pattern B (duplicate delivery): Multiple sub-agent completion events queue up, then when the parent does wake (user sends a message), ALL queued completions are delivered at once — resulting in 3 replies for 3 sub-agents simultaneously.

Both patterns happen intermittently on the same setup with no config changes between them.

Environment

  • OpenClaw: 2026.5.28 (e932160)
  • OS: macOS 26.5.1 (arm64) — Mac mini M4
  • Node: 26.0.0
  • Channel: Telegram (direct DM, not group)
  • Agents: 9 configured
  • Model: zhipu/glm-5.1 (Coding Plan)
  • Sub-agents: spawned with sessions_spawn(mode="run"), waited with sessions_yield

Steps to reproduce

  1. From a Telegram DM session, spawn 1-3 sub-agents via sessions_spawn
  2. Call sessions_yield to wait for completions
  3. Observe: sometimes the parent wakes and delivers the result, sometimes it stays silent until the user sends a follow-up message
  4. When multiple sub-agents complete close together, sometimes all results arrive in a burst

Expected behavior

Each sub-agent completion should reliably:

  1. Wake the yielded parent session
  2. Deliver exactly ONE reply to the Telegram chat
  3. No silent loss, no duplicate burst delivery

Actual behavior

  • ~50% of the time: completion is silently lost (parent stays yielded)
  • ~20% of the time: multiple completions arrive simultaneously in a burst
  • ~30% of the time: works as expected (single reliable delivery)

These are rough estimates from ~15 sub-agent runs over the past 2 days.

Logs / Evidence

No error-level logs observed during silent loss. The sub-agent sessions show they completed normally (full transcript, correct output). The issue appears to be in the announce/delivery layer, not the sub-agent execution.

Related Issues

Workaround (agent-side)

We've added a rule in our agent workspace: after sessions_yield resumes, the parent agent MUST immediately send an explicit reply with the sub-agent results, regardless of whether auto-announce succeeded. This partially mitigates the silent-loss case, but does not help when the parent never wakes at all.

Suggested fix

It would be great if the announce layer had a more robust delivery guarantee for Telegram:

  1. If channel delivery fails, fall back to injecting the completion as an internal event in the parent session (so the parent can self-reply)
  2. Add deduplication for queued completion events to prevent burst delivery
  3. Log at warn level when announce fails or is retried, so it is observable in openclaw logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions