Skip to content

improvement(search): page Slack Real-time Search to fill a Slack-scoped search's limit - #9590

Merged
waleedlatif1 merged 2 commits into
stagingfrom
improvement/slack-search-pagination
Nov 3, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
improvement/slack-search-pagination

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Slack Real-time Search (assistant.search.context) returns at most 20 results per call. A Slack-scoped search (source slack or a native Slack query) asking for more, e.g. topK: 50, returned one page and a cursor the caller rarely followed
  • A Slack-scoped or native Slack search now follows the cursor until it fills its limit, capped at 3 pages (Slack allows a member ~10 RTS calls a minute and counts every page). A full first page that fills the limit makes no extra call
  • A search across every source still reads exactly one Slack page, so federated searches make the same Slack calls as before
  • Paging stops when Slack returns no cursor or the limit is filled (files count toward it); a later page that fails for any reason (rate limit, network error) keeps the earlier pages, marks the account partial, and returns the unread cursor; a first-page failure behaves as before
  • Matches the pattern other federated Slack search tools use: go wide across queries for relevance searches, page only when the caller asked for more

Type of Change

  • Improvement

Testing

  • New Slack RTS pages cases in providers.test.ts, one per failure mode: native and source-scoped paging, one page for federated searches, stop on no cursor, 3-page cap, file-filled limit, later-page failure keeps earlier pages, first-page failure still throws, non-Slack later-page error, caller cancellation, short pages with a cursor. Removing each guard (targeting, cap, cursor stop, limit stop, later-page catch, abort) turns its test red
  • lib/sim-search/live/ suite: 34 files, 364 tests pass
  • Checked recorded benchmark responses: of 136 Slack-scoped searches, the 3 that got a Slack cursor already returned a full page that filled the limit, and short pages never carried a cursor, so none would make an extra call; federated searches are unaffected by construction
  • biome, check:comment-hygiene, check:test-patterns, check:utils; full audits and type-check run in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 3, 2026 12:37am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both earlier findings are fixed and no new actionable issues remain.

Summary

Adds bounded paging for Slack-scoped and native Slack searches. Searches across all sources still read one Slack page.

  • Slack-focused searches fetch more Slack results, up to a three-page cap.

Reviews (2) · Last reviewed commit: "fix(search): keep earlier Slack pages on..." · Reviewed by Greptile

Comment thread apps/sim/lib/sim-search/live/slack.ts Resolved
Comment thread apps/sim/lib/sim-search/live/slack.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/slack.ts Resolved
Comment thread apps/sim/lib/sim-search/live/slack.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e53bf39 into staging Nov 3, 2026
52 checks passed
@waleedlatif1
waleedlatif1 deleted the improvement/slack-search-pagination branch November 3, 2026 00:41

This branch was previously deployed

1 inactive deployment
Preview — a48e63e4 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant