Skip to content

feat(opencode): add LINE Messaging API integration#13799

Open
monthop-gmail wants to merge 2 commits intoanomalyco:devfrom
monthop-gmail:feat/line-integration
Open

feat(opencode): add LINE Messaging API integration#13799
monthop-gmail wants to merge 2 commits intoanomalyco:devfrom
monthop-gmail:feat/line-integration

Conversation

@monthop-gmail
Copy link
Copy Markdown

@monthop-gmail monthop-gmail commented Feb 16, 2026

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

Add packages/line - LINE bot that bridges LINE messages to OpenCode,
following the same pattern as the existing Slack integration.

Each LINE user gets their own OpenCode session. Messages are forwarded
to the AI coding agent, and responses are sent back through LINE.
Tool updates are sent as real-time notifications.

Commands: /new, /abort, /sessions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

- Add @types/bun to devDependencies for Bun.serve types
- Remove response.info.content (not on AssistantMessage type)
- Extract text from response.parts with proper typing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add LINE Messaging API integration

1 participant