Skip to content

[Feature]: LINE Messaging API gateway adapter #16611

@leepoweii

Description

@leepoweii

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliverytype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions