From 3601b39d029fd7876f04921fa1054159c2aafbd9 Mon Sep 17 00:00:00 2001 From: Kaiyi Date: Fri, 17 Jul 2026 23:23:31 +0800 Subject: [PATCH 1/6] fix(tui): correct YOLO and Auto permission mode descriptions --- .changeset/fix-permission-mode-copy.md | 5 +++++ apps/kimi-code/src/tui/commands/config.ts | 8 ++++---- apps/kimi-code/src/tui/commands/registry.ts | 4 ++-- .../tui/components/dialogs/permission-selector.ts | 12 ++++++------ 4 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .changeset/fix-permission-mode-copy.md diff --git a/.changeset/fix-permission-mode-copy.md b/.changeset/fix-permission-mode-copy.md new file mode 100644 index 0000000000..6144060ec3 --- /dev/null +++ b/.changeset/fix-permission-mode-copy.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Fix the YOLO and Auto permission mode descriptions to match their actual behavior: YOLO auto-approves tool actions but the agent may still ask questions, while Auto is fully autonomous and never asks. diff --git a/apps/kimi-code/src/tui/commands/config.ts b/apps/kimi-code/src/tui/commands/config.ts index cda279dbc1..5cab011ea3 100644 --- a/apps/kimi-code/src/tui/commands/config.ts +++ b/apps/kimi-code/src/tui/commands/config.ts @@ -130,7 +130,7 @@ export async function handleYoloCommand(host: SlashCommandHost, args: string): P } await session.setPermission('yolo'); host.setAppState({ permissionMode: 'yolo' }); - host.showNotice('YOLO mode: ON', 'AI auto-approves safe actions, asks for approval on risky ones.'); + host.showNotice('YOLO mode: ON', 'Tool actions auto-approved; the agent may still ask you questions.'); return; } @@ -153,7 +153,7 @@ export async function handleYoloCommand(host: SlashCommandHost, args: string): P } else { await session.setPermission('yolo'); host.setAppState({ permissionMode: 'yolo' }); - host.showNotice('YOLO mode: ON', 'AI auto-approves safe actions, asks for approval on risky ones.'); + host.showNotice('YOLO mode: ON', 'Tool actions auto-approved; the agent may still ask you questions.'); } } @@ -174,7 +174,7 @@ export async function handleAutoCommand(host: SlashCommandHost, args: string): P } await session.setPermission('auto'); host.setAppState({ permissionMode: 'auto' }); - host.showNotice('Auto mode: ON', 'Run all actions automatically, including risky ones.'); + host.showNotice('Auto mode: ON', 'All actions auto-approved; the agent will not ask you questions.'); return; } @@ -197,7 +197,7 @@ export async function handleAutoCommand(host: SlashCommandHost, args: string): P } else { await session.setPermission('auto'); host.setAppState({ permissionMode: 'auto' }); - host.showNotice('Auto mode: ON', 'Run all actions automatically, including risky ones.'); + host.showNotice('Auto mode: ON', 'All actions auto-approved; the agent will not ask you questions.'); } } diff --git a/apps/kimi-code/src/tui/commands/registry.ts b/apps/kimi-code/src/tui/commands/registry.ts index 037d2477a7..34556f7e62 100644 --- a/apps/kimi-code/src/tui/commands/registry.ts +++ b/apps/kimi-code/src/tui/commands/registry.ts @@ -136,14 +136,14 @@ export const BUILTIN_SLASH_COMMANDS = [ { name: 'yolo', aliases: ['yes'], - description: 'Toggle YOLO mode: AI auto-approves safe actions, asks for approval on risky ones.', + description: 'Toggle YOLO mode: auto-approve tool actions, but the agent may still ask questions.', priority: 101, availability: 'always', }, { name: 'auto', aliases: [], - description: 'Toggle Auto mode: run all actions automatically, including risky ones.', + description: 'Toggle Auto mode: fully autonomous, agent decides everything without asking.', priority: 99, availability: 'always', }, diff --git a/apps/kimi-code/src/tui/components/dialogs/permission-selector.ts b/apps/kimi-code/src/tui/components/dialogs/permission-selector.ts index 4b2db673d3..c130987835 100644 --- a/apps/kimi-code/src/tui/components/dialogs/permission-selector.ts +++ b/apps/kimi-code/src/tui/components/dialogs/permission-selector.ts @@ -8,15 +8,15 @@ const PERMISSION_OPTIONS: readonly ChoiceOption[] = [ label: 'Manual', description: 'Approve every action yourself.', }, - { - value: 'auto', - label: 'Auto', - description: 'Run all actions automatically, including risky ones.', - }, { value: 'yolo', label: 'YOLO', - description: 'AI decides which actions need your approval.', + description: 'Auto-approve tool actions, but the agent may still ask questions.', + }, + { + value: 'auto', + label: 'Auto', + description: 'Fully autonomous — agent decides everything without asking.', }, ]; From 09b36957aa599c173569debfdfe49333e3f3778c Mon Sep 17 00:00:00 2001 From: Kaiyi Date: Fri, 17 Jul 2026 23:38:08 +0800 Subject: [PATCH 2/6] fix: unify YOLO and Auto permission mode descriptions across CLI, ACP, web, and docs --- .changeset/fix-permission-copy-cli-acp.md | 5 +++++ .changeset/fix-permission-copy-web.md | 5 +++++ apps/kimi-code/src/cli/commands.ts | 4 ++-- apps/kimi-web/src/i18n/locales/en/commands.ts | 4 ++-- apps/kimi-web/src/i18n/locales/en/mobile.ts | 4 ++-- apps/kimi-web/src/i18n/locales/zh/commands.ts | 4 ++-- apps/kimi-web/src/i18n/locales/zh/mobile.ts | 4 ++-- apps/vscode/package.json | 2 +- apps/vscode/src/handlers/config.handler.ts | 2 +- docs/en/configuration/config-files.md | 2 +- docs/en/configuration/overrides.md | 3 ++- docs/zh/configuration/config-files.md | 2 +- docs/zh/configuration/overrides.md | 3 ++- packages/acp-adapter/src/modes.ts | 4 ++-- 14 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 .changeset/fix-permission-copy-cli-acp.md create mode 100644 .changeset/fix-permission-copy-web.md diff --git a/.changeset/fix-permission-copy-cli-acp.md b/.changeset/fix-permission-copy-cli-acp.md new file mode 100644 index 0000000000..e1cef27931 --- /dev/null +++ b/.changeset/fix-permission-copy-cli-acp.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Correct the YOLO and Auto permission mode descriptions in CLI --help output and in the ACP session mode selector shown by IDE clients. diff --git a/.changeset/fix-permission-copy-web.md b/.changeset/fix-permission-copy-web.md new file mode 100644 index 0000000000..21a9393061 --- /dev/null +++ b/.changeset/fix-permission-copy-web.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +web: Correct the YOLO and Auto permission mode descriptions in the slash command list and the mobile permission sheet. diff --git a/apps/kimi-code/src/cli/commands.ts b/apps/kimi-code/src/cli/commands.ts index 32a65eb0e0..960c707a6c 100644 --- a/apps/kimi-code/src/cli/commands.ts +++ b/apps/kimi-code/src/cli/commands.ts @@ -46,8 +46,8 @@ export function createProgram( ) .option('-c, --continue', 'Continue the previous session for the working directory.', false) .addOption(new Option('-C').hideHelp().default(false)) - .option('-y, --yolo', 'Automatically approve all actions.', false) - .option('--auto', 'Start in auto permission mode.', false) + .option('-y, --yolo', 'Auto-approve regular tool calls; the agent may still ask questions.', false) + .option('--auto', 'Start in auto permission mode: fully autonomous, the agent will not ask questions.', false) .addOption( new Option( '-m, --model ', diff --git a/apps/kimi-web/src/i18n/locales/en/commands.ts b/apps/kimi-web/src/i18n/locales/en/commands.ts index 1b76d0c8a9..ef44f0f06a 100644 --- a/apps/kimi-web/src/i18n/locales/en/commands.ts +++ b/apps/kimi-web/src/i18n/locales/en/commands.ts @@ -6,8 +6,8 @@ export default { swarm: { desc: 'Toggle swarm mode; /swarm runs a task in swarm' }, goal: { desc: 'Create/control a goal: /goal , /goal pause|resume|cancel' }, btw: { desc: 'Side chat: /btw asks a forked side session' }, - yolo: { desc: 'Auto-approve everything (yolo mode)' }, - auto: { desc: 'Auto-approve safe edits/reads' }, + yolo: { desc: 'Auto-approve tool actions; the agent may still ask questions' }, + auto: { desc: 'Fully autonomous — the agent never asks questions' }, thinking: { desc: 'Set the thinking level' }, compact: { desc: 'Compact the conversation history' }, fork: { desc: 'Fork this session into a new one' }, diff --git a/apps/kimi-web/src/i18n/locales/en/mobile.ts b/apps/kimi-web/src/i18n/locales/en/mobile.ts index ae60023dd6..d5642b40f0 100644 --- a/apps/kimi-web/src/i18n/locales/en/mobile.ts +++ b/apps/kimi-web/src/i18n/locales/en/mobile.ts @@ -12,8 +12,8 @@ export default { sessionCount: '{n} sessions', newSession: 'New session', permManualSub: 'confirm every tool', - permAutoSub: 'auto-approve edits', - permYoloSub: 'auto-approve all', + permAutoSub: 'fully autonomous, never asks', + permYoloSub: 'auto-approve tools, may still ask', planModeSub: 'Plan mode', swarmModeSub: 'Swarm mode', archivedSessions: 'Archived sessions', diff --git a/apps/kimi-web/src/i18n/locales/zh/commands.ts b/apps/kimi-web/src/i18n/locales/zh/commands.ts index ebb8b2d9ad..c3b753004f 100644 --- a/apps/kimi-web/src/i18n/locales/zh/commands.ts +++ b/apps/kimi-web/src/i18n/locales/zh/commands.ts @@ -6,8 +6,8 @@ export default { swarm: { desc: '切换 swarm 模式;/swarm <任务> 直接在 swarm 下执行' }, goal: { desc: '创建/控制目标:/goal <目标>、/goal pause|resume|cancel' }, btw: { desc: '侧边聊天:/btw <问题> 向 fork 的侧边会话提问' }, - yolo: { desc: '自动批准一切 (yolo 模式)' }, - auto: { desc: '自动批准安全的读写' }, + yolo: { desc: '自动批准工具操作,Agent 仍可能提问' }, + auto: { desc: '完全自主,Agent 不再提问' }, thinking: { desc: '设置思考强度' }, compact: { desc: '压缩会话历史' }, fork: { desc: '把当前会话 fork 出一个新会话' }, diff --git a/apps/kimi-web/src/i18n/locales/zh/mobile.ts b/apps/kimi-web/src/i18n/locales/zh/mobile.ts index 22799adf2f..51b964c1cb 100644 --- a/apps/kimi-web/src/i18n/locales/zh/mobile.ts +++ b/apps/kimi-web/src/i18n/locales/zh/mobile.ts @@ -12,8 +12,8 @@ export default { sessionCount: '{n} 个会话', newSession: '新建会话', permManualSub: '每个工具都确认', - permAutoSub: '自动批准编辑', - permYoloSub: '全部自动批准', + permAutoSub: '完全自主,不再提问', + permYoloSub: '自动批准工具,仍可能提问', planModeSub: '计划模式', swarmModeSub: 'Swarm 模式', archivedSessions: '已归档会话', diff --git a/apps/vscode/package.json b/apps/vscode/package.json index e43492e4d4..b243c8a9ad 100644 --- a/apps/vscode/package.json +++ b/apps/vscode/package.json @@ -54,7 +54,7 @@ "kimi.yoloMode": { "type": "boolean", "default": false, - "description": "Auto-approve all tool calls" + "description": "Auto-approve regular tool calls; the agent may still ask questions" }, "kimi.autosave": { "type": "boolean", diff --git a/apps/vscode/src/handlers/config.handler.ts b/apps/vscode/src/handlers/config.handler.ts index 705edaa205..ad4c855f0a 100644 --- a/apps/vscode/src/handlers/config.handler.ts +++ b/apps/vscode/src/handlers/config.handler.ts @@ -20,7 +20,7 @@ const SLASH_COMMANDS: SlashCommandInfo[] = [ { name: "init", aliases: [], description: "Analyze the codebase and generate AGENTS.md" }, { name: "compact", aliases: [], description: "Compact the conversation context" }, { name: "clear", aliases: ["reset"], description: "Clear the context" }, - { name: "yolo", aliases: [], description: "Toggle YOLO mode (auto-approve all actions)" }, + { name: "yolo", aliases: [], description: "Toggle YOLO mode (auto-approve tool actions; may still ask questions)" }, { name: "afk", aliases: [], diff --git a/docs/en/configuration/config-files.md b/docs/en/configuration/config-files.md index 59504ec0b4..141d021fa0 100644 --- a/docs/en/configuration/config-files.md +++ b/docs/en/configuration/config-files.md @@ -98,7 +98,7 @@ Fields in the config file fall into two categories: **top-level scalars** that d | Field | Type | Default | Description | | --- | --- | --- | --- | | `default_model` | `string` | — | Default model alias; must be defined in `models` | -| `default_permission_mode` | `string` | `manual` | Default permission mode for new sessions; one of `manual` (prompt each time), `auto` (auto-approve read operations), or `yolo` (auto-approve everything) | +| `default_permission_mode` | `string` | `manual` | Default permission mode for new sessions; one of `manual` (prompt each time), `yolo` (auto-approve tool actions, but the agent may still ask questions), or `auto` (fully autonomous — the agent decides everything without asking) | | `default_plan_mode` | `boolean` | `false` | Whether new sessions start in Plan mode (produce a plan before executing) by default | | `merge_all_available_skills` | `boolean` | `true` | Whether to merge Agent Skills from all available directories | | `extra_skill_dirs` | `array` | — | Extra skill search directories, layered on top of the default directories | diff --git a/docs/en/configuration/overrides.md b/docs/en/configuration/overrides.md index 0e7e34ca9e..717b5d0dc5 100644 --- a/docs/en/configuration/overrides.md +++ b/docs/en/configuration/overrides.md @@ -55,7 +55,8 @@ Options passed at startup have the highest priority and apply only to the curren | --- | --- | | `-S, --session [id]` | Resume a specific session; enters interactive selection when no id is given | | `-c, --continue` | Resume the last session for the current working directory | -| `-y, --yolo` | Auto-approve all tool calls | +| `-y, --yolo` | Auto-approve regular tool calls; the agent may still ask questions | +| `--auto` | Start in auto permission mode: fully autonomous, the agent will not ask questions | | `--plan` | Start in Plan mode | | `-m, --model ` | Use a specific model alias for this session | | `-p, --prompt ` | Run in non-interactive mode: execute a single prompt and exit | diff --git a/docs/zh/configuration/config-files.md b/docs/zh/configuration/config-files.md index 07ccfcf1be..496c9c571d 100644 --- a/docs/zh/configuration/config-files.md +++ b/docs/zh/configuration/config-files.md @@ -98,7 +98,7 @@ timeout = 5 | 字段 | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | `default_model` | `string` | — | 默认模型别名,必须在 `models` 中定义 | -| `default_permission_mode` | `string` | `manual` | 新会话的默认权限模式,可选 `manual`(逐次询问)、`auto`(自动批准读操作)、`yolo`(全部自动批准) | +| `default_permission_mode` | `string` | `manual` | 新会话的默认权限模式,可选 `manual`(逐次询问)、`yolo`(自动批准工具操作,Agent 仍可能提问)、`auto`(完全自主,Agent 自己做决定,不再提问) | | `default_plan_mode` | `boolean` | `false` | 新会话是否默认以 Plan 模式(先出计划再执行)启动 | | `merge_all_available_skills` | `boolean` | `true` | 是否合并所有目录中的 Agent Skills | | `extra_skill_dirs` | `array` | — | 额外 Skill 搜索目录,叠加到默认目录之上 | diff --git a/docs/zh/configuration/overrides.md b/docs/zh/configuration/overrides.md index 92eb0b1387..4194fe5214 100644 --- a/docs/zh/configuration/overrides.md +++ b/docs/zh/configuration/overrides.md @@ -55,7 +55,8 @@ Kimi Code CLI 有三个地方可以影响运行参数:配置文件、命令行 | --- | --- | | `-S, --session [id]` | 恢复指定会话;不带 id 时进入交互式选择 | | `-c, --continue` | 续上当前目录的上一次会话 | -| `-y, --yolo` | 自动批准所有工具调用 | +| `-y, --yolo` | 自动批准普通工具调用,Agent 仍可能提问 | +| `--auto` | 以 auto 权限模式启动:完全自主,Agent 不会向用户提问 | | `--plan` | 以 Plan 模式启动 | | `-m, --model ` | 指定本次使用的模型别名 | | `-p, --prompt ` | 非交互模式:执行单条提示词后退出 | diff --git a/packages/acp-adapter/src/modes.ts b/packages/acp-adapter/src/modes.ts index c0f4e0168c..48e2771ca6 100644 --- a/packages/acp-adapter/src/modes.ts +++ b/packages/acp-adapter/src/modes.ts @@ -39,12 +39,12 @@ export const ACP_MODES = [ { id: 'auto', name: 'Auto', - description: 'Auto-approve safe operations.', + description: 'Fully autonomous — agent decides everything without asking.', }, { id: 'yolo', name: 'YOLO', - description: 'Auto-approve everything.', + description: 'Auto-approve tool actions, but the agent may still ask questions.', }, ] as const satisfies readonly SessionMode[]; From 04b1305dbb79c75c46d4cf133753da2a8cdd0ba4 Mon Sep 17 00:00:00 2001 From: Kaiyi Date: Fri, 17 Jul 2026 23:46:49 +0800 Subject: [PATCH 3/6] docs: correct YOLO and Auto mode descriptions in the interaction guide --- docs/en/guides/interaction.md | 6 +++--- docs/zh/guides/interaction.md | 6 +++--- .../src/agent/permissionMode/permissionModeService.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/en/guides/interaction.md b/docs/en/guides/interaction.md index c49aa9ab2b..ff59fe8b23 100644 --- a/docs/en/guides/interaction.md +++ b/docs/en/guides/interaction.md @@ -37,7 +37,7 @@ Type `@` to trigger file-path completion. Selecting a path inserts its relative ## Approval flow -When the agent calls a tool that has side effects — modifying files, running commands — the TUI displays an approval panel for your confirmation. Approvals are not triggered in YOLO mode, nor for writes to plan files in Plan mode. +When the agent calls a tool that has side effects — modifying files, running commands — the TUI displays an approval panel for your confirmation. Approvals are not triggered for regular tool calls in YOLO mode, nor for writes to plan files in Plan mode. Use the arrow keys to select an option and press `Enter` to confirm, or press `1` / `2` / `3` to select by number directly. `Esc`, `Ctrl-C`, and `Ctrl-D` are all equivalent to rejecting. @@ -56,9 +56,9 @@ After producing a plan the agent pauses for your review — you can approve it, ### YOLO / Auto mode -**YOLO mode** (`/yolo`) skips the approval confirmation for almost all tool calls, making it suitable for batch tasks you know are safe. The one exception is the exit-confirmation for Plan mode. +**YOLO mode** (`/yolo`) auto-approves regular tool calls, making it suitable for batch tasks you know are safe. It still asks before sensitive actions — accessing sensitive files such as `.env` or SSH keys, or exiting Plan mode — and the agent can still ask you questions. -**Auto mode** (`/auto`) is more restrained: tool approvals are handled automatically, but the agent does not ask the user clarifying questions — useful when you want unattended operation without fully disabling approvals. +**Auto mode** (`/auto`) is the fully unattended mode: every tool approval is handled automatically, including sensitive files and plan exits, and the agent never asks you questions — it decides everything on its own. ::: warning YOLO mode skips confirmation for file writes and command execution. Only use it in working directories you trust. diff --git a/docs/zh/guides/interaction.md b/docs/zh/guides/interaction.md index cefc383839..628525e9de 100644 --- a/docs/zh/guides/interaction.md +++ b/docs/zh/guides/interaction.md @@ -37,7 +37,7 @@ Kimi Code CLI 支持在输入框中直接粘贴图片和视频,让 AI 结合 ## 审批流程 -Agent 调用会产生副作用的工具(修改文件、执行命令等)时,TUI 会弹出审批面板让你确认。YOLO 模式以及 Plan 模式下对计划文件的写入不触发审批。 +Agent 调用会产生副作用的工具(修改文件、执行命令等)时,TUI 会弹出审批面板让你确认。YOLO 模式下的普通工具调用,以及 Plan 模式下对计划文件的写入,不触发审批。 用方向键选择选项,`Enter` 确认;也可以按 `1`/`2`/`3` 数字键直接选择。`Esc`、`Ctrl-C`、`Ctrl-D` 等同于拒绝。 @@ -56,9 +56,9 @@ Agent 输出方案后会等待你审批——可批准执行、拒绝、或要 ### YOLO / Auto 模式 -**YOLO 模式**(`/yolo`)跳过几乎所有工具调用的审批确认,适合已知安全的批处理任务,Plan 模式的退出审批除外。 +**YOLO 模式**(`/yolo`)自动批准普通工具调用,适合已知安全的批处理任务。敏感操作仍会询问——例如访问 `.env`、SSH 私钥等敏感文件,或退出 Plan 模式——Agent 也仍可能向你提问。 -**Auto 模式**(`/auto`)则更克制:工具审批自动处理,但 Agent 不会向用户提问,适合需要无人值守但又不想完全关闭审批的场景。 +**Auto 模式**(`/auto`)是完全无人值守模式:所有工具审批自动处理,包括敏感文件和计划退出,且 Agent 不会向你提问,完全由它自己做决定。 ::: warning 注意 YOLO 模式会跳过文件写入和命令执行的确认,请只在受信任的工作目录下使用。 diff --git a/packages/agent-core-v2/src/agent/permissionMode/permissionModeService.ts b/packages/agent-core-v2/src/agent/permissionMode/permissionModeService.ts index 81f7acce7b..ccea4c55da 100644 --- a/packages/agent-core-v2/src/agent/permissionMode/permissionModeService.ts +++ b/packages/agent-core-v2/src/agent/permissionMode/permissionModeService.ts @@ -1,7 +1,7 @@ /** * `permissionMode` domain (L3) — `IAgentPermissionModeService` implementation. * - * Holds the agent's permission mode (`manual` / `auto`) in the `wire` + * Holds the agent's permission mode (`manual` / `yolo` / `auto`) in the `wire` * `PermissionModeModel`, mutating it only through the `permission.set_mode` Op * (`wire.dispatch(setMode({ mode }))`) and reading it through `wire.getModel`. * `setMode` emits `onDidChangeMode` after an actual change, and mode-aware From 2872c4739ed85043c3c77b6ffe616a28ccf47da4 Mon Sep 17 00:00:00 2001 From: Kaiyi Date: Fri, 17 Jul 2026 23:56:26 +0800 Subject: [PATCH 4/6] fix: correct YOLO mode notices in session replay and vscode extension --- .changeset/fix-yolo-replay-copy.md | 5 +++++ apps/kimi-code/src/tui/controllers/session-replay.ts | 2 +- apps/vscode/src/handlers/slash-command.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/fix-yolo-replay-copy.md diff --git a/.changeset/fix-yolo-replay-copy.md b/.changeset/fix-yolo-replay-copy.md new file mode 100644 index 0000000000..cd7c14ba62 --- /dev/null +++ b/.changeset/fix-yolo-replay-copy.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Correct the YOLO mode notice shown when replaying a session: tool actions are auto-approved, but the agent may still ask questions. diff --git a/apps/kimi-code/src/tui/controllers/session-replay.ts b/apps/kimi-code/src/tui/controllers/session-replay.ts index 00ee5a64b5..ad6e82358b 100644 --- a/apps/kimi-code/src/tui/controllers/session-replay.ts +++ b/apps/kimi-code/src/tui/controllers/session-replay.ts @@ -569,7 +569,7 @@ export class SessionReplayRenderer { if (mode === 'yolo') { this.host.appendTranscriptEntry( replayEntry(context, 'status', 'YOLO mode: ON', 'notice', { - detail: 'All actions will be approved automatically. Use with caution.', + detail: 'Tool actions auto-approved; the agent may still ask you questions.', }), ); return; diff --git a/apps/vscode/src/handlers/slash-command.ts b/apps/vscode/src/handlers/slash-command.ts index e23c9ac1d6..52ae11df4d 100644 --- a/apps/vscode/src/handlers/slash-command.ts +++ b/apps/vscode/src/handlers/slash-command.ts @@ -120,7 +120,7 @@ async function toggleLegacyPermission( if (kind === "yolo") { emit(flags.yolo - ? "You only live once! All actions will be auto-approved." + ? "You only live once! Tool actions will be auto-approved; the agent may still ask questions." : flags.afk ? "Yolo disabled, but afk is still on — tool calls remain auto-approved." : "You only die once! Actions will require approval."); From d1b1645c688be837634ce21f1ac5902a782c64e9 Mon Sep 17 00:00:00 2001 From: Kaiyi Date: Sat, 18 Jul 2026 00:40:34 +0800 Subject: [PATCH 5/6] feat(vscode): rename /afk command to /auto, keeping afk as hidden alias Also correct the stale 'afk' mode reference in the built-in MCP config skill guidance of both agent engines. --- .changeset/fix-afk-naming.md | 5 +++++ apps/vscode/src/handlers/config.handler.ts | 6 +++--- apps/vscode/src/handlers/slash-command.ts | 10 ++++++---- apps/vscode/test/kimi-harness.integration.test.ts | 2 +- .../src/app/skillCatalog/builtin/mcp-config.md | 2 +- packages/agent-core/src/skill/builtin/mcp-config.md | 2 +- 6 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .changeset/fix-afk-naming.md diff --git a/.changeset/fix-afk-naming.md b/.changeset/fix-afk-naming.md new file mode 100644 index 0000000000..864b621392 --- /dev/null +++ b/.changeset/fix-afk-naming.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Rename the stale "afk" reference to "auto" in the built-in MCP config skill guidance. diff --git a/apps/vscode/src/handlers/config.handler.ts b/apps/vscode/src/handlers/config.handler.ts index ad4c855f0a..1e811ef6d4 100644 --- a/apps/vscode/src/handlers/config.handler.ts +++ b/apps/vscode/src/handlers/config.handler.ts @@ -22,9 +22,9 @@ const SLASH_COMMANDS: SlashCommandInfo[] = [ { name: "clear", aliases: ["reset"], description: "Clear the context" }, { name: "yolo", aliases: [], description: "Toggle YOLO mode (auto-approve tool actions; may still ask questions)" }, { - name: "afk", - aliases: [], - description: "Toggle afk mode (auto-dismiss questions and auto-approve tool calls)", + name: "auto", + aliases: ["afk"], + description: "Toggle Auto mode (fully autonomous; the agent will not ask questions)", }, { name: "plan", aliases: [], description: "Toggle plan mode. Usage: /plan [on|off|view|clear]" }, { diff --git a/apps/vscode/src/handlers/slash-command.ts b/apps/vscode/src/handlers/slash-command.ts index 52ae11df4d..087c823fb0 100644 --- a/apps/vscode/src/handlers/slash-command.ts +++ b/apps/vscode/src/handlers/slash-command.ts @@ -19,6 +19,7 @@ const HOST_COMMANDS = new Set([ "clear", "reset", "yolo", + "auto", "afk", "plan", "add-dir", @@ -84,6 +85,7 @@ export async function runHostSlashCommand( case "yolo": await toggleLegacyPermission(runtime, "yolo", emit); break; + case "auto": case "afk": await toggleLegacyPermission(runtime, "afk", emit); break; @@ -122,15 +124,15 @@ async function toggleLegacyPermission( emit(flags.yolo ? "You only live once! Tool actions will be auto-approved; the agent may still ask questions." : flags.afk - ? "Yolo disabled, but afk is still on — tool calls remain auto-approved." + ? "Yolo disabled, but Auto is still on — tool calls remain auto-approved." : "You only die once! Actions will require approval."); return; } emit(flags.afk - ? "afk mode enabled. Questions will be auto-dismissed and tool calls auto-approved." + ? "Auto mode enabled. Questions will be auto-dismissed and tool calls auto-approved." : flags.yolo - ? "afk mode disabled. You are back at the keyboard. Yolo is still on." - : "afk mode disabled. You are back at the keyboard."); + ? "Auto mode disabled. You are back at the keyboard. Yolo is still on." + : "Auto mode disabled. You are back at the keyboard."); } async function runPlanCommand( diff --git a/apps/vscode/test/kimi-harness.integration.test.ts b/apps/vscode/test/kimi-harness.integration.test.ts index d5f1e725c6..21c466b84e 100644 --- a/apps/vscode/test/kimi-harness.integration.test.ts +++ b/apps/vscode/test/kimi-harness.integration.test.ts @@ -369,7 +369,7 @@ describe("VS Code Kimi harness integration (shares one in-process SDK home)", () "compact", "clear", "yolo", - "afk", + "auto", "plan", "add-dir", "export", diff --git a/packages/agent-core-v2/src/app/skillCatalog/builtin/mcp-config.md b/packages/agent-core-v2/src/app/skillCatalog/builtin/mcp-config.md index 1a38ebd26e..0e2fe7f41e 100644 --- a/packages/agent-core-v2/src/app/skillCatalog/builtin/mcp-config.md +++ b/packages/agent-core-v2/src/app/skillCatalog/builtin/mcp-config.md @@ -108,7 +108,7 @@ For changes, the flow is: currently in it, and the entry you're about to write or delete. This is for transparency, not a confirmation gate — the Edit/Write permission prompt is the real gate, and your message is what gives - the user context when that prompt appears. In yolo / afk modes there + the user context when that prompt appears. In yolo / auto modes there is no prompt, which is those modes' explicit contract. 3. **Write and tell them how to reload MCP servers.** Preserve unrelated entries and the `mcpServers` wrapper. MCP servers load at session diff --git a/packages/agent-core/src/skill/builtin/mcp-config.md b/packages/agent-core/src/skill/builtin/mcp-config.md index 1a38ebd26e..0e2fe7f41e 100644 --- a/packages/agent-core/src/skill/builtin/mcp-config.md +++ b/packages/agent-core/src/skill/builtin/mcp-config.md @@ -108,7 +108,7 @@ For changes, the flow is: currently in it, and the entry you're about to write or delete. This is for transparency, not a confirmation gate — the Edit/Write permission prompt is the real gate, and your message is what gives - the user context when that prompt appears. In yolo / afk modes there + the user context when that prompt appears. In yolo / auto modes there is no prompt, which is those modes' explicit contract. 3. **Write and tell them how to reload MCP servers.** Preserve unrelated entries and the `mcpServers` wrapper. MCP servers load at session From 29d8b3d28823a2d5d59d0b3b8181fd1b27000ed5 Mon Sep 17 00:00:00 2001 From: Kaiyi Date: Sat, 18 Jul 2026 01:18:10 +0800 Subject: [PATCH 6/6] fix(vscode): forward engine approval requests instead of blanket-approving them The extension-level approval handler auto-approved every request when legacy yolo/afk was on, silently swallowing the sensitive-file, plan-review, and ask-rule prompts the engine yolo mode still sends. Forward every request to the user and let the engine permission mode do the auto-approving, matching TUI and web behavior. --- apps/vscode/src/runtime/session-runtime.ts | 10 +++++----- apps/vscode/test/session-runtime.test.ts | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/apps/vscode/src/runtime/session-runtime.ts b/apps/vscode/src/runtime/session-runtime.ts index 22a6536bba..a3bd2b4615 100644 --- a/apps/vscode/src/runtime/session-runtime.ts +++ b/apps/vscode/src/runtime/session-runtime.ts @@ -98,11 +98,11 @@ export class SessionRuntime { this.legacyApproval = options.legacyApproval; this.reverseRpc = new ReverseRpcController((event) => this.emitStreamEvent(event)); - this.session.setApprovalHandler((request) => - this.legacyApproval.yolo || this.legacyApproval.afk - ? Promise.resolve({ decision: "approved" }) - : this.reverseRpc.requestApproval(request), - ); + // Forward every approval request to the user. The engine permission mode + // (mapped from the legacy flags) already auto-approves what yolo/auto + // allow internally; anything that reaches this handler is an exception + // (sensitive file, plan review, ask rule) the user must decide on. + this.session.setApprovalHandler((request) => this.reverseRpc.requestApproval(request)); this.session.setQuestionHandler((request) => this.reverseRpc.requestQuestion(request)); this.unsubscribe = this.session.onEvent((event) => this.onSdkEvent(event)); } diff --git a/apps/vscode/test/session-runtime.test.ts b/apps/vscode/test/session-runtime.test.ts index b392204fde..640277273a 100644 --- a/apps/vscode/test/session-runtime.test.ts +++ b/apps/vscode/test/session-runtime.test.ts @@ -570,18 +570,24 @@ describe("session runtime (adapts one SDK session for subscribed Webviews)", () await expect(pending).resolves.toEqual(expected); }); - it("auto-approves SDK approval requests in legacy yolo mode", async () => { - const { sdk, broadcasts } = createRuntime({ yolo: true, afk: false }); - - await expect(sdk.requestApproval({ + it("forwards SDK approval requests to the Webview in legacy yolo mode", async () => { + const { runtime, sdk, broadcasts } = createRuntime({ yolo: true, afk: false }); + const pending = sdk.requestApproval({ toolCallId: "tool-yolo", toolName: "Bash", action: "Run command", display: { kind: "command", command: "pnpm test" }, - })).resolves.toEqual({ decision: "approved" }); - expect(streamData(broadcasts)).not.toContainEqual( - expect.objectContaining({ type: "ApprovalRequest" }), - ); + }); + const request = streamData(broadcasts).find( + (event) => + typeof event === "object" && + event !== null && + "type" in event && + event.type === "ApprovalRequest", + ) as { payload: { id: string } }; + + expect(runtime.respondApproval(request.payload.id, "approve")).toBe(true); + await expect(pending).resolves.toEqual({ decision: "approved" }); }); it("restores core permission when a legacy flag cannot be persisted", async () => {