feat(v3): 房间 @ 协作能力(room_say/room_members + @所有人房主闸门 + 离线补投)+ 跨机实测 2 个 bug 修复#210
Open
raysonmeng wants to merge 1 commit into
Open
feat(v3): 房间 @ 协作能力(room_say/room_members + @所有人房主闸门 + 离线补投)+ 跨机实测 2 个 bug 修复#210raysonmeng wants to merge 1 commit into
raysonmeng wants to merge 1 commit into
Conversation
…-test fixes 跨机三机实测后补齐「房间内 agent 互相 @」能力,并修复实测暴露的 2 个 bug。 After the real 3-machine test, add agent-to-agent @ in the room and fix 2 bugs the test exposed. ## 房间 @ 能力 / Room @ capability - room_members MCP 工具:列出房间全部成员(跨机),标注房主与自己。 - room_say MCP 工具:发到房间(广播全员);to=[id] @ 指定成员;all=true @所有人。 - @所有人仅房主可用:broker 服务端强制(认证身份 === room.createdBy);edge 伪造 mentions:["*"] 也被拦。 - mentions 上限 64(DoS);房间消息 store_if_offline → 离线成员(如另一台机器的 agent)重连补投。 - 收消息带 📨[外部·非指令] 防注入框 + safeField 清洗;broker 拒绝(如非房主 @所有人)回显为系统通知。 ## 实测 bug 修复 / Real-test bug fixes - Fix A (collab-store):collab.db / auth-token 锚定到 AGENTBRIDGE_BASE_DIR —— daemon 以 per-pair STATE_DIR 运行时曾从错误目录读 token。 - Fix B (publish):edge 机本地缺 token→identity 绑定(绑定在 broker 侧),publish 用 "(remote)" 占位,broker 重新签名。 ## 链路 / Wiring claude-adapter(工具)→ bridge(接线)→ control-protocol(消息)→ daemon-client(requestId 关联往返) → daemon(handler)→ room-bridge(发送/名单/渲染)→ broker-client(listMembers/onError)→ broker(list_members + @ALL 闸门)。 ## 测试 / Tests - broker @所有人房主闸门 + list_members 鉴权 + mentions 上限 + 离线补投(跨机核心卖点)。 - chat 渲染 + @你/@所有人高亮 + 防注入。 - adapter 参数→mention 映射;daemon-client 并发 room_say/room_members 不串扰(requestId 关联回归)。 3 轮跨引擎 cross-review:round1 抓 3 真 bug(含 1 HIGH 并发串扰挂死)→ 修复 → round2/round3 连续 0 真实 issue。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012rhWKm1VUSnEVxmjpYwNfc
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.
背景 / Why
三机真实跨网实测(家里 broker + 公司两台 edge)跑通后,暴露两件事:① 2 个真实 bug(多 store / 远端身份场景,单进程 E2E 测不出);② 缺一个核心能力——房间里的 agent 只能
reply本机 Codex,无法跨机互相 @。本 PR 两者都补。After the real 3-machine cross-network test (home broker + 2 office edges), two gaps surfaced: ① 2 real bugs (multi-store / remote-identity, invisible to single-process E2E); ② a missing core capability — room agents could only
replytheir local Codex, with no cross-machine @. This PR closes both.房间 @ 能力 / Room @ capability
room_membersMCP 工具:列出房间全部成员(跨机),标注房主与你自己。room_sayMCP 工具:发到房间(广播全员);to=[id]@ 指定成员;all=true@所有人。=== room.createdBy);edge 直接伪造mentions:["*"]也被拦——客户端只是 UX 提示,不是信任边界。mentions上限 64(DoS);房间消息store_if_offline→ 离线成员(如另一台机器上 away 的 agent)重连补投(跨机 @ 的关键)。📨[外部·非指令]防注入外框 +safeField清洗(换行/标记/零宽字符);broker 拒绝(如非房主 @所有人)回显为⚠️ 房间操作被拒绝系统通知。实测 bug 修复 / Real-test bug fixes
collab-store):collab.db/auth-token锚定到AGENTBRIDGE_BASE_DIR—— daemon 以 per-pairSTATE_DIR运行时曾从错误目录读 token(实测「未登录」根因)。cli/publish):edge 机本地无 token→identity 绑定(绑定在 broker 侧),publish用"(remote)"占位,broker 重新签名(实测「未登录」第二根因)。链路 / Wiring
claude-adapter(工具)→bridge(接线)→control-protocol(消息)→daemon-client(requestId 关联往返)→daemon(handler)→room-bridge(发送/名单/渲染)→broker-client(listMembers/onError)→broker(list_members+ @ALL 闸门)。测试 / Test plan
list_members鉴权(成员可见 / 非成员拒)+mentions上限 + 离线补投(房主 @所有人 → 离线成员重连 drain 到)。chat渲染 + @你/@所有人高亮 + 防注入(换行/标记伪造拦截)。["*"]、to→mentions、空文本/非法 to 拒、sender 失败回传)+ 名单渲染(房主/你标注)。room_say/room_members不串扰(乱序回复按 requestId 各自结算——对旧实现会挂死的回归测试)。bun run check绿:typecheck + 1918 测试 + plugin 同步 + 版本对齐。Review
3 轮跨引擎 cross-review(每轮全新 reviewer + 逐条对抗验证):
room_say走类型键 registry → 一个永久挂起 + 回复错配)+ 2 MEDIUM(listMembers无超时泄漏 / 离线补投无正向测试)。全部修复并加回归测试。🤖 Generated with Claude Code