-
Notifications
You must be signed in to change notification settings - Fork 2.5k
add slack thread reader tool #1967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@sudhanshug16 is attempting to deploy a commit to the Sim Team on Vercel. A member of the Team first needs to authorize it. |
Greptile OverviewGreptile SummaryThis PR adds a new Slack thread reader tool that fetches complete thread context when a Slack bot is mentioned in a thread. The implementation introduces the The changes include: creating the core tool implementation ( Important Files Changed
Confidence score: 3/5
Sequence DiagramsequenceDiagram
participant User
participant SlackBlock
participant SlackThreadReaderTool
participant SlackAPI
User->>SlackBlock: "Configure thread reader with channel and thread_ts"
SlackBlock->>SlackBlock: "Validate authentication method (OAuth/Bot Token)"
SlackBlock->>SlackBlock: "Set operation to 'read_thread'"
SlackBlock->>SlackThreadReaderTool: "Execute with parameters"
SlackThreadReaderTool->>SlackThreadReaderTool: "Build URL with channel, thread_ts, limit, cursor"
SlackThreadReaderTool->>SlackAPI: "GET /api/conversations.replies"
SlackAPI-->>SlackThreadReaderTool: "Return thread messages (root + replies)"
SlackThreadReaderTool->>SlackThreadReaderTool: "Transform response: map messages with ts, text, user, files"
SlackThreadReaderTool->>SlackThreadReaderTool: "Extract pagination info (has_more, next_cursor)"
SlackThreadReaderTool-->>SlackBlock: "Return thread data with messages array"
SlackBlock-->>User: "Provide thread_ts, messages, has_more, next_cursor"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11 files reviewed, 1 comment
| const limit = params.limit ? Number(params.limit) : 20 | ||
| url.searchParams.append('limit', String(Math.min(limit, 15))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Inconsistent limit handling - parameter description says max: 100 but implementation caps at 15
| const limit = params.limit ? Number(params.limit) : 20 | |
| url.searchParams.append('limit', String(Math.min(limit, 15))) | |
| const limit = params.limit ? Number(params.limit) : 20 | |
| url.searchParams.append('limit', String(Math.min(limit, 100))) |
Should the maximum limit be 100 as documented or 15 as implemented?
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/sim/tools/slack/thread_reader.ts
Line: 82:83
Comment:
**logic:** Inconsistent limit handling - parameter description says max: 100 but implementation caps at 15
```suggestion
const limit = params.limit ? Number(params.limit) : 20
url.searchParams.append('limit', String(Math.min(limit, 100)))
```
Should the maximum limit be 100 as documented or 15 as implemented?
How can I resolve this? If you propose a fix, please make it concise.
Summary
Adds a tool for slack to read a thread given the thread_ts. Useful when the slack bot is mentioned in a thread and we want the context of the thread.
Fixes #(issue)
Type of Change
Testing
Manually tested the tool using a thread in our company slack. Output showed the parent plus every reply and has_more:false, confirming the code paths and response mapping.
Checklist