Skip to content

功能: 飞书/Telegram/QQ 旁路提问 (/btw) + 修复会话恢复与代理劫持#203

Closed
Xiaoyuan-Liu wants to merge 2 commits intoriba2534:mainfrom
Xiaoyuan-Liu:pr-194-clean
Closed

功能: 飞书/Telegram/QQ 旁路提问 (/btw) + 修复会话恢复与代理劫持#203
Xiaoyuan-Liu wants to merge 2 commits intoriba2534:mainfrom
Xiaoyuan-Liu:pr-194-clean

Conversation

@Xiaoyuan-Liu
Copy link

问题描述

新增 /btw 旁路提问功能,允许用户在 Agent 运行时向其发送问题并实时获得回答,无需等待当前任务完成。同时修复两个独立 bug。

实现方案

新功能:/btw 旁路提问

  • 后端src/index.tssrc/web.ts):新增 /btw WebSocket 命令和 IPC 通道,Agent 运行时通过 btw_response 事件实时回复
  • Agent Runnercontainer/agent-runner/src/index.ts):监听 btw IPC 文件,调用 Claude --print 模式回答
  • IM 渠道src/feishu.tssrc/telegram.tssrc/qq.ts):三个渠道支持 /btw 斜杠命令
  • 前端web/src/components/chat/BtwBubble.tsxChatView.tsxMessageList.tsxstores/chat.ts):新增 BtwBubble 组件展示旁路问答对

Bug 修复

  • thinking signature 无效导致会话恢复失败:清理无效的 thinking signature 避免 API 报错
  • npm 代理劫持飞书 API.gitignore 和 Makefile 调整避免 npm 代理影响飞书 WebSocket 连接

变更文件(16 个文件,+508/-25)

文件 变更
src/index.ts btw IPC 处理逻辑
src/web.ts btw WebSocket 路由
src/feishu.ts / src/telegram.ts / src/qq.ts IM /btw 命令支持
src/im-command-utils.ts btw 命令工具函数
src/types.ts / src/web-context.ts 类型定义更新
container/agent-runner/src/index.ts Agent 端 btw 处理
web/src/components/chat/BtwBubble.tsx 新组件
web/src/components/chat/ChatView.tsx / MessageList.tsx 集成 btw 展示
web/src/stores/chat.ts btw 状态管理
.gitignore / Makefile / CLAUDE.md 配置调整

注:本 PR 是 #194 的干净重提交(squash 为单个 commit,清理了 Git 身份信息)。

- 新增 /btw 命令:在 Agent 运行时向其发送旁路提问,Agent 通过 btw_response WebSocket 事件实时回复
- 前端新增 BtwBubble 组件展示旁路提问的问答对
- 支持飞书/Telegram/QQ 三个 IM 渠道的 /btw 命令
- 修复 thinking signature 无效导致会话恢复失败的问题
- 修复 npm 代理劫持飞书 API 的问题
移除对不存在的 AgentStatusCard 组件的导入及未使用的 agents、onAgentClick props,修复编译错误。
@riba2534
Copy link
Owner

先不做 /btw

@riba2534 riba2534 closed this Mar 18, 2026
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.

2 participants