Skip to content

fix(slack): enable session-store lookup for announce target accountId#14912

Closed
mcaxtr wants to merge 1 commit intoopenclaw:mainfrom
mcaxtr:fix/14854-announce-accountid
Closed

fix(slack): enable session-store lookup for announce target accountId#14912
mcaxtr wants to merge 1 commit intoopenclaw:mainfrom
mcaxtr:fix/14854-announce-accountid

Conversation

@mcaxtr
Copy link
Contributor

@mcaxtr mcaxtr commented Feb 12, 2026

Summary

  • Problem: In multi-account Slack setups, sessions_send announce replies use the default bot token instead of the target agent's token because resolveAnnounceTarget() returns the key-parsed fallback (no accountId) for Slack
  • Why it matters: Messages appear under the wrong bot identity, breaking multi-agent setups
  • What changed: Added preferSessionLookupForAnnounceTarget: true to Slack channel plugin meta, matching the existing WhatsApp pattern
  • What did NOT change (scope boundary): No changes to resolveAnnounceTarget() logic or any other channel plugin

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

User-visible / Behavior Changes

In multi-account Slack setups, sessions_send announce replies now post using the correct bot token for the target agent's Slack account instead of always using the default account's token.

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: All
  • Runtime/container: Any
  • Model/provider: N/A
  • Integration/channel (if any): Slack (multi-account)
  • Relevant config (redacted): Two Slack accounts with separate bot tokens

Steps

  1. Configure two Slack accounts (default + secondary) with separate bot tokens
  2. Agent A (default account) sends a message to Agent B (secondary account) via sessions_send
  3. Agent B's announce reply posts to the channel

Expected

  • Reply is posted using Agent B's bot token

Actual

  • Reply is posted using Agent A's (default) bot token

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

New test in src/agents/tools/sessions.test.ts verifies resolveAnnounceTarget() hydrates accountId from sessions.list for Slack sessions. Test fails without the flag.

Human Verification (required)

  • Verified scenarios: New test confirms session-store lookup path is triggered for Slack
  • Edge cases checked: Single-account setups unaffected (accountId absence is harmless when only one account exists)
  • What you did not verify: Live multi-account Slack environment

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Failure Recovery (if this breaks)

  • How to disable/revert this change quickly: Remove preferSessionLookupForAnnounceTarget: true from extensions/slack/src/channel.ts
  • Files/config to restore: extensions/slack/src/channel.ts
  • Known bad symptoms reviewers should watch for: Announce messages failing or timing out due to session-store lookup errors

Risks and Mitigations

  • Risk: Session-store lookup adds a sessions.list call to the announce path for Slack
    • Mitigation: WhatsApp has used this exact path since the feature was introduced with no reported issues

@openclaw-barnacle openclaw-barnacle bot added channel: slack Channel integration: slack agents Agent runtime and tooling size: S labels Feb 12, 2026
@mcaxtr
Copy link
Contributor Author

mcaxtr commented Feb 12, 2026

@greptile please re-review this PR.

@mcaxtr mcaxtr force-pushed the fix/14854-announce-accountid branch 2 times, most recently from 4874cbe to 4bdd0f6 Compare February 13, 2026 14:44
@mcaxtr mcaxtr force-pushed the fix/14854-announce-accountid branch 8 times, most recently from d66e4eb to dc739cf Compare February 15, 2026 15:01
@mcaxtr mcaxtr force-pushed the fix/14854-announce-accountid branch 4 times, most recently from 268d1e6 to 12da9db Compare February 22, 2026 23:19
@mcaxtr mcaxtr force-pushed the fix/14854-announce-accountid branch 2 times, most recently from 0e0f56d to 5df3b5f Compare February 28, 2026 03:20
@mcaxtr mcaxtr force-pushed the fix/14854-announce-accountid branch from 5df3b5f to d354f04 Compare March 3, 2026 03:44
@aisle-research-bot
Copy link

aisle-research-bot bot commented Mar 3, 2026

🤖 We're reviewing this PR with Aisle

We're running a security check on the changes in this PR now. This usually takes a few minutes. ⌛
We'll post the results here as soon as they're ready.

Progress:

  • Analysis
  • Triage
  • Finalization

Latest run failed. Keeping previous successful results. Trace ID: 019cb1cc7ca0889d4bdb94e611be55e8.

Last updated on: 2026-03-03T03:45:19Z

@openclaw-barnacle openclaw-barnacle bot removed the channel: slack Channel integration: slack label Mar 3, 2026
@mcaxtr mcaxtr closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: sessions_send announce uses wrong Slack accountId in multi-account setups

1 participant