fix(line): use build_source not create_source so inbound messages dispatch - #23569
Closed
wuwushi4 wants to merge 1 commit into
Closed
fix(line): use build_source not create_source so inbound messages dispatch#23569wuwushi4 wants to merge 1 commit into
wuwushi4 wants to merge 1 commit into
Conversation
…patch Inbound LINE webhook events crash on every message with ``AttributeError: 'LineAdapter' object has no attribute 'create_source'``. The plugin calls ``self.create_source(...)`` at adapter.py:962 but the base adapter exposes ``build_source(...)`` — the same method every other platform uses (mattermost, matrix, whatsapp, msgraph_webhook, wecom, feishu, bluebubbles, qqbot all call ``self.build_source``). Pure typo; the kwargs already match ``build_source``'s signature exactly. Repro: any text message sent to a LINE bot configured via this plugin triggers the AttributeError in ``_handle_message_event``, so 100% of inbound traffic dies silently before the agent ever sees it. The existing test suite under tests/gateway/test_line_plugin.py covers parsing/signing/etc. but does not appear to exercise the full webhook→dispatch→Source-construction path, which is why this slipped through PR NousResearch#23197. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
Collaborator
|
Duplicate of #23305 — same one-line fix (create_source → build_source) in LINE adapter. Both address the AttributeError crash on inbound messages. |
This was referenced May 11, 2026
Author
3 tasks
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
The LINE Messaging API plugin added in #23197 has a typo that causes 100% of inbound text messages to crash before they reach the agent.
_handle_message_eventcallsself.create_source(...)atplugins/platforms/line/adapter.py:962, but the base adapter's helper is namedbuild_source— every other platform adapter (mattermost, matrix, whatsapp, msgraph_webhook, wecom, feishu, bluebubbles, qqbot) callsself.build_source(...).Reproduces every time you send any text to a LINE bot configured via this plugin. The webhook is received, signature verified, event dispatched — then dies in
_handle_message_eventwith:The kwargs at the call site (
chat_id,chat_type,user_id,user_name,chat_name) already matchbuild_source's signature exactly — pure rename, zero behavior change. Verified locally: after the one-character fix, inbound messages dispatch normally, agent responds via the free reply token, and the postback fallback path also works.Why the test suite didn't catch this
tests/gateway/test_line_plugin.py(644 lines) covers signature verification, parsing, the postback state machine, etc., but doesn't appear to exercise the full webhook →_handle_message_event→build_source→MessageEventpath against a realLineAdapterinstance — so the missing-attribute crash hides behind the unit-test boundary. Worth a follow-up to add an end-to-end smoke test that constructs a real adapter and feeds it a parsed message event.Test plan
🤖 Generated with Claude Code