Repository navigation
Closed as not planned
Closed as not planned
Copy link
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.Thin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Summary
After a Slack bot token rotation (edited in panel/config and persisted to ~/.openclaw/openclaw.json), the running Slack provider does not reliably reload the new token. The cached token in @slack/bolt's singleAuthorization keeps returning the old value, so every inbound event fails auth.test with invalid_auth. Symptom looks like "Slack integration broken" — messages stop routing — even though the new token on disk is valid.
Environment
- OpenClaw 2026.5.6 (downstream managed instance, single container)
- Channel: Slack (Bolt)
Repro
- Running gateway with a working Slack channel.
- Edit
channels.slack.botTokenin~/.openclaw/openclaw.json(or via panel "save Slack config") to a freshly rotated token. - Observe gateway logs around the edit timestamp.
Expected
[gateway/channels] restarting slack channel fires within the inotify debounce window, the App instance is rebuilt with the new token, and auth.test succeeds on the next inbound event.
Actual
- Earlier edits in the same session (e.g. 14:34, 14:54 UTC on 2026-05-10) did trigger the restart line.
- A later edit (15:35 UTC, same file, same key) did not trigger any restart line — the old token stayed cached in memory.
- All inbound events from then on hit
invalid_authagainstauth.test, even though a directauth.testagainst the on-disk token succeeded. - Workaround:
docker restart <container>. After restart, Slack reconnected clean and stayed healthy.
Suspected cause
@slack/boltsingleAuthorizationcachesauthorization.botTokenperAppinstance. The provider reuses the existingApprather than tearing it down and rebuilding when only the bot token changes.- The inotify-based config watcher /
config.patchpath appears to debounce or skip the restart for some edit shapes (token-only change while other fields are unchanged).
Asks (either fixes the user-visible bug)
- Reliable channel restart on token change. Gateway should always emit
[gateway/channels] restarting slack channelwhenchannels.slack.botToken(orappToken) actually changes on disk, regardless of the surrounding edit shape. - Or: the panel's "save Slack config" path should explicitly call gateway/channels restart-slack after persisting, so we don't depend on the watcher firing.
Notes / not this bug
- This is not "multiple Slack sessions" or "message routing splitting." A user-side hypothesis ("OpenClaw is creating multiple Slack sessions per user") was reported but did not match the logs. The actual symptom is a single stale
Appinstance holding a cached token. - Loosely related (different code path, already merged): fix(gateway): restart channels after secret reload #70720 fix(gateway): restart channels after secret reload — that fix targets SecretRef refresh; this issue is about plain token-string rotation in
channels.slack.botTokennot triggering a restart.
Reacted by clawsweeper
Reacted by clawsweeper
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.Thin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Activity
clawsweeper commentedon May 10, 2026
Thanks for the report. I checked current
main, but this shell is missing enough reproduction detail to verify a current bug.Close as stale insufficient information: current code covers both direct config writers and file-watcher reloads, but the remaining managed-container boundary has no current-version reproduction or diagnostic trace despite the maintainer request.
Review details
Best possible solution:
Keep the generic Gateway reload path; reopen with a current container reproduction that identifies whether the save bypassed the write listener or the watcher failed to observe the persisted file.
Do we have a high-confidence way to reproduce the issue?
No. Direct token edits were reported to restart reliably on main, while no current container or Control UI trace establishes the claimed missed boundary.
Is this the best way to solve the issue?
Unclear. The generic reload path is the right owner, but a safe further change cannot be selected without proving whether the writer notification or filesystem watcher is failing.
Security review:
Security review: This is issue triage without a proposed patch; no new security or supply-chain change was reviewed.
AGENTS.md: found and applied where relevant.
What I checked:
extensions/slack/src/channel.setup.ts:48, 306c923e3d19)src/gateway/config-reload.ts:1088, 306c923e3d19)src/gateway/server-reload-channel-restart.ts:160, 306c923e3d19)src/gateway/config-reload.test.ts:3037, 306c923e3d19)src/gateway/config-reload.ts:1107, 1eb038bd43e9)Likely related people:
src/gateway/config-reload.ts,src/gateway/server-reload-managed.ts)src/gateway/config-reload.ts,src/gateway/config-reload.test.ts)Codex review notes: model internal, reasoning high; reviewed against 306c923e3d19.
tmimmanuel commentedon May 10, 2026
@adapepper — tried to reproduce against current
main(1c1136902b); the restart path fires reliably on everychannels.slack.botTokenedit I tested. Posting the run in case the gap is environmental.Setup
mainat1c1136902b, run aspnpm openclaw gateway(embedded, port 18789, loopback) on Ubuntu 24.04 / Node 22.22, not in a container~/.openclaw/openclaw.jsonwith Slack channel attachedos.rename) under inotify; backup taken before, restored afterStatic analysis — wiring looks correct on main
extensions/slack/src/shared.ts:124andchannel.setup.ts:73declarereload: { configPrefixes: ["channels.slack"] }src/gateway/config-reload-plan.ts:152-160lifts that prefix into arestart-channel:slackrulechannels.slack.*(includingchannels.slack.botToken) populatesplan.restartChannelssrc/gateway/server-reload-handlers.ts:367logsrestarting slack channeland rebuilds the channelSo in theory a
botTokenchange must land inrestartChannels.Live test — 14 edits, 11 restarts (matches expected coalescing)
Sequential edits with varying gaps (3-10 s):
Debounce edge — 5 burst edits 200 ms apart:
Solo follow-up after burst: 1 edit → 1 restart (watcher still alive).
Total: 14 edits → 11 restart events, matching expected debounce. No misses.
Possible reasons your environment hits it and mine doesn't
sandpaw-go-yardis a managed container; this is a strong candidate.config.patchRPC (rather than a direct file write), the gateway compares the resulting on-disk hash against itsinitialInternalWriteHashto suppress reload-plan execution on writes it triggered itself. If the panel write is being mis-attributed to an internal write, the watcher would see the change but the reload would noop. Worth checking via the panel's network tab whether it callsconfig.patchor writes the file directly.openclaw-barnacle commentedon Jun 1, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
3 remaining items
steipete commentedon Jul 6, 2026
Current
mainstill declareschannels.slackas a channel-restart prefix, and the Gateway rebuilds the Slack provider when anychannels.slack.*path changes. A contributor exercised 14 direct token edits on currentmain; every non-coalesced edit produced the expected restart. That leaves the reported Control UI/container write path as the unproven boundary, not Bolt's per-App authorization cache.Please add one current-main or newest-release container reproduction with:
config.patch, or direct file replacement;restarting slack channelappears;If the watcher reports healthy but misses the write, we can harden the watcher. If the Control UI/config RPC persists successfully without scheduling reload, we can fix that control-plane path. The existing evidence does not yet choose between them.
vincentkoc commentedon Aug 12, 2026
Closing this as stale / not planned on the evidence currently available.
Current
maindoes not rely solely on the container filesystem watcher for Control UI writes: channel Save usesconfig.set, targeted config edits useconfig.patch, and both go through the canonical config writer, which emits an in-process config-write notification. Anychannels.slack.*change plans a Slack channel restart. That restart stops and starts the channel, resolving the latest token and constructing a fresh BoltAppand receiver. Bolt's per-Appauthorization closure captures the token, so replacing theAppis the correct cache boundary.The adjacent watcher/reload failure classes have also been repaired:
All three fixes are contained in
v2026.7.2-beta.7. The June watcher fallback from #92852 is also in stablev2026.7.1-2; the July recovery/coalescing fixes from #111049 and #110397 are not. This is therefore not an already-fixed closure for the reported stable/container case.The only concrete reproduction remains OpenClaw
2026.5.6in the managedsandpaw-go-yardcontainer. No current container reproduction or the evidence requested on July 6 was added: exact save path (config.set/config.patch/ direct replacement), watcher health before and after the save, logs through five seconds after it, an unrelated-edit control, mount/filesystem type, and whether the save replaces the inode. Without that boundary evidence, there is no specific current defect we can safely repair.Please open a fresh report if this reproduces on a current release, with those exact details. That would let us distinguish a control-plane write notification failure from a bind-mount/inode watcher failure.