fix(line): add file type to media download handler#26386
Closed
kevinWangSheng wants to merge 3 commits intoopenclaw:mainfrom
Closed
fix(line): add file type to media download handler#26386kevinWangSheng wants to merge 3 commits intoopenclaw:mainfrom
kevinWangSheng wants to merge 3 commits intoopenclaw:mainfrom
Conversation
The LINE plugin was not downloading file attachments (PDF, Word, Excel, JSON, etc.) because the media download condition only checked for image, video, and audio types. Added `message.type === "file"` to the condition so files are downloaded and made available to the agent, consistent with other media types. Fixes openclaw#26330
34e2238 to
59665e9
Compare
Member
|
Deep review pass complete and branch updated. I rebased onto current I also refactored media-type eligibility into an explicit helper guard to reduce future drift when message-type support evolves. |
18 tasks
Contributor
|
Superseded by #32546, which consolidates this LINE workstream into the merged canonical fix set. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The LINE plugin was not downloading file attachments (PDF, Word, Excel, JSON, etc.) because the media download condition only checked for
image,video, andaudiotypes.Changes
message.type === "file"to the media download condition insrc/line/bot-handlers.tsBefore
After
Test Plan
bot-handlers.test.ts)Fixes #26330
Greptile Summary
Added
message.type === "file"to the media download condition inhandleMessageEventso that file attachments (PDF, Word, Excel, JSON, etc.) are now downloaded and made available to the agent. The change is consistent with existing handling for image, video, and audio types, and theextractMediaPlaceholderfunction inbot-message-context.ts:167-168already includes file type support with the<media:document>placeholder. ThedownloadLineMediafunction uses the same LINE Messaging API Content endpoint for all media types.Confidence Score: 5/5
extractMediaPlaceholderfunction already returns<media:document>for file types, anddownloadLineMediaworks with any message type via the same API)Last reviewed commit: 34e2238