@Teknium: Hermes Agent now has a new gateway channel! LINE is now an officially supported way to interact with your agent! Read t…

X AI KOLs Following Tools

Summary

Hermes Agent has added official support for LINE as a gateway channel, allowing developers to interact with their AI agents via the LINE Messaging API.

Hermes Agent now has a new gateway channel! LINE is now an officially supported way to interact with your agent! Read the docs here: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/line… `hermes update` to start using now!
Original Article
View Cached Full Text

Cached at: 05/10/26, 08:30 PM

Hermes Agent now has a new gateway channel! LINE is now an officially supported way to interact with your agent! Read the docs here: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/line… hermes update to start using now!


LINE | Hermes Agent

Source: https://hermes-agent.nousresearch.com/docs/user-guide/messaging/line

LINE Setup

Run Hermes Agent as aLINEbot via the official LINE Messaging API. The adapter lives as a bundled platform plugin underplugins/platforms/line/— no core edits, just enable it like any other platform.

LINE is the dominant messaging app in Japan, Taiwan, and Thailand. If your users live there, this is how they reach you.

How the bot responds

ContextBehavior1:1 chat(UIDs)Responds to every messageGroup chat(CIDs)Responds when the group is on the allowlistMulti-user room(RIDs)Responds when the room is on the allowlistInbound text, images, audio, video, files, stickers, and locations are all handled. Outbound text uses thefree reply token first(single-use, ~60s window) and falls back to the metered Push API when the token has expired.


Step 1: Create a LINE Messaging API channel

  1. Go to theLINE Developers Console.
  2. Create a Provider, then under it aMessaging APIchannel.
  3. From the channel’sBasic settingstab, copy theChannel secret.
  4. From theMessaging APItab, scroll toChannel access token (long-lived)and clickIssue. Copy the token.
  5. In theMessaging APItab, also disableAuto-reply messagesandGreeting messagesso they don’t fight your bot’s replies.

Step 2: Expose the webhook port

LINE delivers webhooks over public HTTPS. The default port is8646— override withLINE\_PORTif needed.

# Cloudflare Tunnel (recommended for production — fixed hostname)cloudflared tunnel --url http://localhost:8646# ngrok (good for dev)ngrok http 8646# devtunneldevtunnel create hermes-line --allow-anonymousdevtunnel port create hermes-line -p 8646 --protocol httpsdevtunnel host hermes-line

Copy thehttps://\.\.\.URL — you’ll set it as the webhook URL below.Leave the tunnel runningwhile testing. For production, set up a fixed Cloudflare named tunnel so the webhook URL doesn’t change on restart.


Step 3: Configure Hermes

Add to~/\.hermes/\.env:

LINE_CHANNEL_ACCESS_TOKEN=YOUR_LONG_LIVED_TOKENLINE_CHANNEL_SECRET=YOUR_CHANNEL_SECRET# Allowlist — at least one of these (or LINE_ALLOW_ALL_USERS=true for dev)LINE_ALLOWED_USERS=U1234567890abcdef...           # comma-separated U-prefixed IDsLINE_ALLOWED_GROUPS=C1234567890abcdef...          # optional group IDsLINE_ALLOWED_ROOMS=R1234567890abcdef...           # optional room IDs# Required for image / audio / video sends — the public HTTPS base URL# the tunnel resolves to.  Without it, send_image/voice/video will refuse.LINE_PUBLIC_URL=https://my-tunnel.example.com

Then in~/\.hermes/config\.yaml:

gateway:  platforms:    line:      enabled: true

That’s enough — the bundled-plugin scan ingateway/config\.pyautomatically picks upplugins/platforms/line/. NoPlatform\.LINEenum edit, no\_create\_adapterregistration.


Step 4: Set the webhook URL

Back in the LINE console:

  1. Open your channel →Messaging APItab.
  2. UnderWebhook settingsWebhook URL, pastehttps://<your\-tunnel\>/line/webhook(note the/line/webhookpath — the adapter listens there).
  3. ClickVerify. LINE pings the URL; you should see a 200.
  4. ToggleUse webhooktoOn.

Step 5: Run the gateway

The agent log shows:

