fix(line): map LINE msg_type to valid MessageType enum values - #36708
Closed
x1001000 wants to merge 2 commits into
Closed
fix(line): map LINE msg_type to valid MessageType enum values#36708x1001000 wants to merge 2 commits into
x1001000 wants to merge 2 commits into
Conversation
The previous code referenced MessageType.IMAGE, which doesn't exist on gateway.platforms.base.MessageType, so any non-text inbound LINE message would have raised AttributeError. Replace with a proper mapping: LINE's `audio` (mic voice notes, .m4a) → VOICE so STT and auto-TTS reply fire; `image` → PHOTO; `file` → DOCUMENT; plus video/sticker/location. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Collaborator
mxnstrexgl
approved these changes
Jun 1, 2026
mxnstrexgl
left a comment
There was a problem hiding this comment.
🤖 Automated PR Review
Security Scan
- ✓ No hardcoded secrets, injection sinks, unsafe deserialization, or dependency red flags found by this automated scan.
Code Quality
- ✓ No blocking code-quality issues found by this automated scan.
- ℹ️ No test file changes detected; verify existing coverage exercises this behavior.
Summary
Status: APPROVE — security findings: 0, quality suggestions: 0.
Automated review; raw diff content intentionally omitted.
tonydwb
approved these changes
Jun 1, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
✅ Looks Good
- Clean refactor: Replaces a binary text/image check with a comprehensive mapping table covering all LINE message types (text, image, video, audio→VOICE, file→DOCUMENT, sticker, location)
- Correct mapping: LINE
audiomics voice notes correctly map toVOICE(enabling STT + auto-TTS), whilefilefor actual audio files maps toDOCUMENT - Good documentation: Inline comment explains the audio/file distinction clearly
- Minimal change: Single function with a well-defined lookup table
Reviewed by Hermes Agent
1 task
Author
|
Closing — the fix already landed on main via an earlier PR. After resolving the conflict by accepting main's version, this PR became a no-op with no net change. |
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
plugins/platforms/line/adapter.py:971referencedMessageType.IMAGE, which does not exist ongateway.platforms.base.MessageType— everynon-text inbound LINE message would have raised
AttributeErrorat construction time.line_to_message_typemapping that routes each LINE webhookmsg_typeto a real enum value:image→PHOTO,video→VIDEO,audio→VOICE(LINEaudiois mic voice notes, so VOICE fires STT + auto-TTS reply pergateway/run.py:8393-8394),file→DOCUMENT,sticker→STICKER,location→LOCATION, withTEXTas the default.Test plan
MessageType.TEXT.MessageType.PHOTO.MessageType.VOICE, STT fires.