Skip to content

[verified] fix(slack): hydrate incomplete mention attachments - #1888

Merged
elie222 merged 3 commits into
elie222:mainfrom
guilhermesan:fix/slack-app-mention-files
Oct 22, 2026
Merged

elie222 merged 3 commits into
elie222:mainfrom
guilhermesan:fix/slack-app-mention-files

Conversation

@guilhermesan

Copy link
Copy Markdown
Contributor

Summary

Fix Slack file and snippet attachments being dropped when an app_mention event arrives with incomplete file metadata.

Slack may deliver the app_mention event before the corresponding message representation contains authenticated, fetchable attachments. In that case, Rakazo receives the mention text but cannot download or expose the attached file to the agent.

Changes

  • Detect Slack app_mention events that contain file stubs but no fetchable attachments.
  • Fetch the exact message from Slack history using fetchMessage(thread.id, message.id).
  • Copy only the hydrated attachments onto the original event, preserving its mention, author, text, workspace, and routing metadata.
  • Return an HTTP 5xx response when hydration fails so Slack can retry the event.
  • Clear the Chat SDK deduplication key after a hydration failure so the retry can be processed.
  • Avoid additional Slack API calls for:
    • text-only mentions;
    • messages whose attachments are already fetchable.

Why

Without this hydration step, Slack snippets can appear in the Slack UI while Rakazo receives only the mention text. The agent then runs without the file and cannot inspect the snippet contents.

Test plan

  • Hydrates an incomplete Slack file stub using an exact-message lookup.
  • Preserves the original app_mention content and routing semantics.
  • Does not hydrate text-only mentions.
  • Does not hydrate already-fetchable attachments.
  • Returns HTTP 5xx when the attachment cannot be hydrated.
  • Adapter test suite passes: 49 tests.
  • TypeScript check passes.
  • Verified with a real Slack snippet attachment end to end.

Configuration note

The Slack app must include the files:read OAuth scope so private Slack files can be downloaded.

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@guilhermesan is attempting to deploy a commit to the Inbox Zero Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change reaches Slack’s inbound mention and file workflow.

The PR should not merge until failed attachment lookups remain retryable.

Findings

  1. P1 Slack files lose their retry ▶

Summary

Adds a Slack history lookup for mentions whose file attachments cannot yet be downloaded.

  • Slack mentions can now carry files fetched from message history.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into fix/slack-app-m..." · Reviewed by Greptile

Comment thread packages/adapters/src/chat-sdk-surface.test.ts Outdated
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Playwright screenshots

No new feature frames; gallery is suite-vs-main drift.

Open screenshot gallery · Dashboard · CI run

Updated for commit fcfa5ca.

Comment on lines +141 to +147
} catch {
// Missing scopes, deleted files, or unavailable history must not
// prevent the mention text and original file URLs from arriving.
getLogger().warn(
"Slack mention attachment hydration failed; delivering original message",
);
}

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.

P1 Slack files lose their retry

When Slack history is temporarily unavailable or still lacks the file metadata, this catch delivers the mention without a downloadable attachment. If the sink succeeds, the webhook returns 200 and keeps the deduplication key. Slack cannot retry once the file becomes available, so the bot runs without the file the user asked it to inspect.

Keep temporary hydration failures retryable by recording the failed key and returning 5xx.

# Conflicts:
#	packages/adapters/src/chat-sdk-surface.ts
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
rakazo-www Skipped Skipped Oct 22, 2026 3:58pm UTC

Request Review

@elie222
elie222 merged commit 3865bf9 into elie222:main Oct 22, 2026
24 checks passed

This branch was previously deployed

1 inactive deployment
Preview — fcfa5ca5 Deployed Oct 22, 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.

2 participants