fix(slack): download all files in multi-image messages (#15447)

* fix(slack): download all files in multi-image messages

resolveSlackMedia() previously returned after downloading the first
file, causing multi-image Slack messages to lose all but the first
attachment. This changes the function to collect all successfully
downloaded files into an array, matching the pattern already used by
Telegram, Line, Discord, and iMessage adapters.

The prepare handler now populates MediaPaths, MediaUrls, and
MediaTypes arrays so downstream media processing (vision, sandbox
staging, media notes) works correctly with multiple attachments.

Fixes #11892, #7536

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(slack): preserve MediaTypes index alignment with MediaPaths/MediaUrls

The filter(Boolean) on MediaTypes removed entries with undefined contentType,
shrinking the array and breaking index correlation with MediaPaths and MediaUrls.
Downstream code (media-note.ts, attachments.ts) requires these arrays to have
equal lengths for correct per-attachment MIME type lookup. Replace filter(Boolean)
with a nullish coalescing fallback to "application/octet-stream".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(slack): align MediaType fallback and tests (#15447) (thanks @CommanderCrowCode)

* fix: unblock plugin-sdk account-id typing (#15447)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Tanwa Arpornthip
2026-02-14 20:16:02 +07:00
committed by GitHub
parent ef70a55b7a
commit c76288bdf1
7 changed files with 107 additions and 43 deletions

24
pnpm-lock.yaml generated
View File

@@ -312,6 +312,10 @@ importers:
zod:
specifier: ^4.3.6
version: 4.3.6
devDependencies:
openclaw:
specifier: workspace:*
version: link:../..
extensions/google-antigravity-auth:
devDependencies:
@@ -6845,7 +6849,7 @@ snapshots:
'@larksuiteoapi/node-sdk@1.59.0':
dependencies:
axios: 1.13.5
axios: 1.13.5(debug@4.4.3)
lodash.identity: 3.0.0
lodash.merge: 4.6.2
lodash.pickby: 4.6.0
@@ -6861,7 +6865,7 @@ snapshots:
dependencies:
'@types/node': 24.10.13
optionalDependencies:
axios: 1.13.5
axios: 1.13.5(debug@4.4.3)
transitivePeerDependencies:
- debug
@@ -7064,7 +7068,7 @@ snapshots:
'@azure/core-auth': 1.10.1
'@azure/msal-node': 3.8.7
'@microsoft/agents-activity': 1.2.3
axios: 1.13.5
axios: 1.13.5(debug@4.4.3)
jsonwebtoken: 9.0.3
jwks-rsa: 3.2.2
object-path: 0.11.8
@@ -8011,7 +8015,7 @@ snapshots:
'@slack/types': 2.20.0
'@slack/web-api': 7.14.0
'@types/express': 5.0.6
axios: 1.13.5
axios: 1.13.5(debug@4.4.3)
express: 5.2.1
path-to-regexp: 8.3.0
raw-body: 3.0.2
@@ -8057,7 +8061,7 @@ snapshots:
'@slack/types': 2.20.0
'@types/node': 25.2.3
'@types/retry': 0.12.0
axios: 1.13.5
axios: 1.13.5(debug@4.4.3)
eventemitter3: 5.0.4
form-data: 2.5.4
is-electron: 2.2.2
@@ -8951,14 +8955,6 @@ snapshots:
aws4@1.13.2: {}
axios@1.13.5:
dependencies:
follow-redirects: 1.15.11
form-data: 2.5.4
proxy-from-env: 1.1.0
transitivePeerDependencies:
- debug
axios@1.13.5(debug@4.4.3):
dependencies:
follow-redirects: 1.15.11(debug@4.4.3)
@@ -9542,8 +9538,6 @@ snapshots:
flatbuffers@24.12.23: {}
follow-redirects@1.15.11: {}
follow-redirects@1.15.11(debug@4.4.3):
optionalDependencies:
debug: 4.4.3