Skip to content

slack: keep requireMention thread follow-ups when thread session is active#21108

Closed
JayElRay wants to merge 1 commit intoopenclaw:mainfrom
JayElRay:jay/slack-thread-implicit-mention-session-history
Closed

slack: keep requireMention thread follow-ups when thread session is active#21108
JayElRay wants to merge 1 commit intoopenclaw:mainfrom
JayElRay:jay/slack-thread-implicit-mention-session-history

Conversation

@JayElRay
Copy link
Copy Markdown

@JayElRay JayElRay commented Feb 19, 2026

Summary

  • fix Slack mention gating for thread follow-ups when requireMention=true
  • treat a thread reply as implicitly mentioned when either:
    • parent_user_id === botUserId (existing behavior), or
    • the thread session already exists in the session store (new behavior)
  • add regression coverage in prepare.test.ts to ensure unmentioned follow-up thread replies are accepted once the thread session is active

Why

Slack thread roots started by humans often have parent_user_id != botUserId, which can cause follow-up no-mention messages in the same active thread session to be dropped despite prior interaction.

Validation

  • corepack pnpm exec vitest run src/slack/monitor/message-handler/prepare.test.ts
    • 13 passed

Greptile Summary

Fixes Slack mention gating for thread follow-ups when requireMention=true. Previously, unmentioned thread replies from human-started threads could be dropped despite an active session. The PR adds a check for existing thread sessions (existingThreadSessionUpdatedAt) and treats replies in active thread sessions as implicitly mentioned.

  • Moves storePath resolution and existingThreadSessionUpdatedAt check earlier in the flow (before mention gating logic)
  • Updates implicitMention to include threadSessionHasHistory condition alongside existing parent_user_id === botUserId check
  • Removes redundant ctx.botUserId check from implicitMention (still implicitly required via parent_user_id check)
  • Adds regression test covering unmentioned follow-ups in active thread sessions with requireMention: true

Confidence Score: 4/5

  • Safe to merge with minimal risk - focused fix for mention gating edge case with test coverage
  • The changes are well-scoped, addressing a specific bug in thread mention gating. The logic is sound: checking for existing thread sessions prevents dropping follow-up messages in active conversations. Test coverage validates the fix. Minor concern: removing ctx.botUserId check from implicitMention could theoretically allow messages through when botUserId is undefined, but the parent_user_id === ctx.botUserId comparison already handles this safely (returns false when botUserId is undefined).
  • No files require special attention

Last reviewed commit: b124544

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added channel: slack Channel integration: slack size: S labels Feb 19, 2026
Copy link
Copy Markdown

@ucef94 ucef94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

@openclaw-barnacle
Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 28, 2026
@Takhoffman Takhoffman added the close:superseded PR close reason label Mar 1, 2026
@Takhoffman
Copy link
Copy Markdown
Contributor

Thanks for the contribution and the detailed work here.

Closing this PR for now because it is superseded by a tighter Workstream 3 path that we are landing to avoid overlapping Slack threading/session changes in parallel.

What we are keeping:

  • requireMention follow-up behavior through explicit thread participation tracking

If you want, I can cross-reference any specific test or edge case from this PR into the active salvage PRs so your coverage is preserved.

@Takhoffman Takhoffman closed this Mar 1, 2026
Copy link
Copy Markdown

@ucef94 ucef94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack close:superseded PR close reason size: S stale Marked as stale due to inactivity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants