Skip to content

fix(line): implement create_source for dispatch - #24254

Closed
KevinJ1729 wants to merge 1 commit into
NousResearch:mainfrom
KevinJ1729:codex/line-create-source-fallback
Closed

fix(line): implement create_source for dispatch#24254
KevinJ1729 wants to merge 1 commit into
NousResearch:mainfrom
KevinJ1729:codex/line-create-source-fallback

Conversation

@KevinJ1729

@KevinJ1729 KevinJ1729 commented May 12, 2026

Copy link
Copy Markdown

Summary

  • implement LineAdapter.create_source() directly in the native LINE platform plugin
  • pass the inbound LINE message_id into the generated SessionSource
  • add regression coverage for LINE SessionSource creation and message dispatch

Context

Hermes Agent v0.13.0 includes the native LINE platform plugin, but LINE webhook dispatch can fail when the gateway calls the adapter source-construction contract and the LINE adapter does not provide an explicit create_source() implementation.

In production this showed up after signed LINE webhook events reached the adapter, then failed before dispatch with:

AttributeError: 'LineAdapter' object has no attribute 'create_source'

This patch makes the LINE adapter's dispatch contract explicit instead of relying on surrounding gateway/base behavior, so LINE webhook events consistently produce a SessionSource with platform=line, chat/user metadata, and the triggering message id.

Testing

  • python -m py_compile plugins/platforms/line/adapter.py tests/gateway/test_line_plugin.py
  • Could not run python -m pytest tests/gateway/test_line_plugin.py -q locally because pytest is not installed in this Windows Python environment.
  • Could not run uv run pytest tests/gateway/test_line_plugin.py -q locally because uv is not installed in this Windows shell.

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have labels May 12, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #23305 (and #23730, #23782, #23867, #24091). This is at least the 6th PR addressing the same LINE create_sourcebuild_source issue. The approach here (compatibility shim) differs slightly but addresses the same root cause.

@KevinJ1729
KevinJ1729 force-pushed the codex/line-create-source-fallback branch from 70b37e2 to 9d4371a Compare May 12, 2026 10:04
@KevinJ1729 KevinJ1729 changed the title fix(line): handle missing create_source on older gateways fix(line): implement create_source for dispatch May 12, 2026
@KevinJ1729

Copy link
Copy Markdown
Author

Thanks for the clarification. I understand this PR overlaps with the existing fixes for the LINE create_source/build_source issue.

To avoid adding noise for maintainers, I’ll close this PR. If the message_id handling or regression test from this PR is still useful after the main fix lands, I’d be happy to open a smaller follow-up PR focused only on that part.

@KevinJ1729 KevinJ1729 closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants