hermes - 💡(How to fix) Fix [Feature]: LINE Messaging API gateway adapter [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#16611Fetched 2026-04-28 06:52:13
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

  • 66 tests across 12 files covering signature validation, cache state machine (PENDING→READY→DELIVERED→ERROR + TTL prune), allowlist, reply client, HTTP endpoint, config parsing, and runner wiring

Root Cause

  • Webhook server — aiohttp endpoint at /line/webhook with HMAC-SHA256 signature validation
  • AllowlistLINE_ALLOWED_USERS / LINE_ALLOW_ALL_USERS env vars (user/group/room sources)
  • Typing indicatorshowLoadingAnimation fired immediately on webhook receipt (200 returned before LLM dispatch)
  • PENDING/READY/DELIVERED cache — postback Quick Reply button for slow LLM responses (>3s); necessary because LINE's reply token expires in 60 seconds
  • Platform registryhermes-line toolset, Platform.LINE in config + run factory, setup wizard section
  • 66 tests across 12 files covering signature validation, cache state machine (PENDING→READY→DELIVERED→ERROR + TTL prune), allowlist, reply client, HTTP endpoint, config parsing, and runner wiring

Fix Action

Fix / Workaround

  • Webhook server — aiohttp endpoint at /line/webhook with HMAC-SHA256 signature validation
  • AllowlistLINE_ALLOWED_USERS / LINE_ALLOW_ALL_USERS env vars (user/group/room sources)
  • Typing indicatorshowLoadingAnimation fired immediately on webhook receipt (200 returned before LLM dispatch)
  • PENDING/READY/DELIVERED cache — postback Quick Reply button for slow LLM responses (>3s); necessary because LINE's reply token expires in 60 seconds
  • Platform registryhermes-line toolset, Platform.LINE in config + run factory, setup wizard section
  • 66 tests across 12 files covering signature validation, cache state machine (PENDING→READY→DELIVERED→ERROR + TTL prune), allowlist, reply client, HTTP endpoint, config parsing, and runner wiring

Code Example

LINE_CHANNEL_ACCESS_TOKEN=...
LINE_CHANNEL_SECRET=...
LINE_ALLOWED_USERS=U<userId>   # or LINE_ALLOW_ALL_USERS=true
RAW_BUFFERClick to expand / collapse

Problem or Use Case

LINE is the dominant messaging platform in Taiwan, Japan, and Thailand. There is currently no way to run Hermes as a LINE bot — users in these markets have no gateway option for their primary messaging app.

Proposed Solution

Add a gateway/platforms/line.py adapter (same pattern as telegram.py) that connects Hermes to the LINE Messaging API via webhook.

Implementation is complete in leepoweii/hermes-agent@feat/line-adapter:

  • Webhook server — aiohttp endpoint at /line/webhook with HMAC-SHA256 signature validation
  • AllowlistLINE_ALLOWED_USERS / LINE_ALLOW_ALL_USERS env vars (user/group/room sources)
  • Typing indicatorshowLoadingAnimation fired immediately on webhook receipt (200 returned before LLM dispatch)
  • PENDING/READY/DELIVERED cache — postback Quick Reply button for slow LLM responses (>3s); necessary because LINE's reply token expires in 60 seconds
  • Platform registryhermes-line toolset, Platform.LINE in config + run factory, setup wizard section
  • 66 tests across 12 files covering signature validation, cache state machine (PENDING→READY→DELIVERED→ERROR + TTL prune), allowlist, reply client, HTTP endpoint, config parsing, and runner wiring
LINE_CHANNEL_ACCESS_TOKEN=...
LINE_CHANNEL_SECRET=...
LINE_ALLOWED_USERS=U<userId>   # or LINE_ALLOW_ALL_USERS=true

Alternatives Considered

Skill: Not viable. LINE requires a persistent webhook listener for real-time events, HMAC-SHA256 signature validation on every incoming request, and a 60-second reply token state machine. These cannot be done "best effort" via terminal or web_extract — they need Python-level integration in the gateway harness.

Feature Type

Gateway / messaging improvement

Scope

Large (new module or significant refactor)

Contribution

  • I'd like to implement this myself and submit a PR

extent analysis

TL;DR

Implement the LINE adapter by adding a gateway/platforms/line.py file and configuring the necessary environment variables to connect Hermes to the LINE Messaging API via webhook.

Guidance

  • Review the implementation in leepoweii/hermes-agent@feat/line-adapter to understand the required changes and ensure all components are correctly set up.
  • Configure the environment variables LINE_CHANNEL_ACCESS_TOKEN, LINE_CHANNEL_SECRET, and LINE_ALLOWED_USERS (or LINE_ALLOW_ALL_USERS) to enable the LINE adapter.
  • Verify the webhook server is correctly set up and receiving events from the LINE Messaging API.
  • Test the adapter using the provided 66 tests across 12 files to ensure all functionality is working as expected.

Example

No code snippet is provided as the implementation details are already available in the referenced GitHub branch.

Notes

The implementation requires a Python-level integration in the gateway harness, and the provided tests should be used to verify the correctness of the adapter.

Recommendation

Apply the workaround by implementing the LINE adapter as described in the proposed solution, as it provides a complete and tested solution for integrating Hermes with the LINE Messaging API.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Feature]: LINE Messaging API gateway adapter [1 comments, 2 participants]