Repository navigation
Conversation
Jjjanice
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
November 13, 2026 06:35
机器人回合带有上游签名委托、来源 Bot 配了 dispatchOnly 时,deliver 路由按策略 工具清单(而不是上游委托里实际能转派的工具)判定「本次有即时委派」,于是压掉了 自动附加的宿主预授权定时授权(botGrants)。上游委托与 dispatchOnly.tools 没有 交集时,结果是即时工具和定时授权都没有签,而改动前这种回合会照常附加定时授权。 现在只把上游委托里确实带有的 dispatchOnly 工具计入即时委派:能转派时照旧转派、 不附加自动定时授权;转派不出任何工具时回到原规则附加。补两条路由用例,并同步 ADR 中第二跳收窄规则与定时授权边界的描述。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
感谢贡献,这个 PR 已合入 master。 修复覆盖了 合并过程中补充并修复了一点,留一个已知 follow-up(不阻断当前行为):
以上为自动评审的初步意见与合并说明,最终以维护者审阅为准。欢迎继续贡献。 |
|
@Jjjanice @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 2c18ff1…370c992c3(2 个提交),同批合入的还有 #3451,失败不一定由本 PR 引起。
|
|
🚀 Released in v3.59.11 |
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.
背景与复现
dispatchOnly用于让来源 Bot 只在向指定目标派发时签发工具权限,来源 Bot 自己的tools可以保持为空。原实现有两处漏签:dispatchOnly却只检查内存中的activeInteractiveTurn。tools: []使普通dispatch在读取该委托前就判定“无需签发”;同机 @ 交接也会把dispatchOnly排除。两个场景的路由测试均在修复前复现了签名缺失。
改动
dispatchOnly的群、目标应用和工具白名单求交转派。来源 Bot 的tools: []不再阻断这条转派路径。dispatch与同机 @ 交接采用相同边界;同步更新 Proposed ADR。影响范围与安全边界
dispatchOnly只参与派发签名,不加入来源 Bot 自己的 CLI 工具身份。已签名的机器人回合只能转派上游已有的工具,仍需验证目标用户访问与群成员关系。**没有当前真人或有效上游签名的自动回合,不会借用会话中先前发言人的身份。**不修改凭据存储或工具适配器。验证
tools: []的已签名机器人转派、普通派发与同机 @ 交接;无签名、签名工具不匹配、目标不在白名单均拒绝新增凭据。node node_modules/vitest/vitest.mjs run test/dispatch-user-route.test.ts test/dispatch-user-mention-route.test.ts test/trigger-user-auth.test.ts test/dispatch-route-output-sink.test.ts(Node 22.23.2):171 项通过。bun run build(Node 22.23.2):通过;本地 Bun 1.3.14 与仓库指定的 1.4.4 不同,版本检查只提示告警。git diff --check:通过。最新 GitHub CI 结果以 Checks 页面为准。启用与验收
合并并发布含本 PR 的 Botmux 制品后,用真人直接触发和带签名的机器人转派各跑一次真实派发,回读来源签名工具集合,并在目标 Bot 验证对应工具及 Git 身份。当前 PR 尚未在生产生效。
补充说明(维护者)
评审中在本分支追加了提交
017b47d4e:dispatchOnly和宿主预授权定时授权(scheduleDelegation.botGrants)时,原实现按dispatchOnly.tools策略清单判定「本次有即时委派」,于是压掉了自动附加的定时授权。上游委托里的工具与dispatchOnly.tools没有交集时,结果是即时工具和定时授权都不签;而合入前,这种派发会照常附加定时授权。dispatchOnly工具计入即时委派。能转派时照旧转派、不附加自动定时授权(与「自动定时授权不覆盖即时委派」一致);转派不出任何工具时回到原规则。同机--mention交接不涉及定时授权,未改。dispatchOnly与宿主预授权定时授权的 Bot,在带上游签名委托、且委托里有可转派工具的机器人回合派发时,改为转派该工具、不再自动附加定时授权;需要定时授权时可显式--delegate schedule:create(仍按原授权规则)。test/dispatch-user-route.test.ts新增两例:可转派时签上游用户的工具、无定时授权;不可转派时附加宿主定时授权。去掉过滤、只认真人直连、忽略真人直连三种变异各自变红。dispatchOnly通道,定时授权边界补一句转派场景。bun run build通过;dispatch-user-route/dispatch-user-mention-route/trigger-user-auth/dispatch-route-output-sink/daemon-topic-source/dispatch-thread-id/test-hygiene共 277 项通过;Bun 1.4.4 下前三个文件 66 / 46 / 36 项通过。