Repository navigation
Description
Draft: Discord turns and cron jobs lost around gateway restarts
Environment
- OpenClaw: 2026.6.10 stable
- Runtime: Docker Desktop on macOS, Linux container arm64
- Node: 24.16.0 inside container
- Channel: Discord bot
- Agent: Penny
- Discord status during checks: enabled, configured, running, connected
- Config validation: valid, no warnings
- Group visible replies:
messages.groupChat.visibleReplies = "automatic" - Affected no-mention channels have
requireMention: false
Summary
Penny is online and Discord-connected, but gateway/container restarts correlate with missed or delayed Discord turns and lost cron/recovery tasks. From the user perspective, the bot appears to ignore a message until it is mentioned/reminded again.
This does not appear to be a basic Discord routing config issue. Channel probe passes, the affected channels are configured for no-mention replies, and normal replies work outside the restart window.
Current Evidence
From ./OpenClaw/oc reliability-check --since 24h --no-save:
- Penny restart count increased from 23 to 40.
- Penny has restart-recovery log lines in the window.
- Peach also had a restart-count increase, but Penny is the user-visible issue.
From openclaw tasks audit --json:
- 5 warnings total.
- 4
losttasks. - 1
delivery_failedtask. - Lost tasks include Morning Briefing, AI X List Briefing Watchdog, heartbeat recovery, and OpenClaw X List Briefing Watchdog.
From focused logs on 2026-06-30:
- Gateway restarted around
2026-06-30T04:07Z,04:35Z,04:40Z, and05:00Z. - Restart recovery resumed interrupted heartbeat sessions around
04:35Zand04:40Z. - Delivery recovery reported a failed pending Discord delivery with state
send_attempt_startedand refused blind replay without adapter reconciliation. - Morning Briefing and Morning Briefing Podcast had to be repaired after scheduled runs were interrupted by gateway restarts.
From the later 2026-06-30 user-message incident:
- Penny restarted at
2026-06-30T07:22:03.116Z. - Discord provider started at
2026-06-30T07:22:06.733Z. - A no-mention user message in an allowed
#pennythread was posted at2026-06-30T07:22:11.537Z. - Discord channels resolved at
2026-06-30T07:22:14.073Z; Discord client initialized at2026-06-30T07:22:14.450Z. - The message is visible through Discord REST afterwards, but the corresponding OpenClaw session did not update and no visible bot reply followed.
From a separate same-window thread:
- A direct-mention user request in an allowed
#travelthread was posted at2026-06-30T07:21:12.993Z. - OpenClaw started the correct Discord group session at
2026-06-30T07:21:15Z. - Restart recovery resumed that same session at
2026-06-30T07:22:13Z. - The session ended successfully around
2026-06-30T07:25:22Z. - The requested work was completed locally.
- Session JSONL and Docker logs contain final assistant text, but Discord REST reads of the thread and parent channel showed no visible bot reply after the user's request.
- The only Discord
messagetool action in the recovered session evidence wasread, not a send/post action.
Older Reproduction Markers
- In a Discord travel thread on 2026-06-28, the user sent a follow-up message at 09:19 CEST. The visible bot reply did not arrive until the user mentioned the bot again at 09:34 CEST. This happened during the Penny gateway restart window around
2026-06-28T07:19Zand07:22Z. - In an X private-list thread on 2026-06-28, gateway restart recovery resumed an interrupted session twice. Local logs/transcripts show model completion, but the visible Discord final reply was not found in the thread.
- In Health on 2026-06-28, restart recovery failed with
transcript tail is not resumable, and the user had to resend.
What Was Ruled Out
- Penny was not OOM-killed in the current lifecycle.
- Docker storage is not near exhaustion.
- Discord probe reports connected/working.
- Config validation passes.
- This is not explained by
requireMentionfor the relevant channels. openclaw tasks maintenance --jsonpreview did not recover/prune the lost tasks.
Local Mitigation Tried
The installation had three heavy X-list jobs all scheduled at 05:00 and all three watchdogs at 05:30. These were staggered with native openclaw cron edit to reduce concurrent cron pressure:
- AI X: 05:00
- OpenClaw X: 05:25
- A X: 05:50
- AI watchdog: 06:35
- OpenClaw watchdog: 07:00
- A watchdog: 07:25
This is only mitigation. It does not prove the restart/recovery delivery issue is fixed.
Local Detection Added
The host-side reliability monitor was hardened so this does not require full manual forensics every time:
discord-startup-readiness-gap: reports the interval between container/gateway start and Discord client initialization.task-audit-delivery_failed: turns nonzeroopenclaw statustask-audit counts into warnings.recovered-discord-final-delivery-unverified: inspects recent Discord group session evidence and warns when a recovered session ended successfully with final assistant text but no Discord message-send action in the session evidence.
On 2026-06-30, this caught the known incident:
- Discord client initialized 11.3s after Penny container start.
- Penny task audit still reported 1
delivery_failed. - The recovered travel-thread session ended successfully with final assistant text, but session evidence contained only Discord
readactions.
Requested Guidance
Please confirm whether this matches known 2026.6.x Discord restart/recovery issues, especially:
- Final reply completion without visible Discord delivery.
- Pending delivery stuck at
send_attempt_started. - Inbound Discord events during gateway restart/reconnect not producing timely turns.
- Lost cron/recovery tasks with
backing session missing. - Whether
gateway restart --safeorgateway.reload.deferralTimeoutMsshould be configured differently in Docker-based installs. - Whether Discord events posted after gateway process start but before Discord client readiness are expected to be replayed or intentionally dropped.
- What native diagnostic should prove whether automatic final delivery was attempted, skipped, or failed after a recovered session ends successfully.
Possibly Related Existing Issues
- Define durable final fallback delivery semantics across channels #87561: durable final fallback delivery semantics across channels.
- [Bug]: Discord component interactions stall 6–12 min in gateway delivery pipeline (send_attempt_started stuck) #95548: Discord
send_attempt_starteddelivery pipeline stalls.
Local redacted bundle available with command outputs and focused logs.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 30, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
The broad 2026.6.10 report has been overtaken by shipped restart, Discord reconnect, delivery, and task-recovery work; the meaningful remaining pre-readiness inbound-loss behavior is already tracked by the open canonical catch-up issue.
Root-cause cluster
Relationship:
duplicateCanonical: #55792
Summary: The remaining observable pre-readiness inbound loss is already owned by the open catch-up issue; other reported symptoms are shipped or separately owned delivery-contract work.
Members:
canonical: [Feature]: Catch up on missed inbound messages after gateway restart #55792 - Directly tracks messages missed while the gateway or channel provider is unavailable before event admission.partial_overlap: Define durable final fallback delivery semantics across channels #87561 - Owns explicit durable final-delivery and failure semantics after a turn has produced visible output.adjacent_distinct: [Bug]: Discord component interactions stall 6–12 min in gateway delivery pipeline (send_attempt_started stuck) #95548 - Shares send_attempt_started diagnostics but reports component-interaction latency rather than the restart readiness gap.partial_overlap: fix(discord): recover from failed gateway resumes #103596 - Merged and shipped a related Discord reconnect failure repair but does not implement platform-history catch-up.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Canonical path: Keep the shipped durable recovery and Discord reconnect paths, resolve bounded missed-inbound catch-up in #55792, and resolve final visible-delivery outcomes in #87561.
So I’m closing this here and keeping the remaining discussion on #55792 and #87561.
Review details
Best possible solution:
Keep the shipped durable recovery and Discord reconnect paths, resolve bounded missed-inbound catch-up in #55792, and resolve final visible-delivery outcomes in #87561.
Do we have a high-confidence way to reproduce the issue?
No, there is no high-confidence live reproduction against current main in this review. The source contract still identifies the never-admitted readiness window, while the report provides strong historical 2026.6.10 evidence and the canonical catch-up issue describes the same observable path.
Is this the best way to solve the issue?
Yes. Closing this broad mixed report while preserving its evidence through the focused canonical inbound and final-delivery issues is narrower and more maintainable than keeping a third overlapping recovery tracker.
Security review:
Security review: This is issue triage without a proposed patch or security-sensitive report.
AGENTS.md: found and applied where relevant.
What I checked:
docs/gateway/restart-recovery.md. (docs/gateway/restart-recovery.md:76, ccb251c570be)docs/gateway/restart-recovery.md. (docs/gateway/restart-recovery.md:123, ccb251c570be)extensions/discord/src/internal/gateway.ts, abbd5ae3ea73)CHANGELOG.md, 2d2ddc43d0dc)Likely related people:
extensions/discord/src/internal/gateway.ts,extensions/discord/src/internal/gateway.test.ts,extensions/discord/src/monitor/provider.lifecycle.test.ts)src/infra/outbound,src/gateway)src/gateway,src/infra/outbound,extensions/discord)Codex review notes: model internal, reasoning high; reviewed against ccb251c570be.
openclaw-barnacle commentedon Jul 15, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
m13v commentedon Jul 16, 2026
the config check and the discord probe both verify what the install declares, and both come back green. what decides whether the turn lands is adapter state during the readiness window, and a probe that only runs once the client is up can't see the gap it just skipped.