-
-
Notifications
You must be signed in to change notification settings - Fork 52.5k
Description
Summary
After updating to 2026.2.23, subagents spawned via sessions_spawn (mode=run) execute correctly and the gateway logs show a successful Telegram send after each completion — but the completion message never appears in the Telegram chat.
Note: sessions_spawn auto-announces on completion by default (no --announce flag; that's cron-only).
Environment
- Version: 2026.2.23
- Platform: Telegram DM (single bot, single account, plain DM — not a group or forum topic)
- Gateway: systemd service, Linux, Node 22.22.0
- State dir:
~/.openclaw/(CLI and daemon use same config, confirmed viaopenclaw gateway status --json)
Steps to reproduce
From Telegram chat, trigger:
sessions_spawn({ task: "Reply with exactly: Subagent check OK", mode: "run", cleanup: "keep" })
What happens
- Subagent spawns and executes correctly
runs.jsonis written with full entry including correctrequesterOrigin(channel,to,accountId: "default")- Gateway logs show send returning ✓ ~0.5s after completion
delivery-mirrorentry appears in requester session transcriptcleanupHandled: trueset immediately, no retry fields- Message never arrives in Telegram
Key evidence
Gateway log around subagent completion (same pattern for all 3 test runs):
[DEBUG] embedded run agent end: runId=... isError=false
[DEBUG] run active check: active=true
[DEBUG] waiting for run end
[INFO] ⇄ res ✓ agent.wait 2781ms
[DEBUG] run cleared: totalActive=1
[DEBUG] notifying waiters
[DEBUG] embedded run done
[INFO] Subagent check OK ✅
[INFO] ⇄ res ✓ send 338ms channel=telegram conn=4f45b0e6…02c9 id=0da69492…f446
[DEBUG] abort failed: reason=no_active_run
[DEBUG] embedded run agent end (parent)
[DEBUG] run cleared: totalActive=0
runs.json entry (cleanup:"keep"):
{
"runId": "1eae8983-34ba-48d0-af5c-9e81c9477d79",
"childSessionKey": "agent:main:subagent:141f4cae...",
"requesterSessionKey": "agent:main:main",
"requesterOrigin": {
"channel": "telegram",
"to": "telegram:REDACTED",
"accountId": "default"
},
"expectsCompletionMessage": true,
"spawnMode": "run",
"cleanup": "keep",
"cleanupHandled": true,
"endedAt": 1771981571039,
"outcome": { "status": "ok" },
"endedReason": "subagent-complete",
"cleanupCompletedAt": 1771981571653
}No announceRetryCount or lastAnnounceRetryAt fields — retry path never triggered.
sessions_history delivery-mirror entry:
{
"role": "assistant",
"content": [{ "type": "text", "text": "✅ Subagent main finished\n\nSubagent check OK ✅" }],
"api": "openai-responses",
"provider": "openclaw",
"model": "delivery-mirror",
"stopReason": "stop"
}Outbound Telegram is healthy:
openclaw message send to the exact same target works and delivers correctly.
Suspected root cause
The gateway send RPC returns ✓ and the delivery-mirror records the transcript entry — but the message does not appear in the Telegram chat. The internal id=... in the log appears to be the RPC id, not the Telegram message_id. If Telegram is returning ok:true without dispatching (e.g. due to a disable_notification flag, invalid reply_to_message_id, or a short-circuit in the send pipeline), that would explain this exactly. The send codepath for subagent completion announcements may differ subtly from the openclaw message send CLI path in a way that causes Telegram to silently accept but not deliver.
What was working before
Cron jobs with --announce (systemEvent payload, sessionTarget=main) deliver correctly to Telegram. The broken path is specifically sessions_spawn subagent completion announce.