Skip to content

sessions_spawn subagent completion: gateway send returns ✓ but message never appears in Telegram (2026.2.23) #25961

@mpanoff

Description

@mpanoff

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 via openclaw 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

  1. Subagent spawns and executes correctly
  2. runs.json is written with full entry including correct requesterOrigin (channel, to, accountId: "default")
  3. Gateway logs show send returning ✓ ~0.5s after completion
  4. delivery-mirror entry appears in requester session transcript
  5. cleanupHandled: true set immediately, no retry fields
  6. 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.

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