LINE: webhook listening on 0.0.0.0:8646/line/webhook (public: https://my-tunnel.example.com)

Add the bot as a friend from the LINE app (scan the QR in the channel’sMessaging APItab) and send it a message.


Slow LLM responses

LINE’s reply token is single-use and expires roughly 60 seconds after the inbound event. Slow LLMs can’t reply in time, which would normally force a paid Push API call.

When the LLM is still running pastLINE\_SLOW\_RESPONSE\_THRESHOLDseconds (default45), the adapter consumes the original reply token to send aTemplate Buttonsbubble:

🤔 Still thinking. Tap below to fetch the answer when it’s ready. [ Get answer ]

The user tapsGet answerwhen convenient — that postback delivers afreshreply token, which the adapter uses to send the cached answer (still free).

State machine:PENDING → READY → DELIVERED, plusERRORfor cancelled runs (the orphan PENDING resolves to “Run was interrupted before completion.” after/stopso the persistent button doesn’t loop).

To disable the postback button and always Push-fallback instead:

LINE_SLOW_RESPONSE_THRESHOLD=0

For the postback flow to fire reliably, suppress chatter that would consume the reply token before the threshold:

# ~/.hermes/config.yamldisplay:  interim_assistant_messages: false  platforms:    line:      tool_progress: off

Cron / notification delivery

LINE_HOME_CHANNEL=Uxxxxxxxxxxxxxxxxxxxx     # default delivery target

Cron jobs withdeliver: lineroute toLINE\_HOME\_CHANNEL. The adapter ships a standalone Push-only sender so cron jobs work even when cron runs in a separate process from the gateway.


Environment variable reference

VariableRequiredDefaultDescriptionLINE\_CHANNEL\_ACCESS\_TOKENyes—Long-lived channel access tokenLINE\_CHANNEL\_SECRETyes—Channel secret (HMAC-SHA256 webhook verification)LINE\_HOSTno0\.0\.0\.0Webhook bind hostLINE\_PORTno8646Webhook bind portLINE\_PUBLIC\_URLfor media—Public HTTPS base URL; required for image/voice/video sendsLINE\_ALLOWED\_USERSone of—Comma-separated user IDs (U-prefixed)LINE\_ALLOWED\_GROUPSone of—Comma-separated group IDs (C-prefixed)LINE\_ALLOWED\_ROOMSone of—Comma-separated room IDs (R-prefixed)LINE\_ALLOW\_ALL\_USERSdev onlyfalseSkip allowlist entirelyLINE\_HOME\_CHANNELno—Default cron / notification delivery targetLINE\_SLOW\_RESPONSE\_THRESHOLDno45Seconds before the postback button fires (0= disabled)LINE\_PENDING\_TEXTno“🤔 Still thinking…“Bubble text shown alongside the postback buttonLINE\_BUTTON\_LABELno“Get answer“Button labelLINE\_DELIVERED\_TEXTno“Already replied ✅“Reply when an already-delivered button is tapped againLINE\_INTERRUPTED\_TEXTno“Run was interrupted before completion.“Reply when a/stoporphan button is tapped

Troubleshooting

**“invalid signature” on webhook verify.**TheChannel secretwas copied wrong, or your tunnel rewrote the request body. Verify withcurl \-i https://<tunnel\>/line/webhook/healthfirst — that should return\{"status":"ok","platform":"line"\}.

**Bot receives nothing in groups.**CheckLINE\_ALLOWED\_GROUPSincludes theC\.\.\.group ID. To find a group ID, send a test message and grep~/\.hermes/logs/gateway\.logforLINE: rejecting unauthorized source— the rejected source dict has the IDs.

**send\_imagefails with “LINE_PUBLIC_URL must be set”.**LINE’s Messaging API does not accept binary uploads — images, audio, and video must be reachable HTTPS URLs. SetLINE\_PUBLIC\_URLto the tunnel’s public hostname and the adapter will serve files from/line/media/<token\>/<filename\>automatically.

**Postback button never appears.**Either the LLM responded faster thanLINE\_SLOW\_RESPONSE\_THRESHOLD, or another bubble (tool-progress, streaming) consumed the reply token first. See the suppression block under “Slow LLM responses”.

**“already in use by another profile”.**The same channel access token is bound to another running Hermes profile. Stop the other gateway or use a separate channel.


Limitations

  • **Single bubble per chunk.**Each LINE text bubble is capped at 5000 characters, and at most 5 bubbles are sent per Reply/Push call. Longer responses are truncated with an ellipsis.
  • **No native message editing.**LINE has no edit-message API — streaming responses always send fresh bubbles, never edit prior ones.
  • **No Markdown rendering.**Bold (\*\*), italics (\*), code fences, and headings render as literal characters. The adapter strips them before sending; URLs are preserved (\[label\]\(url\)becomeslabel \(url\)).
  • **Loading indicator is DM-only.**LINE rejects the chat/loading API for groups and rooms, so the typing indicator only shows in 1:1 chats.

Similar Articles