Skip to content

fix(search): read the full text of Slack canvases and files instead of the preview - #10082

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/slack-file-read
Nov 16, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/slack-file-read

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Reading a Slack file returned only Slack's short preview (or just the title), while search returned the file's text, so a model that found the right canvas or doc got almost nothing when it opened it
  • Slack file reads now download the full text from Slack's file host: canvases as HTML (converted to text), snippets and text files as text, PDF and DOCX through the same extraction Drive uses
  • The token only goes to files.slack.com, never a remote file's own URL; the client's sibling-host option (previously Sheets-only) now covers both, each locked to its own provider origin
  • Text decodes strictly in its byte-order mark or declared charset (UTF-8 otherwise); bytes that do not decode keep the preview
  • Bounded: per-format download caps, 1 MiB of extracted text, and a 5s download limit so a slow file host can't use up the read deadline
  • Anything short of a caller abort (denial, redirect, size limit, unreadable bytes, timeout) keeps today's preview, plus the provider's reason when it gave one, and records a slack.file_preview diagnostic signal on every read that returns the preview
  • PDF/DOCX extraction moved from drive-content.ts into shared file-text.ts; Drive behavior is unchanged
  • No new Slack scopes: downloads use the existing files:read grant

Type of Change

  • Bug fix

Testing

  • New slack.test.ts: canvas, text, PDF full-text reads; token never leaves Slack's file host (foreign host, http:, external file); preview + reason on denial, redirect, timeout; caller abort propagates; oversize and unsupported files skip the download; MIME parameters/case normalized. Each guard reverted and watched go red.
  • http.test.ts: sibling hosts only reachable from their own provider origin
  • lib/sim-search/live + lib/knowledge/search suites pass; biome; egress-boundary, organization-egress, boundaries, comment-hygiene, file-names, explicit-any, utils, test-patterns, import-specifiers, source-text audits pass

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 16, 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 16, 2026 5:46am UTC

Request Review

@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 11 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

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues were found.

Summary

Slack file reads now return full text for supported Slack-hosted files, with bounded downloads and a preview fallback.

  • Slack file reads return full text for supported canvases and documents.

Reviews (3) · Last reviewed commit: "fix(search): let a UTF-8 byte-order mark..." · 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
@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 16, 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.

All reported issues were addressed across 11 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
@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 16, 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 11 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 f584949 into staging Nov 16, 2026
81 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/slack-file-read branch November 16, 2026 06:07

This branch was previously deployed

1 inactive deployment
Preview — 95a9eadb Deployed Nov 16, 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