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
- In a Telegram forum topic (not the General topic), spawn a sub-agent:
sessions_spawn(task="...", label="test", mode="run", model="opus-4.6")
- Note:
thread=true fails immediately with "thread=true is unavailable because no channel plugin registered subagent_spawning hooks"
- Fall back to
thread=false — spawn succeeds, sub-agent runs and completes normally
- 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:
- Preserve
threadId from requesterOrigin when posting the announce message
- Pass
message_thread_id to the Telegram Bot API sendMessage call
- Surface announce delivery failures in logs or as a system message to the parent session (rather than silent drop)
Summary
When a sub-agent spawned via
sessions_spawncompletes 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
sessions_spawnwithmode: "run"Steps to Reproduce
thread=truefails immediately with"thread=true is unavailable because no channel plugin registered subagent_spawning hooks"thread=false— spawn succeeds, sub-agent runs and completes normallyoutcome.status: "ok") but the announce never arrives in the forum topicEvidence 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 failedrequesterOrigin.threadId: <REDACTED_TOPIC_ID>— the target is a forum topicoutcome.status: "ok")Expected Behavior
The announce message should be delivered to the same forum topic where the sub-agent was spawned, preserving the
threadId/message_thread_idin 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=trueis not supported for Telegram at all ("no channel plugin registered subagent_spawning hooks"), so the only option isthread=falsemessage_thread_idrouting is requiredSuggested Fix
The Telegram adapter's announce delivery path should:
threadIdfromrequesterOriginwhen posting the announce messagemessage_thread_idto the Telegram Bot APIsendMessagecall