Skip to content

Slack: Auto-fetch thread context on inbound thread replies #12586

@johnx25bd

Description

@johnx25bd

Problem

When a user replies in a Slack thread, the agent only receives the individual message — not the thread context. This means the agent has no idea what the thread is about unless it manually calls message read with the thread ID.

Expected Behavior

When receiving a message that's part of a thread (thread_ts is set and different from ts), automatically fetch recent thread history and include it in the prompt context.

Suggested Implementation

New config option: channels.slack.threadContext (or similar)

{
  channels: {
    slack: {
      threadContext: {
        enabled: true,
        limit: 10  // max messages to fetch from thread
      }
    }
  }
}

When enabled:

  1. On inbound thread reply, detect thread_ts != ts
  2. Fetch recent thread messages via conversations.replies
  3. Include them in the prompt context (similar to how historyLimit works for channel history)

This would make thread-based conversations work naturally without requiring the agent to manually read the thread every time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions