openclaw - 💡(How to fix) Fix chore: typed error for cron delivery.channel="last" when no prior chat exists [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

The cron delivery resolver (resolveDeliveryTarget in src/cron/jobs.ts, calling into src/infra/outbound/channel-selection.ts) has a sibling failure family that surfaces the same generic wrapped error string — "Channel is required (no configured channels detected). Set delivery.channel explicitly or use a main session with a previous channel." — but for a different root cause: Today both failure modes wrap to the same string at assertSupportedJobSpec / the cron-runner delivery resolver, which makes them indistinguishable in task_runs.error and in openclaw cron list output (e.g. announce -> last (last -> no route, will fail-closed: Channel...)). Operators have to read cron show <id> and cross-reference session state to tell whether they configured a bad channel or just have a fresh session with no chat history. Add a parallel typed error (working name: NoPriorChatChannelError) thrown from the same resolveMessageChannelSelection site (or from the cron-side resolveDeliveryTarget if that is the cleaner seam) when:

  • src/utils/message-channel-constants.tsINTERNAL_MESSAGE_CHANNEL, WebchatNotDeliverableError (introduced in the original PR; the new error would live next to it).

Root Cause

The cron delivery resolver (resolveDeliveryTarget in src/cron/jobs.ts, calling into src/infra/outbound/channel-selection.ts) has a sibling failure family that surfaces the same generic wrapped error string — "Channel is required (no configured channels detected). Set delivery.channel explicitly or use a main session with a previous channel." — but for a different root cause:

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Follow-up to a forthcoming PR that introduces a typed WebchatNotDeliverableError thrown from resolveMessageChannelSelection for delivery.channel: "webchat" (the internal session-bound surface, not a deliverable channel plugin).

The cron delivery resolver (resolveDeliveryTarget in src/cron/jobs.ts, calling into src/infra/outbound/channel-selection.ts) has a sibling failure family that surfaces the same generic wrapped error string — "Channel is required (no configured channels detected). Set delivery.channel explicitly or use a main session with a previous channel." — but for a different root cause:

  • delivery.channel: "last" (or omitted) when the resolved session key has no prior chat in the session store to anchor against.

Today both failure modes wrap to the same string at assertSupportedJobSpec / the cron-runner delivery resolver, which makes them indistinguishable in task_runs.error and in openclaw cron list output (e.g. announce -> last (last -> no route, will fail-closed: Channel...)). Operators have to read cron show <id> and cross-reference session state to tell whether they configured a bad channel or just have a fresh session with no chat history.

Proposal

Add a parallel typed error (working name: NoPriorChatChannelError) thrown from the same resolveMessageChannelSelection site (or from the cron-side resolveDeliveryTarget if that is the cleaner seam) when:

  1. params.channel normalizes to "last" (or is undefined/empty meaning "infer from session history"), AND
  2. the resolved session entry has no lastChannel recorded, AND
  3. there is no params.fallbackChannel resolvable.

Message should name the actionable fixes: configure a real channel and switch delivery.channel to it explicitly, or use sessionTarget: "session:agent:<id>:main" with payload.kind: "agentTurn" and delivery.mode: "none" so the agent turn output renders in its own session without an announce route.

Why not include in the original PR

To keep the original diff focused. The webchat case is structurally non-deliverable (a property of the channel constant); the "last" case is dependent on session state at fire time (a property of the session store). Different invariants, different message text, and the "last" case probably wants its own test fixtures around stale/empty session history.

Source pointers (paths at the time of filing)

  • src/utils/message-channel-constants.tsINTERNAL_MESSAGE_CHANNEL, WebchatNotDeliverableError (introduced in the original PR; the new error would live next to it).
  • src/infra/outbound/channel-selection.tsresolveMessageChannelSelection. The webchat check is at the top of the explicit-channel branch in the original PR.
  • src/cron/jobs.tsresolveDeliveryTarget, where the wrapping happens today.
  • Documented contract: docs/automation/cron-jobs.md — the "Webchat is not an announce target" subsection added by the original PR.

The original PR link will be added in a comment here once it is opened.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix chore: typed error for cron delivery.channel="last" when no prior chat exists [1 pull requests]