fix(slack): use SLACK_USER_TOKEN when connecting to Slack (#28103)

* fix(slack): use SLACK_USER_TOKEN when connecting to Slack (closes #26480)

* test(slack): fix account fixture typing for user token source

---------

Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
Glucksberg
2026-03-01 13:05:35 -04:00
committed by GitHub
parent 46da76e267
commit 6dbbc58a8d
12 changed files with 27 additions and 13 deletions

View File

@@ -90,6 +90,7 @@ describe("channelsCapabilitiesCommand", () => {
account: {
accountId: "default",
botToken: "xoxb-bot",
userToken: "xoxp-user",
config: { userToken: "xoxp-user" },
},
probe: { ok: true, bot: { name: "openclaw" }, team: { name: "team" } },

View File

@@ -381,9 +381,7 @@ async function resolveChannelReports(params: {
let slackScopes: ChannelCapabilitiesReport["slackScopes"];
if (plugin.id === "slack" && configured && enabled) {
const botToken = (resolvedAccount as { botToken?: string }).botToken?.trim();
const userToken = (
resolvedAccount as { config?: { userToken?: string } }
).config?.userToken?.trim();
const userToken = (resolvedAccount as { userToken?: string }).userToken?.trim();
const scopeReports: NonNullable<ChannelCapabilitiesReport["slackScopes"]> = [];
if (botToken) {
scopeReports.push({