Summary
channels.discord.token is configured as a SecretRef pointing to a valid filemain provider key. openclaw secrets audit reports 0 unresolved. But at runtime, Discord channel operations fail with channels.discord.token: unresolved SecretRef "file:filemain:/DISCORD_BOT_TOKEN".
This is a regression/fragility in how the Discord extension resolves the token at runtime vs how the CLI audit resolves it.
Environment
- OpenClaw: 2026.4.29 (a448042)
- OS: Linux 6.8.0 (Ubuntu/Debian)
- Install: npm global
- secrets.json mode: json (filemain provider)
Config
"channels": {
"discord": {
"enabled": true,
"token": {
"source": "file",
"provider": "filemain",
"id": "/DISCORD_BOT_TOKEN"
}
}
}
"secrets": {
"providers": {
"filemain": { "source": "file", "path": "/path/to/secrets.json", "mode": "json" }
}
}
secrets.json top-level key DISCORD_BOT_TOKEN exists and is valid.
Steps to reproduce
- Configure
channels.discord.token as a filemain SecretRef ("id": "/DISCORD_BOT_TOKEN")
- Confirm
openclaw secrets audit reports 0 unresolved
- Restart the gateway
- Attempt any Discord message action (e.g.
openclaw message send, or inbound Discord message)
- Observe:
channels.discord.token: unresolved SecretRef "file:filemain:/DISCORD_BOT_TOKEN"
Expected vs Actual
- Expected: Discord token resolves at gateway startup (as
secrets audit confirms), runtime usage works
- Actual: Gateway starts clean, Discord operations fail at runtime with unresolved SecretRef
Stack trace
Error: channels.discord.token: unresolved SecretRef "file:filemain:/DISCORD_BOT_TOKEN". Resolve this command against an active gateway runtime snapshot before reading it.
at createUnresolvedSecretInputError (types.secrets-BHp0Y_k0.js:68:25)
at resolveSecretInputString (types.secrets-BHp0Y_k0.js:99:52)
at normalizeResolvedSecretInputString (types.secrets-BHp0Y_k0.js:110:19)
at normalizeDiscordToken (token-D-w3Rigl.js:5:18)
at resolveDiscordToken (token-D-w3Rigl.js:26:22)
at resolveDiscordAccount (accounts-BKnkNaoA.js:54:26)
at resolveScopedDiscordActionDiscovery (channel-actions-8bJreMW_.js:22:18)
at Object.describeDiscordMessageTool [as describeMessageTool] (channel-actions-8bJreMW_.js:34:20)
at Object.describeMessageTool (channel-CMeIg_K8.js:306:146)
at describeMessageToolSafely (message-action-discovery-CW9J9hh5.js:60:17)
Root cause hypothesis
The describeMessageTool code path calls loadConfig() which re-reads the raw config from disk. The raw config has the unresolved SecretRef object. The already-resolved in-memory token is discarded. This is the same root cause as issue #33573 but in a different code path (describeMessageTool instead of sendMessage).
Impact
- Gateway starts successfully and
secrets audit is clean
- But Discord channel is non-functional at runtime
- Workaround: keep Discord token as plaintext (not a SecretRef)
Related issues
openclaw --version
OpenClaw 2026.4.29 (a448042)
Summary
channels.discord.tokenis configured as a SecretRef pointing to a validfilemainprovider key.openclaw secrets auditreports 0 unresolved. But at runtime, Discord channel operations fail withchannels.discord.token: unresolved SecretRef "file:filemain:/DISCORD_BOT_TOKEN".This is a regression/fragility in how the Discord extension resolves the token at runtime vs how the CLI audit resolves it.
Environment
Config
secrets.json top-level key
DISCORD_BOT_TOKENexists and is valid.Steps to reproduce
channels.discord.tokenas a filemain SecretRef ("id": "/DISCORD_BOT_TOKEN")openclaw secrets auditreports 0 unresolvedopenclaw message send, or inbound Discord message)channels.discord.token: unresolved SecretRef "file:filemain:/DISCORD_BOT_TOKEN"Expected vs Actual
secrets auditconfirms), runtime usage worksStack trace
Root cause hypothesis
The
describeMessageToolcode path callsloadConfig()which re-reads the raw config from disk. The raw config has the unresolvedSecretRefobject. The already-resolved in-memory token is discarded. This is the same root cause as issue #33573 but in a different code path (describeMessageToolinstead ofsendMessage).Impact
secrets auditis cleanRelated issues
openclaw message sendfails with unresolved SecretRef for Discord channel token #33573 — same root cause forsendMessagepath (closed, fix was for send path only)openclaw --version