fix(line): map LINE image messages to photos (#38235) - #38777
Closed
Tranquil-Flow wants to merge 1 commit into
Closed
fix(line): map LINE image messages to photos (#38235)#38777Tranquil-Flow wants to merge 1 commit into
Tranquil-Flow wants to merge 1 commit into
Conversation
Contributor
|
Thanks for the focused LINE regression fix. Automated hermes-sweeper review found that current
Closing as implemented on main. |
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.
What changed
Fixes LINE inbound image messages being classified with the nonexistent
MessageType.IMAGEenum value. LINE sends webhook image messages astype="image", while Hermes' shared gateway enum usesMessageType.PHOTO.This PR adds a small
_line_msg_type()mapper so inbound LINE message types are translated to existing HermesMessageTypevalues:image→PHOTOaudio→AUDIOvideo→VIDEOfile→DOCUMENTsticker→STICKERlocation→LOCATIONTEXTWhy
Before this fix, any non-text LINE message attempted to construct a
MessageEventwithMessageType.IMAGE, which does not exist. That raisedAttributeErrorand prevented the agent from responding to LINE image messages.Verification
RED proof before production change:
Focused tests after fix:
/Users/evinova-self/.hermes/hermes-agent/venv/bin/python3 -m pytest tests/plugins/test_line_adapter.py -v -o "addopts=" --tb=shortResult:
3 passed in 0.05sCompetitor check
Open PR #38528 also addresses #38235 with a one-line
MessageType.PHOTOreplacement. I scored it below the automated publication threshold because it has no committed regression tests and still maps every non-text LINE message toPHOTO. This PR keeps the same minimal root-cause fix while covering all LINE message categories and adding production-path regression tests.Auto-published by Moonsong via Path B automated pipeline.