Skip to content

fix(slack): include team_id in thread-context cache key#12502

Closed
flobo3 wants to merge 1 commit into
NousResearch:mainfrom
flobo3:fix/slack-thread-cache-team-id
Closed

fix(slack): include team_id in thread-context cache key#12502
flobo3 wants to merge 1 commit into
NousResearch:mainfrom
flobo3:fix/slack-thread-cache-team-id

Conversation

@flobo3

@flobo3 flobo3 commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #12421

Thread context was cached under channel_id:thread_ts, but the rendered content depends on team_id for bot mention stripping and user-name resolution. In multi-workspace Slack mode, a later lookup from a different workspace could receive stale context from the first workspace.

Change

Include team_id in the cache key: f"{channel_id}:{thread_ts}:{team_id}"

team_id is already a parameter of _fetch_thread_context() with a default of "", so this is backwards-compatible — single-workspace setups will use the same cache key as before.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/slack Slack app adapter comp/gateway Gateway runner, session dispatch, delivery labels Apr 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #12889 — same root cause: thread-context cache key missing team_id in SlackAdapter._fetch_thread_context().

@teknium1

Copy link
Copy Markdown
Contributor

Merged via #16200 — your commit was cherry-picked onto current main with your authorship preserved (1003ab6). Extended the one-line fix to two lines so the new _fetch_thread_parent_text method (added as part of @Satoshi-agi's #12561) gets the same team_id-in-cache-key treatment for consistency. Closes #12421 too.
#16200

@teknium1 teknium1 closed this Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/slack Slack app adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Slack thread-context cache key ignores workspace identity

3 participants