Repository navigation
fix(kimi): 免审批启动改用 --auto,--yolo 在新版 Kimi Code 已不再全部放行 - #2641
Merged
deepcoldy merged 1 commit intoOct 31, 2026
Merged
Conversation
Kimi Code 的 --yolo 语义被逐步收窄:0.28 起只自动批准常规工具调用, 2.0 起为 Ask When Needed(危险操作、提问、计划仍等人确认)。botmux 会话 无人值守,确认框会让回合停住。--auto(Never Ask)才是 disableCliBypass 所约定的「绕过 CLI 审批」,0.10.0 及以后的版本均有该参数。 disableCliBypass 为 true 时仍不传任何权限模式参数,行为不变。 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ninjalyl
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
October 31, 2026 15:46
Owner
|
感谢贡献,已 squash 合入 master(#2641)。 合入前对版本边界做了完整实测(逐版本下载 npm tarball 并实跑 argv 组合),留一个文档性 follow-up,不影响代码:
即真正受影响的只有 0.5.0 之前的早期版本(0.1.1–0.4.0),均为五个月前的发布且 Kimi Code 会自更新到 再次感谢,欢迎继续贡献。 |
deepcoldy
pushed a commit
that referenced
this pull request
Oct 31, 2026
解决与 #2602(沙盒凭据可见范围收紧)、#2641(Kimi --auto)的冲突: - docs-site 沙盒文档:#2602 的 ~/.botmux 白名单与安装目录遮罩描述原样保留, 示例 CLI 列表里的 Gemini 改为 Antigravity - test/fs-policy.test.ts:删掉 gemini 用例(#2602 已把它的兄弟 bot 凭证断言收紧为 deny),改为同样断言的 antigravity 用例,守住 ~/.gemini 整目录 authPaths - kimi-gemini-session-resume.test.ts 已改名为 kimi-session-resume.test.ts, 同步 #2641 的 --yolo → --auto Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@ninjalyl @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。 这次运行覆盖 42be61a…ae6796f90(4 个提交),同批合入的还有 #2644 #2602 #2560,失败不一定由本 PR 引起。
|
|
🚀 Released in v3.56.0 |
deepcoldy
pushed a commit
that referenced
this pull request
Nov 1, 2026
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.
背景
kimi适配器在disableCliBypass为 false(默认)时给 Kimi Code 传--yolo。按buildArgs的约定(disableCliBypass: "do not add adapter-default flags that bypass CLI approvals"),默认参数应当是「绕过 CLI 审批」,与 claude-code 的--dangerously-skip-permissions、codex 的--dangerously-bypass-approvals-and-sandbox对应。Kimi Code 早期的
--yolo确实是全部放行,但后来语义被逐步收窄,现在已不满足这个约定。实际表现:飞书群里让 Kimi 执行带rm -rf的收尾命令时,Kimi 弹出确认框(Dangerous: recursive delete)并停住;飞书侧无法作答,这一轮只能等人到终端里处理。各版本
--yolo/--auto的语义逐个下载
@moonshot-ai/kimi-code的 npm 包,读dist中的 commander 参数定义(只做文本检索,未执行):-y, --yolo--auto--yolo不再全部放行,2.0 起危险操作也要确认。--auto在 0.10.0 及以后的版本中都存在,含义都是自主运行、不停下等人确认。--auto里「Plan 模式下计划需审阅」这一例外不涉及。改动
src/adapters/cli/kimi.ts:disableCliBypass为 false 时传--auto,替换--yolo。disableCliBypass为 true 时仍不传任何权限模式参数,行为不变。影响面
kimi适配器的启动参数;其他 CLI、worker、IM 层不变。disableCliBypass。--auto的旧版 Kimi Code 会启动失败:已确认 0.1.1 没有该参数,0.10.0 起有(中间版本未逐个核对)。kimi-session.ts的会话恢复是按 0.31 验证的,仍在用 0.10 以前版本的部署应该很少,但值得在合并时确认。验证
--auto改回--yolo,2 项失败(kimi buildArgs默认参数、Kimi 会话恢复的参数序列)。test/worker-kimi-effort.integration.test.ts在本地 macOS 上无论改不改都失败(tmux socket 路径过长 / read-isolation 存活探测),未改动的 master 上同样失败,与本 PR 无关。--auto下危险命令的执行;语义依据是上表各版本的参数说明原文。与相关 PR 的关系
与 #2640 相互独立。#2640 解决的是「Kimi 停在确认框时 botmux 误判回合结束」;本 PR 解决的是「默认配置下 Kimi 不应该停在确认框」。两者都合入后,即使部署方设了
disableCliBypass,确认框期间也不会被误判为结束。🤖 Generated with Claude Code