Skip to content

slack-channel-monitor: search lag / @mention / thread / bot identity fixes #542

Description

@hboisgibault

Problem

The slack-channel-monitor skill silently drops trigger messages in four real scenarios. All four were observed on a production deployment polling 33 channels once per minute.

Actual Behavior

Deploy the skill and check slack_poller_debug.log, or run the poller manually:

python skills/slack-channel-monitor/scripts/main.py --debug
  1. Search index lag: search.messages results are bounded by last_poll, but Slack's search index lags the live stream by ~1-2 min. A trigger message becomes searchable only after last_poll moved past it — dropped forever.
  2. @mention triggers unsearchable: search.messages does not index the leading @ of a mention, and a quoted phrase ("openhands") does not match an @openhands mention either. With the default trigger phrase, the search path matches nothing.
  3. Thread context lost: search results carry no thread_ts, so a trigger posted as a thread reply looks like a root message and starts a fresh conversation instead of continuing the tracked one.
  4. Wrong bot identity with user token: auth.test on a user token returns the human owner, so their own messages are misclassified as bot output and skipped.

Expected Behavior

Trigger messages in a monitored channel reliably start/continue a conversation — whether posted at root level, inside a thread, detected 1-2 min after posting, or when running with a user token.

Acceptance Criteria

  • A trigger posted at root level is detected within 1-2 poll runs even though the message is brand-new (search-lag fix).
  • An @mention trigger is found by the search path (trigger term searched without the leading @).
  • A trigger posted as a thread reply continues the existing tracked conversation, not a new one (thread parent resolved via conversations.replies).
  • With SLACK_USER_TOKEN configured, the bot identity is resolved from SLACK_BOT_TOKEN and the human owner's messages are not skipped.
  • python -m py_compile skills/slack-channel-monitor/scripts/main.py passes.

Notes

This exact patch has been running in production for ~3 weeks. A PR fixing all four issues is incoming.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-devScoped for contribution; managed by repository readiness checks.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions