[PR #13799] feat(opencode): add LINE Messaging API integration #14816

Open
opened 2026-02-16 18:19:34 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/13799

State: open
Merged: No


Closes #13801

Summary

  • Add packages/line/ - LINE Messaging API integration for OpenCode, following the same pattern as the existing Slack integration (packages/slack/)
  • Each LINE user gets their own OpenCode session via createOpencode() from @opencode-ai/sdk
  • Messages are forwarded to the AI coding agent, and responses are sent back through LINE
  • Real-time tool update notifications via event subscription
  • Handles LINE's 5000 char message limit with smart chunking (respects code blocks)

How it works

User (LINE app)
  ↕  LINE Messaging API webhook
packages/line/ (Bun HTTP server)
  ↕  @opencode-ai/sdk
OpenCode Server (auto-started)
  ↕
Project Filesystem

Commands

  • Send any text message → forwarded to OpenCode as a coding prompt
  • /new - Start a new coding session
  • /abort - Cancel the current prompt
  • /sessions - Show active session info

Files

File Description
packages/line/package.json Dependencies: @opencode-ai/sdk, @line/bot-sdk
packages/line/src/index.ts Main entry - LINE webhook + OpenCode bridge (~290 lines)
packages/line/.env.example Required env vars
packages/line/tsconfig.json TypeScript config (same as Slack)
packages/line/README.md Setup instructions

Test plan

  • Create LINE Messaging API channel at https://developers.line.biz
  • Set .env with LINE credentials
  • Run cd packages/line && bun dev
  • Expose webhook via ngrok or cloudflare tunnel
  • Send text message in LINE → verify OpenCode processes and responds
  • Send /new → verify new session created
  • Send /abort → verify prompt cancelled
  • Send long prompt → verify chunked response

Tested locally with Docker setup and real LINE channel - working end-to-end.

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/13799 **State:** open **Merged:** No --- Closes #13801 ## Summary - Add `packages/line/` - LINE Messaging API integration for OpenCode, following the same pattern as the existing Slack integration (`packages/slack/`) - Each LINE user gets their own OpenCode session via `createOpencode()` from `@opencode-ai/sdk` - Messages are forwarded to the AI coding agent, and responses are sent back through LINE - Real-time tool update notifications via event subscription - Handles LINE's 5000 char message limit with smart chunking (respects code blocks) ## How it works ``` User (LINE app) ↕ LINE Messaging API webhook packages/line/ (Bun HTTP server) ↕ @opencode-ai/sdk OpenCode Server (auto-started) ↕ Project Filesystem ``` ## Commands - Send any text message → forwarded to OpenCode as a coding prompt - `/new` - Start a new coding session - `/abort` - Cancel the current prompt - `/sessions` - Show active session info ## Files | File | Description | |------|-------------| | `packages/line/package.json` | Dependencies: `@opencode-ai/sdk`, `@line/bot-sdk` | | `packages/line/src/index.ts` | Main entry - LINE webhook + OpenCode bridge (~290 lines) | | `packages/line/.env.example` | Required env vars | | `packages/line/tsconfig.json` | TypeScript config (same as Slack) | | `packages/line/README.md` | Setup instructions | ## Test plan - [ ] Create LINE Messaging API channel at https://developers.line.biz - [ ] Set `.env` with LINE credentials - [ ] Run `cd packages/line && bun dev` - [ ] Expose webhook via ngrok or cloudflare tunnel - [ ] Send text message in LINE → verify OpenCode processes and responds - [ ] Send `/new` → verify new session created - [ ] Send `/abort` → verify prompt cancelled - [ ] Send long prompt → verify chunked response > Tested locally with Docker setup and real LINE channel - working end-to-end. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-16 18:19:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14816