fix(gateway): map LINE media message types - #35681
Closed
aaronlin wants to merge 1 commit into
Closed
Conversation
19 tasks
Collaborator
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 does this PR do?
Fixes LINE inbound media dispatch by mapping LINE webhook message types to Hermes gateway
MessageTypeenum values before constructingMessageEvent.The LINE adapter previously used
MessageType.IMAGEfor every non-text message, but the gateway enum defines images asMessageType.PHOTO. This could raise before image/media messages reached the gateway processing path. This PR keeps the change narrow by only adding a LINE-specific mapping helper and a focused regression test.Related Issue
No issue filed.
Related prior PRs found during duplicate search:
This PR is intentionally narrower and based on current
main: it only fixes the LINE webhook message-type enum mapping and adds regression coverage.Type of Change
Changes Made
plugins/platforms/line/adapter.py_line_message_type()to map LINE webhook message types to Hermes gateway enum values.MessageEvent.message_typeconstruction to use that mapping.tests/gateway/test_line_adapter.pyHow to Test
python3 -m py_compile plugins/platforms/line/adapter.py tests/gateway/test_line_adapter.pygit diff --checkscripts/run_tests.sh tests/gateway/test_line_adapter.pyscripts/run_tests.sh tests/gatewaypytest tests/ -qNote: Full
pytest tests/ -qwas not completed locally. Broader gateway coverage was attempted and has one unrelated local failure intests/gateway/test_shutdown_forensics.py::TestSpawnAsyncDiagnostic::test_spawns_subprocess_and_writes_output.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/A: N/Acli-config.yaml.exampleif I added/changed config keys — or N/A: N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A: N/AScreenshots / Logs
N/A. Local checks run on this branch: