Skip to content

sessions_spawn rejects non-delivery channels (heartbeat, webhook, cron) #73237

@fancymatt

Description

@fancymatt

Bug

When an agent running on a non-delivery channel (e.g. heartbeat, cron, webhook) calls sessions_spawn, the server-side agent param validation rejects the request:

invalid agent params: unknown channel: heartbeat

This happens because isGatewayMessageChannel() only includes deliverable channel IDs + registered plugins + webchat as the internal channel. Heartbeat/cron/webhook sessions are not represented there.

Location

server-methods.ts — agent param validation around the channel hint check:
```
const isKnownGatewayChannel = (value) => isGatewayMessageChannel(value);
const channelHints = [request.channel, request.replyChannel]...
for (const rawChannel of channelHints) {
if (normalized && normalized !== "last" && !isKnownGatewayChannel(normalized)) {
respond(false, ..., invalid agent params: unknown channel: ${normalized});
}
}
```

Suggested fix

Either:

  1. Skip channel validation when the channel is a known internal/non-delivery source (heartbeat, cron, webhook)
  2. Add these internal channels to isGatewayMessageChannel / expand INTERNAL_MESSAGE_CHANNEL

Subagent spawning should be channel-agnostic — the parent channel identity is not relevant to child session creation.

Workaround

Wait for a live invocation (Telegram/webchat) to spawn subagents instead of relying on heartbeat ticks.

Environment

OpenClaw 2026.4.26 (be8c246)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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