Skip to content

Sub-agent announce delivery fails silently in Telegram forum topics #26803

@blessonism

Description

@blessonism

Summary

When a sub-agent spawned via sessions_spawn completes in a Telegram forum topic context, the announce step fails to deliver the result back to the requester chat. The system retries 3 times and gives up silently — the parent session never receives the completion notification.

Environment

  • OpenClaw: Docker/Zeabur deployment
  • Channel: Telegram (forum/supergroup with topics enabled)
  • Sub-agent mode: sessions_spawn with mode: "run"

Steps to Reproduce

  1. In a Telegram forum topic (not the General topic), spawn a sub-agent:
    sessions_spawn(task="...", label="test", mode="run", model="opus-4.6")
    
  2. Note: thread=true fails immediately with "thread=true is unavailable because no channel plugin registered subagent_spawning hooks"
  3. Fall back to thread=false — spawn succeeds, sub-agent runs and completes normally
  4. Sub-agent finishes (outcome.status: "ok") but the announce never arrives in the forum topic

Evidence from ~/.openclaw/subagents/runs.json

{
  "runId": "<REDACTED_RUN_ID>",
  "requesterSessionKey": "agent:main:telegram:group:<REDACTED_GROUP_ID>:topic:<REDACTED_TOPIC_ID>",
  "requesterOrigin": {
    "channel": "telegram",
    "to": "telegram:<REDACTED_GROUP_ID>",
    "accountId": "default",
    "threadId": <REDACTED_TOPIC_ID>
  },
  "outcome": { "status": "ok" },
  "endedReason": "subagent-complete",
  "announceRetryCount": 3,
  "lastAnnounceRetryAt": <REDACTED_TIMESTAMP>
}

Key observations:

  • announceRetryCount: 3 — all 3 retries failed
  • requesterOrigin.threadId: <REDACTED_TOPIC_ID> — the target is a forum topic
  • The sub-agent itself completed successfully (outcome.status: "ok")
  • No error message is surfaced anywhere — the failure is completely silent

Expected Behavior

The announce message should be delivered to the same forum topic where the sub-agent was spawned, preserving the threadId / message_thread_id in the Telegram API call.

Actual Behavior

Announce delivery fails 3 times and is silently dropped. The parent session has no way to know the sub-agent finished unless it manually polls via subagents list.

Additional Context

  • thread=true is not supported for Telegram at all ("no channel plugin registered subagent_spawning hooks"), so the only option is thread=false
  • Regular (non-forum) Telegram groups may not have this issue — the problem appears specific to forum topics where message_thread_id routing is required
  • This forces a workaround where sub-agents must write results to files instead of relying on the announce mechanism

Suggested Fix

The Telegram adapter's announce delivery path should:

  1. Preserve threadId from requesterOrigin when posting the announce message
  2. Pass message_thread_id to the Telegram Bot API sendMessage call
  3. Surface announce delivery failures in logs or as a system message to the parent session (rather than silent drop)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions