openclaw - 💡(How to fix) Fix Bug: Slack outbound reply fails to resolve SecretRef (exec provider) — "unresolved SecretRef" on final reply [1 comments, 2 participants]

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…
GitHub stats
openclaw/openclaw#69820Fetched 2026-04-22 07:47:57
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

When Slack is configured with an exec-provider SecretRef for botToken and appToken, inbound messages are received and processed correctly, but the outbound reply fails with:

[slack] final reply failed: Error: channels.slack.accounts.default.botToken: unresolved SecretRef "exec:keychain_slack_bot:value". Resolve this command against an active gateway runtime snapshot before reading it.

The socket connects, the agent runs, and the LLM produces a response — but the reply is never delivered to Slack.

Error Message

[slack] final reply failed: Error: channels.slack.accounts.default.botToken: unresolved SecretRef "exec:keychain_slack_bot:value". Resolve this command against an active gateway runtime snapshot before reading it.

Root Cause

When Slack is configured with an exec-provider SecretRef for botToken and appToken, inbound messages are received and processed correctly, but the outbound reply fails with:

[slack] final reply failed: Error: channels.slack.accounts.default.botToken: unresolved SecretRef "exec:keychain_slack_bot:value". Resolve this command against an active gateway runtime snapshot before reading it.

The socket connects, the agent runs, and the LLM produces a response — but the reply is never delivered to Slack.

Fix Action

Fix / Workaround

  • The error references channels.slack.accounts.default.botToken even though no accounts.default exists in the config — OpenClaw appears to internally normalize the top-level Slack config into an accounts.default structure, but the resolved SecretRef is not carried through to the outbound send path.
  • Telegram uses the same exec SecretRef pattern for botToken and works correctly — so the SecretRef provider itself is working.
  • Workaround: Inlining the token as plaintext in the config (insecure but functional).
  • The bug has been present since at least 2026-03-08 based on log history (first occurrence: Telegram, resolved differently there; Slack broken consistently since ~2026-04-03).

Code Example

[slack] final reply failed: Error: channels.slack.accounts.default.botToken: unresolved SecretRef "exec:keychain_slack_bot:value". Resolve this command against an active gateway runtime snapshot before reading it.

---

{
  "channels": {
    "slack": {
      "mode": "socket",
      "botToken": {
        "source": "exec",
        "provider": "keychain_slack_bot",
        "id": "value"
      },
      "appToken": {
        "source": "exec",
        "provider": "keychain_slack_app",
        "id": "value"
      }
    }
  },
  "secrets": {
    "providers": {
      "keychain_slack_bot": {
        "source": "exec",
        "command": "/path/to/keychain-slack-bot"
      },
      "keychain_slack_app": {
        "source": "exec",
        "command": "/path/to/keychain-slack-app"
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

When Slack is configured with an exec-provider SecretRef for botToken and appToken, inbound messages are received and processed correctly, but the outbound reply fails with:

[slack] final reply failed: Error: channels.slack.accounts.default.botToken: unresolved SecretRef "exec:keychain_slack_bot:value". Resolve this command against an active gateway runtime snapshot before reading it.

The socket connects, the agent runs, and the LLM produces a response — but the reply is never delivered to Slack.

Config (redacted)

{
  "channels": {
    "slack": {
      "mode": "socket",
      "botToken": {
        "source": "exec",
        "provider": "keychain_slack_bot",
        "id": "value"
      },
      "appToken": {
        "source": "exec",
        "provider": "keychain_slack_app",
        "id": "value"
      }
    }
  },
  "secrets": {
    "providers": {
      "keychain_slack_bot": {
        "source": "exec",
        "command": "/path/to/keychain-slack-bot"
      },
      "keychain_slack_app": {
        "source": "exec",
        "command": "/path/to/keychain-slack-app"
      }
    }
  }
}

The keychain scripts resolve correctly when run directly (tested).

Behavior

  • Startup: Socket Mode connects fine. channel resolve and user resolve fail with missing_scope (unrelated noise), but socket connects.
  • Inbound: Messages from Slack arrive and trigger the agent session (agent:main:slack:channel:...)
  • LLM: Agent runs successfully, model produces a reply
  • Outbound (broken): [slack] final reply failed: ... unresolved SecretRef

Additional observations

  • The error references channels.slack.accounts.default.botToken even though no accounts.default exists in the config — OpenClaw appears to internally normalize the top-level Slack config into an accounts.default structure, but the resolved SecretRef is not carried through to the outbound send path.
  • Telegram uses the same exec SecretRef pattern for botToken and works correctly — so the SecretRef provider itself is working.
  • Workaround: Inlining the token as plaintext in the config (insecure but functional).
  • The bug has been present since at least 2026-03-08 based on log history (first occurrence: Telegram, resolved differently there; Slack broken consistently since ~2026-04-03).

Steps to reproduce

  1. Configure channels.slack.botToken and channels.slack.appToken as exec-provider SecretRefs
  2. Configure matching secrets.providers entries with shell scripts that return the tokens
  3. Start gateway — Socket Mode connects
  4. Send a message in a Slack channel the bot is in
  5. Observe: agent runs, reply is never sent, error in gateway.err.log

Environment

  • OpenClaw: 2026.4.15 (041266a)
  • OS: macOS 26.4.1 (arm64)
  • Slack channel mode: Socket Mode

extent analysis

TL;DR

The most likely fix is to modify the OpenClaw configuration to properly handle the resolved SecretRef for the botToken in the outbound send path.

Guidance

  • Verify that the exec-provider SecretRef is correctly resolving the botToken by checking the output of the shell script /path/to/keychain-slack-bot directly.
  • Check the OpenClaw documentation to see if there are any specific requirements or limitations for using exec-provider SecretRefs in the channels.slack configuration.
  • Consider modifying the configuration to use a different SecretRef provider or inlining the token as plaintext (although this is insecure) to isolate the issue.
  • Review the OpenClaw code to understand how the accounts.default structure is being internally normalized and how the resolved SecretRef is being handled in the outbound send path.

Example

No code snippet is provided as the issue seems to be related to the OpenClaw configuration and internal handling of SecretRefs.

Notes

The issue appears to be specific to the OpenClaw configuration and handling of SecretRefs, and may require modifications to the configuration or the OpenClaw code itself to resolve.

Recommendation

Apply a workaround by inlining the token as plaintext in the config (insecure but functional) until a proper fix can be implemented, as the bug has been present for an extended period and a fix may require updates to the OpenClaw code.

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 Bug: Slack outbound reply fails to resolve SecretRef (exec provider) — "unresolved SecretRef" on final reply [1 comments, 2 participants]