Skip to content

fix(line): map LINE image messages to photos (#38235) - #38777

Closed
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/38235-line-image-message-type-review
Closed

fix(line): map LINE image messages to photos (#38235)#38777
Tranquil-Flow wants to merge 1 commit into
NousResearch:mainfrom
Tranquil-Flow:fix/38235-line-image-message-type-review

Conversation

@Tranquil-Flow

Copy link
Copy Markdown
Contributor

What changed

Fixes LINE inbound image messages being classified with the nonexistent MessageType.IMAGE enum value. LINE sends webhook image messages as type="image", while Hermes' shared gateway enum uses MessageType.PHOTO.

This PR adds a small _line_msg_type() mapper so inbound LINE message types are translated to existing Hermes MessageType values:

  • imagePHOTO
  • audioAUDIO
  • videoVIDEO
  • fileDOCUMENT
  • stickerSTICKER
  • locationLOCATION
  • unknown/future types → TEXT

Why

Before this fix, any non-text LINE message attempted to construct a MessageEvent with MessageType.IMAGE, which does not exist. That raised AttributeError and prevented the agent from responding to LINE image messages.

Verification

RED proof before production change:

ImportError: cannot import name '_line_msg_type' from 'plugins.platforms.line.adapter'

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=short

Result: 3 passed in 0.05s

Competitor check

Open PR #38528 also addresses #38235 with a one-line MessageType.PHOTO replacement. I scored it below the automated publication threshold because it has no committed regression tests and still maps every non-text LINE message to PHOTO. 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.

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have labels Jun 4, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused LINE regression fix.

Automated hermes-sweeper review found that current main already implements the requested behavior, including stronger regression coverage:

  • plugins/platforms/line/adapter.py:141-149 maps LINE image to MessageType.PHOTO and maps the other supported webhook types to canonical gateway types.
  • plugins/platforms/line/adapter.py:984-994 applies that mapping on the production inbound-message path, so it no longer references nonexistent MessageType.IMAGE.
  • tests/gateway/test_line_plugin.py:650-676 covers the removed MessageType.IMAGE failure, every supported mapping, and unknown-type fallback.
  • This shipped in 7309f3bef7d7dd5d8d6aa4a98d977de7608ae7d2 (fix(line): map inbound message types to the correct MessageType), included in v2026.6.5.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants