Skip to content

feat: 飞书基础接入 — WebSocket 长连接、消息收发、UI 对话框#151

Closed
shellmind112 wants to merge 6 commits intodevfrom
feishu/base
Closed

feat: 飞书基础接入 — WebSocket 长连接、消息收发、UI 对话框#151
shellmind112 wants to merge 6 commits intodevfrom
feishu/base

Conversation

@shellmind112
Copy link
Copy Markdown
Collaborator

@shellmind112 shellmind112 commented Apr 7, 2026

Issue for this PR

Closes #146

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

通过飞书官方 SDK 的 WebSocket 长连接模式接入飞书,实现本地 Aether 与飞书的消息收发。

主要改动:

  • 新增 FeishuManager 单例(packages/opencode/src/feishu/manager.ts),管理 WebSocket 连接、消息接收与回复、会话映射
  • 新增 HTTP 路由(packages/opencode/src/server/routes/feishu.ts):start/stop/status/events SSE
  • 新增前端对话框 UI(packages/app/src/components/dialog-feishu.tsx):App ID/Secret 输入、连接状态指示
  • 使用 Instance.bind() 解决飞书 SDK 回调中 AsyncLocalStorage 上下文丢失问题
  • 事件回调改为 void 非阻塞,避免飞书服务器因超时重发消息
  • 首次消息优先复用最近会话;/new 命令立即创建新会话
  • AI 回复顶部追加项目/会话标题
  • 新增使用说明和架构文档

How did you verify your code works?

  • 在飞书开放平台创建测试应用,验证私聊消息收发正常
  • 验证 /new/help 命令
  • 验证断开/重连流程
  • 验证 web UI 连接状态指示

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

The following comment was made by an LLM, it may be inaccurate:

This PR may overlap with existing open pull requests:

Please check whether this work should be consolidated.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 7, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@shellmind112 shellmind112 force-pushed the feishu/base branch 2 times, most recently from b73cb53 to 036488f Compare April 9, 2026 15:42
shellmind112 and others added 6 commits April 10, 2026 00:03
- Implemented Feishu connection management in `manager.ts` with WebSocket and event handling.
- Created API routes for starting, stopping, and checking status of the Feishu bridge in `feishu.ts`.
- Added UI dialog for Feishu connection in `dialog-feishu.tsx` with configuration inputs and status indicators.
- Introduced context for managing Feishu status in `feishu.ts`.
- Documented the setup and usage of Feishu integration in `feishu-setup-guide.md`.
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: 飞书基础接入 — WebSocket 长连接、消息收发、UI 对话框

1 participant