Suggestion for Eve: fail loudly when Slack private file fetch returns login HTML
Context
Family Eve agent (Tjalfe) on Vercel Connect Slack. Users uploaded images in Slack; the model replied that it received a Slack login page instead of the photo.
Root cause (ops)
The Connect Slack connector was missing bot scope files:read. Chat scopes worked; private file download did not.
Root cause (framework UX)
Eve's createSlackFetchFile in packages/eve/src/public/channels/slack/attachments.ts does:
const response = await fetch(url, {
headers: { authorization: `Bearer ${token}` },
});
if (!response.ok) throw new Error(...);
return { bytes: Buffer.from(await response.arrayBuffer()), mediaType: ... };
When the bot token lacks files:read (or otherwise cannot read the file), Slack often returns HTTP 200 + browser login HTML, not a 401/403. Eve treats that as success and stages the HTML as the attachment. The model then honestly reports a Slack sign-in page — which looks like a vision/auth mystery rather than a missing scope.
Suggested change
In createSlackFetchFile (and tests in attachments.test.ts):
- After a successful fetch, if
Content-Type is text/html or the body looks like <!DOCTYPE html / <html, throw instead of returning bytes.
- Error message should mention: missing/insufficient Slack bot scope (typically
files:read), and that Connect/Slack apps need reinstall after adding scopes.
- Optionally document
files:read in the Slack channel docs under Attachments (create-time Advanced scopes for Connect).
Why this belongs in Eve
Stock fetch + Bearer is fine for the happy path once files:read is present. The gap is silent failure mode: login HTML reaches the model instead of a clear framework error. Other Slack clients (e.g. OpenClaw) already reject HTML login payloads for this reason.
Repro shape
- Slack connector without
files:read
- User uploads an image and
@mentions the agent
- Observe staged attachment / model output describing a Slack login page
- Add
files:read, reinstall workspace → same flow works
Suggestion for Eve: fail loudly when Slack private file fetch returns login HTML
Context
Family Eve agent (Tjalfe) on Vercel Connect Slack. Users uploaded images in Slack; the model replied that it received a Slack login page instead of the photo.
Root cause (ops)
The Connect Slack connector was missing bot scope
files:read. Chat scopes worked; private file download did not.Root cause (framework UX)
Eve's
createSlackFetchFileinpackages/eve/src/public/channels/slack/attachments.tsdoes:When the bot token lacks
files:read(or otherwise cannot read the file), Slack often returns HTTP 200 + browser login HTML, not a 401/403. Eve treats that as success and stages the HTML as the attachment. The model then honestly reports a Slack sign-in page — which looks like a vision/auth mystery rather than a missing scope.Suggested change
In
createSlackFetchFile(and tests inattachments.test.ts):Content-Typeistext/htmlor the body looks like<!DOCTYPE html/<html, throw instead of returning bytes.files:read), and that Connect/Slack apps need reinstall after adding scopes.files:readin the Slack channel docs under Attachments (create-time Advanced scopes for Connect).Why this belongs in Eve
Stock
fetch+ Bearer is fine for the happy path oncefiles:readis present. The gap is silent failure mode: login HTML reaches the model instead of a clear framework error. Other Slack clients (e.g. OpenClaw) already reject HTML login payloads for this reason.Repro shape
files:read@mentions the agentfiles:read, reinstall workspace → same flow works