Bug Description
When a Slack message contains multiple file attachments, resolveSlackMedia() only returns the first successfully downloaded file instead of all files.
Location
/dist/slack/monitor/media.js (source: src/slack/monitor/media.ts)
Problem
The function loops through files but returns immediately after the first successful download:
for (const file of files) {
// ... download logic ...
return { // <-- BUG: Returns after FIRST file
path: saved.path,
contentType: saved.contentType,
placeholder: label ? \`[Slack file: ${label}]\` : "[Slack file]",
};
}
Impact
When another bot (e.g., TommyBot) sends multiple PDFs in a single message, Clawdbot only receives and processes the first one. This broke a workflow where invoice PDFs were being sent for processing.
Suggested Fix
Change the function to:
- Collect all successfully downloaded files into an array
- Return all files (requires updating the return type/interface)
- Update callers to handle multiple files
Reproduction
- Have another bot send a Slack message with 3+ file attachments
- Observe that Clawdbot only receives/processes the first file
Bug Description
When a Slack message contains multiple file attachments,
resolveSlackMedia()only returns the first successfully downloaded file instead of all files.Location
/dist/slack/monitor/media.js(source:src/slack/monitor/media.ts)Problem
The function loops through files but returns immediately after the first successful download:
Impact
When another bot (e.g., TommyBot) sends multiple PDFs in a single message, Clawdbot only receives and processes the first one. This broke a workflow where invoice PDFs were being sent for processing.
Suggested Fix
Change the function to:
Reproduction