Skip to content

[Bug]: Cron isolated jobs fail Discord delivery with "SecretRefs not resolved against runtime snapshot" after v2026.5.22 #86545

@SagesOfRPG

Description

@SagesOfRPG

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading to OpenClaw v2026.5.22, cron jobs using sessionTarget: "isolated" with Discord delivery.mode: "announce" fail with the error:

OutboundDeliveryError: Discord bot token configured for account "default" is unavailable; resolve SecretRefs against the active runtime snapshot before using this account.

Steps to reproduce

1 Configure Discord token via systemd Environment=DISCORD_BOT_TOKEN=... (NOT in EnvironmentFile)
2Create a cron job with:
sessionTarget: "isolated"
delivery.mode: "announce" to Discord channel
3 Wait for job to execute or trigger manually
4 Job fails with SecretRefs resolution error

Expected behavior

Cron isolated jobs should inherit or resolve SecretRefs the same way as session:xxx targeted jobs.

Actual behavior

  • Jobs with sessionTarget: "isolated" fail Discord delivery
  • Jobs with sessionTarget: "session:..." work correctly
  • Background jobs without Discord delivery work correctly

OpenClaw version

2026.5.22

Operating system

Linux (Ubuntu, kernel 6.17.0-23-generic) ubunu 24.4

Install method

No response

Model

ollama/kimi-k2.5:cloud

Provider / routing chain

Channel: Discord Delivery mode: announce Target: channel:<channel_id> Session target: isolated (fails) vs session:... (works)

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Root Cause Analysis:
The new "runtime snapshot" for SecretRefs introduced in v2026.5.22 is not being shared with isolated cron sessions. Tokens set only via systemd Environment= (vs EnvironmentFile) appear unavailable to the isolated job context.

Workaround:
Move DISCORD_BOT_TOKEN from systemd Environment= directive into the EnvironmentFile (e.g., ~/.openclaw/gateway.systemd.env), then reload systemd and restart gateway.

Suggested Fix:
Ensure isolated cron sessions can resolve SecretRefs from the same sources as the main gateway process, or document that tokens must be in EnvironmentFile for cron compatibility.

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.regressionBehavior that previously worked and now fails

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