Repository navigation
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Summary
On OpenClaw 2026.5.19, isolated cron jobs with delivery.mode="announce" to Discord fail at delivery with:
OutboundDeliveryError: discordVoice outbound adapter is unavailable.
The agent run itself succeeds and produces a normal text summary, but outbound delivery is marked failed.
Environment
- OpenClaw:
2026.5.19 (a185ca2) - Channel: Discord
- Cron job: isolated, announce delivery to Discord channel
- Config:
messages.tts.auto = "always"
Repro Steps
- Configure Discord channel/account and a cron job with
delivery.mode="announce"to a Discord text channel. - Set
messages.tts.autoto"always". - Run the cron job manually with
openclaw cron run <job-id>. - Inspect run history with
openclaw cron runs --id <job-id> --expect-final.
Observed
- Cron execution produces valid summary text.
- Final run status contains:
error: OutboundDeliveryError: discordVoice outbound adapter is unavailable.delivery.resolved.ok: true(discord target resolved)delivery.delivered: falsedelivery.fallbackUsed: true
Expected
For text-only cron announce delivery targets, outbound should use normal Discord text path and succeed (or gracefully bypass voice route), even when messages.tts.auto="always".
Additional Notes
- Setting
messages.tts.autoto non-alwaysmode (e.g.tagged) avoided the failure in local testing. - This looks like a regression in Discord + cron + auto-TTS delivery routing.
Example run ids
manual:b6d6d387-11c9-4dbe-b220-83f35d28a987:1779365221918:1manual:b6d6d387-11c9-4dbe-b220-83f35d28a987:1779368021934:1
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon May 21, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Workflow note: Future ClawSweeper reviews update this same comment in place.
How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Summary
Keep open: the report maps to a current source-level Discord cron delivery bug, not a stale or duplicate cleanup candidate. Current main still lets cron announce TTS produce an
audioAsVoiceDiscord payload, and the CLI outbound dependency proxy can resolvediscordVoiceas a nonexistent channel adapter with the exact reported unavailable-adapter error.Reproducibility: yes. at source level: current main has a path from cron announce auto-TTS to Discord
audioAsVoice, then toresolveOutboundSendDep(deps, "discordVoice"), where the CLI proxy can create the exact unavailable-adapter sender. I did not run a live Discord cron job in this read-only sweep.Next step
This is a narrow source-reproducible bug with clear likely files and regression-test seams, suitable for a focused repair PR.
Review details
Best possible solution:
Preserve Discord auto-TTS voice-note behavior, but prevent the CLI/cron outbound dependency layer from treating
discordVoiceas a normal channel id and add a regression test for Discord cron TTS delivery.Do we have a high-confidence way to reproduce the issue?
Yes at source level: current main has a path from cron announce auto-TTS to Discord
audioAsVoice, then toresolveOutboundSendDep(deps, "discordVoice"), where the CLI proxy can create the exact unavailable-adapter sender. I did not run a live Discord cron job in this read-only sweep.Is this the best way to solve the issue?
Yes, but the narrow fix is dependency resolution, not disabling Discord TTS for cron. The maintainable solution is to keep the plugin-owned Discord voice sender available while ensuring pseudo-dependency keys such as
discordVoiceare not manufactured as channel adapters.Label changes:
P2: This is a concrete current-release Discord cron delivery bug with a narrow configuration trigger and a plausible focused fix.impact:message-loss: The reported final cron announce is marked undelivered after the outbound platform-send path fails.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P2: This is a concrete current-release Discord cron delivery bug with a narrow configuration trigger and a plausible focused fix.impact:message-loss: The reported final cron announce is marked undelivered after the outbound platform-send path fails.Acceptance criteria:
What I checked:
dispatchCronDeliverycallsmaybeApplyTtsToCronPayloadsfor resolved announce targets, then passes the resulting payloads intosendDurableMessageBatch; this is the cron path described by the report. (src/cron/isolated-agent/delivery-dispatch.ts:320, 6ccca4ae9529)maybeApplyTtsToPayloadhonorsautoModevalues other thanoffand, on successful synthesis, returns a payload withmediaUrl,audioAsVoice,spokenText, andtrustedLocalMedia. (extensions/speech-core/src/tts.ts:1691, 6ccca4ae9529)capabilities.tts.voice.synthesisTarget = "voice-note", and speech-core treats voice-note targets asaudioAsVoicewhen the provider result is voice-compatible. (extensions/discord/src/shared.ts:131, 6ccca4ae9529)sendDiscordOutboundPayloadroutespayload.audioAsVoiceplus media throughsendContext.sendVoice, which is the point where a baddiscordVoicedependency breaks delivery before normal text fallback can succeed. (extensions/discord/src/outbound-payload.ts:32, 6ccca4ae9529)discordVoicedependency:createDiscordPayloadSendContextresolvesdiscordVoicefrom outbound deps before falling back toruntime.sendVoiceMessageDiscord; a proxy-created placeholder therefore blocks the real plugin-owned helper. (extensions/discord/src/outbound-send-context.ts:81, 6ccca4ae9529)unavailableMessage: "${channelId} outbound adapter is unavailable.";discordVoiceis not excluded as a pseudo-dependency key. (src/cli/deps.ts:73, 6ccca4ae9529)Likely related people:
extensions/speech-core/src/tts.ts,src/cli/deps.ts,src/cli/outbound-send-mapping.ts)extensions/speech-core/src/tts.ts,extensions/speech-core/src/tts.test.ts)src/cron/isolated-agent/delivery-dispatch.ts,src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts,docs/automation/cron-jobs.md)src/cron/isolated-agent/delivery-dispatch.ts,src/cron/isolated-agent.direct-delivery-forum-topics.test.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 6ccca4ae9529.
fix(discord): move voice fallback to sendPayload path
JulyanXu commentedon May 22, 2026
Source-verified analysis:
Traced the delivery routing chain:
Error source:
src/cli/deps.ts:82—createLazySendergenerates the "outbound adapter is unavailable" message perchannelId. WhenchannelId = "discordVoice", it creates a lazy sender that attempts to load the voice outbound runtime, which fails because the Discord voice adapter is not available in the cron delivery context.Why
discordVoiceis selected: Inextensions/discord/src/outbound-adapter.ts:233, whenaudioAsVoice === trueAND there's amediaUrl, the outbound adapter routes throughdiscordVoice:Why
audioAsVoiceis true: Themessages.tts.auto = "always"config causes the TTS pipeline to generate audio and setaudioAsVoice = trueon the reply payload. Inextensions/discord/src/monitor/reply-safety.ts:31,hasNonTextReplyPayloadContentcheckspayload.audioAsVoice === trueto preserve voice payloads from filtering.The routing bug: Cron announce delivery for a Discord text channel should NOT route through
discordVoiceeven when TTS generates audio. The voice adapter requires a Discord voice channel connection (which cron delivery doesn't have), while the text channel should receive the text summary + TTS audio as a regular media attachment via thediscord(text) adapter.Fix approach:
The outbound adapter's
audioAsVoicerouting logic should consider the delivery context. When the target is a text channel (not a voice channel),audioAsVoiceshould be downgraded to a regular media attachment delivery:In
outbound-adapter.ts, before theaudioAsVoicebranch:This ensures cron announce deliveries to text channels succeed with TTS audio as an attachment, while preserving the voice-channel delivery path for interactive sessions.
JulyanXu commentedon May 22, 2026
Debugged to exact lines. Precise fix:
Root Cause
extensions/discord/src/outbound-adapter.ts:231-245— ThesendMediafunction routes todiscordVoicewheneveraudioAsVoice && mediaUrlis true, with no check on whether the target is a Discord voice channel vs text channel:When
messages.tts.auto = "always", the TTS pipeline setsaudioAsVoice = trueand generates amediaUrlwith the audio file. For cron announce delivery to a Discord text channel, this routes throughdiscordVoice— but:resolveOutboundSendDep(deps, "discordVoice")returnsundefined(no voice adapter in cron delivery deps)runtime.sendVoiceMessageDiscordrequires an active Discord voice connection, which cron doesn't haveOutboundDeliveryError: discordVoice outbound adapter is unavailableThe missing check
The
sendMediafunction has no way to distinguish between delivery to a Discord voice channel (wheresendVoiceis correct) vs delivery to a Discord text channel (where audio should be sent as a regular file attachment).The
targetstring (fromresolveDiscordOutboundTarget) encodes the destination but doesn't carry voice-vs-text channel metadata.Exact Fix
Add a guard that catches the unavailable voice adapter and falls through to text+media delivery:
Key change: Remove the
?? (await loadDiscordSendRuntime()).sendVoiceMessageDiscordfallback. IfdiscordVoiceisn't in deps, the voice adapter isn't available for this delivery context. Instead of trying and failing, fall through to the existing text+media delivery path (lines 246+), which sends the audio as a file attachment via the regulardiscordtext adapter.The fallback to
runtime.sendVoiceMessageDiscordwas the bug — it attempted voice-channel delivery in a context where no voice channel exists. The correct fallback for unavailable voice is to degrade gracefully to text-channel delivery with the audio as an attachment.Why this works
resolveOutboundSendDep(deps, "discordVoice")returns the function → voice delivery works as beforeaudioAsVoicebranch intercepted and failed