Skip to content

fix(eve/slack): fail loudly when private file fetch returns login HTML (#1317) - #1531

Open
iroiro147 wants to merge 1 commit into
vercel:mainfrom
iroiro147:fix/1317-slack-html-login
Open

fix(eve/slack): fail loudly when private file fetch returns login HTML (#1317)#1531
iroiro147 wants to merge 1 commit into
vercel:mainfrom
iroiro147:fix/1317-slack-html-login

Conversation

@iroiro147

Copy link
Copy Markdown
Contributor

What

When a Slack bot token lacks files:read (or the app has not been reinstalled
since the scope was added), Slack's private-file endpoint returns HTTP 200
with a browser login page
rather than a 401/403. Eve staged that HTML as the
attachment, so the model honestly reported receiving a "Slack sign-in page" —
masking the underlying scope misconfiguration as a vision/auth mystery.

Changes

createSlackFetchFile (packages/eve/src/public/channels/slack/attachments.ts)
now detects the login page after a successful status check:

  • If Content-Type is text/html, or
  • If the body begins with <!doctype html or <html (some proxies drop the
    content-type)

…it throws with a message naming the fix:

Slack file fetch for <url> returned an HTML login page (HTTP 200). The bot
token likely lacks the `files:read` scope, or the Slack/Bolt app has not been
reinstalled since the scope was added. Add `files:read` via your Slack app
manifest (or Connect "Advanced scopes"), reinstall the app into the workspace,
then retry.

Matches the failure-loudly pattern other Slack clients (e.g. OpenClaw) already
use.

Tests

Six new createSlackFetchFile cases in attachments.test.ts (pass-through for
non-Slack URLs, bytes + content-type for a real file, throw on HTML
content-type, throw on body-sniff even without content-type, message names
files:read + reinstall, and the existing non-2xx HTTP path). All 35
attachments tests pass; tsc -p tsconfig.json --noEmit clean.

Refs #1317

vercel#1317)

When a Slack bot token is missing `files:read` (or the app has not been
reinstalled since the scope was added), Slack returns HTTP 200 with a browser
login page rather than a 401/403. Eve staged the HTML as the attachment, so
the model would report receiving a "Slack sign-in page" with no hint of the
underlying scope misconfiguration.

`createSlackFetchFile` now detects an HTML response (by content-type or by
sniffing the body prefix) and throws an error that names `files:read` and the
workspace-reinstall step, matching the failure-loudly behavior other Slack
clients (e.g. OpenClaw) already use.

Refs vercel#1317

Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

@iroiro147 is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

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