Repository navigation
Feat/substitute mode - #401
Merged
Merged
Conversation
# Conflicts: # src/daemon.ts
# Conflicts: # src/bot-registry.ts # src/im/lark/event-dispatcher.ts
- event-dispatcher: substituteTrigger 判定先走内存 config 短路,未配替身的 bot 不再每条普通群消息读盘 + 省一次 getChatMode - message-parser: post 富文本 @ 的 user_id 实为 open_id,只映射到 openId,不再误填 userId(否则 userId-only 目标匹配不到 post @,且 userId 腿被 open_id 污染) - 替身启用需至少一个可匹配目标(openId/userId/unionId);email 仅保留不匹配,纯 email 目标不再被静默启用成死配置(bot-registry 解析 + substitute-mode-store 归一化) - test: per-chat off 用例改多人群 + 显式 allowedUsers,去掉借 mockGetChatInfo 泄漏的「单人群免@」confound(单跑/换序不再挂);补 post@ 走 openId 匹配、email-only 拒绝用例
Codex 复审的非阻塞 nit:注释误写 'email-only → stored',实际断言与实现都是 targets_required 拒绝、不持久化;email 仅在跟随可匹配 target 时保留。仅注释改动,行为不变。
# Conflicts: # src/im/lark/message-parser.ts # src/types.ts
Owner
Codex 二审结论(留档)未发现 blocker / regression,LGTM,Findings: none。 已 admin-squash-merge 到 master(ae267a23)。 Codex 独立复核了 4 个点并复跑
合并前又 merge 了一次最新 master(VC-agent 等新提交),冲突均为「同处各加各的」保留双方,build + 300 测试复跑仍绿。 |
deepcoldy
pushed a commit
that referenced
this pull request
Jul 10, 2026
将 dashboard 迁移到 React(esbuild 按页面分包),按统一 UI 规范重构工作台/会话/洞察/工作流/群组/定时/白板/角色/Bot配置/Skills/团队/Webhook/全局设置等页面,沉淀 UI 基准规范与通用组件。含 review 修复(locate 图标/team capability/timezone/DropdownMenu/floating-scrollbars/insights/bot-defaults/legacy-workflow/替身编辑等)+ 集成 master 新功能(#404 会话筛选列/#405 监控室/#409 运行监控页/#412 lark-cli状态+飞书QR/#401 替身/#420 agentbuddy 源)。build 绿、全量 unit 0 非环境失败。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
普通群里,用户经常会自然地 @ 某个负责人或值班人,而不是 @ 机器人。这个 PR 增加“替身模式”:当群消息 @ 到配置的替身对象时,botmux 可以把这条消息视为对当前 bot 的请求,由 bot 在同一个普通群会话里代答,常常配合个人知识库使用。
该功能适合搭配 Oncall 模式使用:Oncall 让群成员具备 canTalk,替身模式让群成员可以自然 @ 替身对象触发 bot 代答。
核心改动
权限与边界
使用方式
Dashboard 或 bots.json 配置示例:
{ "substituteMode": { "enabled": true, "disclosure": "prefix", "targets": [ { "name": "马洪超", "userId": "ge897abb", "openId": "ou_8b8570da90e6694261be27662d9becf6", "unionId": "on_03f32fd6a6f361505d8a2a65a79455b3", "email": "[[email protected]](mailto:[email protected])" } ] } }群内开关:
推荐配置:
实现要点
验证
已通过:
注意事项