Skip to content

feat: add lark (feishu) interface#8733

Open
yipingw wants to merge 6 commits into
agno-agi:mainfrom
yipingw:feat/lark-interface
Open

feat: add lark (feishu) interface#8733
yipingw wants to merge 6 commits into
agno-agi:mainfrom
yipingw:feat/lark-interface

Conversation

@yipingw

@yipingw yipingw commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Adds a Lark (Feishu) interface to AgentOS, enabling agents/teams/workflows to be reached via Lark bot event subscriptions. Mirrors the existing Telegram/Slack/WhatsApp interface patterns.

Key features:

  • Webhook-based event subscription (POST /lark/webhook) with AES-256-CBC event decryption and SHA-256 signature verification (when encrypt_key is configured)
  • Streaming responses via interactive cards (PATCH /im/v1/messages/:id), with progressive card updates as tokens arrive
  • Non-streaming responses via interactive cards (markdown rendering)
  • Group chat @mention gating (reply_to_mentions_only)
  • Per-chat session tracking (lark:{entity_id}:{chat_id})
  • Inbound media (image/file/audio/video) and outbound media (image/file)
  • Built-in /new (session reset) and /help commands
  • Event dedup (Lark retries if not ACKed within 3s)
  • Works with Agent, Team, and Workflow
  • Supports both Feishu (open.feishu.cn) and Lark (open.larksuite.com) domains

Type of change

  • New feature

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (ruff format, ruff check, mypy all pass)
  • Self-review completed
  • Documentation updated (docstrings, cookbook README)
  • Examples and guides: cookbook example included (cookbook/05_agent_os/interfaces/lark/)
  • Tested in clean environment (end-to-end tested with a real Feishu app)
  • Tests added/updated (N/A — interface requires live platform credentials)

Duplicate and AI-Generated PR Check

  • I have searched existing open pull requests and confirmed that no other PR already addresses this issue
  • Check if this PR was entirely AI-generated: Yes, developed with AI assistance

Additional Notes

End-to-end tested with a real Feishu custom app:

  • Group chat @mention: verified (event → decrypt → verify → DeepSeek agent → streaming card reply)
  • Private chat (P2P): verified (requires im:message.p2p_msg:readonly permission)
  • URL verification challenge: verified
  • AES encryption + SHA-256 signature verification: verified

The interface uses raw httpx (no SDK dependency), matching the WhatsApp interface's lightweight approach. Optional AES decryption requires pip install 'agno[lark-crypto]' (cryptography>=41.0).

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

PR Triage

A few things to address before this PR can be reviewed:

Missing issue link: Please link the issue this PR addresses using fixes #<issue_number>, closes #<issue_number>, or resolves #<issue_number> in the PR description. If there is no existing issue, please create one first.


Missing tests: This PR modifies source code but does not include any test changes. Please add or update tests to cover your changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant