Skip to content

[Bug]: Subagent announce delivered to parallel Telegram channel session instead of originating parent session (single-user, intra-agent) #80201

@nailujac

Description

@nailujac

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When a subagent is spawned from agent:main:main and the agent is bound to a Telegram bot, the subagent's completion announce is delivered to the parallel channel-bound session (agent:main:telegram:default:direct:<chat_id>) instead of the originating parent session, so the parent session never observes the result and any logic gated on completion fails to fire.

Steps to reproduce

  1. Start OpenClaw 2026.5.7 with a single agent (main) bound to one Telegram bot, allowFrom set to one chat_id.
  2. From a session whose key is agent:main:main (driving the agent from the main session, not from a Telegram-channel-bound session), call sessions_spawn to start a subagent run that emits a completion announce on success.
  3. Wait for the subagent to finish (observable via subagent transcript / subagents action=list).
  4. Inspect agent:main:main: the announce is not present, the parent session keeps waiting as if the spawn were still running.
  5. Inspect agent:main:telegram:default:direct:<chat_id>: the announce is there.

Expected behavior

The completion announce is delivered to the originating parent session (the session that issued sessions_spawn). In prior installations (and per the design intent of subagent_announce), the parent that launched the spawn should be the session that observes the result, regardless of whether a parallel channel-bound session also exists for the same agent.

Actual behavior

The announce is routed by sourceChannel / last-touched delivery context for that channel rather than by parentSessionKey. With sourceChannel=telegram, the channel-bound session (agent:main:telegram:default:direct:<chat_id>) wins and receives the announce. The originating session agent:main:main receives nothing and remains in a "waiting on subagent" state until manual intervention.

OpenClaw version

2026.5.7 (eeef486)

Operating system

Ubuntu 24.04.4 LTS (aarch64)

Install method

npm global

Model

anthropic/claude-opus-4-7 (parent), anthropic/claude-sonnet-4-6 (subagent)

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

Single agent main configured in ~/.openclaw/openclaw.json. Telegram channel enabled with dmPolicy allowlist, single allowFrom chat_id, groupPolicy disabled. Auth via SecretRef to ~/.openclaw/secrets.json. No proxy or routing gateway between OpenClaw and Anthropic.

Logs, screenshots, and evidence

Anchor case: 2026-05-03, two consecutive subagent spawns from `agent:main:main` for an image-preset calibration. Both subagents finished cleanly with detailed announce payloads (preset config, dry-run output). Both announces were delivered to `agent:main:telegram:default:direct:323421384`; `agent:main:main` received nothing.

The originating parent declared "spawn returned no output" until the user manually pointed out that the result was visible in the parallel session.

Internal note recorded in workspace memory at the time:
"el subagent_announce (sourceTool en provenance) llegó a la sesión agent:main:telegram:default:direct:323421384 en lugar de a la sesión principal agent:main:main"

Workaround currently in use: after every sessions_spawn, the parent session manually runs `sessions_history` against both the main session AND the parallel channel session to detect completion. This defeats the purpose of subagent_announce and is timing-fragile.

Gateway journal slices around the affected timestamps can be provided on request.

Impact and severity

Affected: any OpenClaw deployment with a single agent bound to a Telegram (or likely any push channel) where work is initiated from agent:main:main rather than from the channel-bound session.
Severity: High for any workflow that relies on sub-agent completion to trigger follow-up actions in the parent (logging, chained delegations, user-facing replies), because the parent is never notified.
Frequency: Reproducible (2/2 observed attempts on 2026-05-03 in this environment).
Consequence: Silent loss of completion signal at the parent session. Manual intervention required to detect that the subagent finished. Logging tied to spawn cycle (e.g. delegation registries) is never written because the parent never receives the close event.

Additional information

Possibly related, distinct symptoms:

Suggested investigation: the subagent_announce delivery path appears to resolve the destination by sourceChannel / last-touched delivery context rather than by parentSessionKey recorded at spawn time. If parentSessionKey=agent:main:main, that should win regardless of sourceChannel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions