refactor(cli): rename "Default" approval mode to "Ask permissions" (#4625)#4674
Conversation
The "Default" label only described that this mode was the baseline, not what behavior it grants. Rename the user-visible label to "Ask permissions" to clearly communicate that every action requires manual approval, matching the convention Claude Code uses. The internal enum value (`ApprovalMode.DEFAULT`), the serialized settings value (`tools.approvalMode: "default"`), and the CLI identifier (`/approval-mode default`) are preserved for backward compatibility — existing settings.json files and CLI invocations keep working unchanged. UI surfaces updated: - Settings dialog "Tool Approval Mode" option - /approval-mode picker dialog (DEFAULT entry shows "Ask permissions" while other modes keep their existing display) - i18n translations for 9 locales (en, zh, zh-TW, de, fr, ja, pt, ru, ca) - docs/users/features/approval-mode.md with a migration note Closes #4625
📋 Review SummaryThis PR renames the "Default" approval mode to "Ask permissions" in user-facing UI while maintaining backward compatibility with the internal 🔍 General Feedback
🎯 Specific Feedback🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
pomelo-nwu
left a comment
There was a problem hiding this comment.
Stage 1: Template Gate
@LaZzyMan Thank you for this PR — the rename scope looks well-considered.
However, the PR body does not follow the required template. The following headings are missing or renamed:
## What this PR does— the PR uses## Summaryinstead. Please rename this heading to match the template exactly.## Why it's needed— the PR uses## What changedinstead, which describes the diff rather than the motivation. Please add a## Why it's neededsection explaining the user-facing problem or product rationale (e.g. "Default was ambiguous because…").### Evidence (Before & After)— completely missing under## Reviewer Test Plan. Since this is a UI-visible rename (settings dialog,/approval-modepicker), please add before/after screenshots or tmux output showing the label change. For non-UI changes,N/Ais acceptable.
The existing ## Reviewer Test Plan section is present and well-written — thank you.
Please update the PR body to match the template headings exactly, then re-request review.
中文说明
@LaZzyMan 感谢这个 PR,rename 的范围控制得很好。
但 PR body 没有遵循项目 PR 模板,以下标题缺失或被改名:
## What this PR does— PR 里写的是## Summary,请改回模板中的标题。## Why it's needed— PR 里写的是## What changed,这是描述改动内容而非动机。请添加一个## Why it's needed段落,说明用户侧的问题或产品考量(比如"Default 这个名字让用户无法理解模式的实际行为")。### Evidence (Before & After)— 在## Reviewer Test Plan下完全缺失。由于这是一个 UI 可见的改名(settings 对话框、/approval-mode选择器),请添加改动前后的截图或 tmux 输出。非 UI 改动可以填N/A。
已有的 ## Reviewer Test Plan 部分存在且写得不错,谢谢。
请按模板标题修正 PR body,然后重新请求 review。
— Qwen Code
Aligns the migration note style with existing tip/warning callouts in the same document so it renders distinctly from a plain blockquote.
|
Thanks for the review. Per-finding response: 🟢 Medium — 🟢 Medium — 🔵 Low — 🔵 Low — 🔵 Low — |
|
@pomelo-nwu PR body updated to follow the template headings ( |
|
@LaZzyMan Thanks for the PR — the rename scope looks well-considered. Template now follows the required headings ( On direction: this is a clean UX improvement. "Default" is a meta-concept that tells users nothing about what the mode actually authorizes — every other mode name describes behavior, and On approach: the scope is tight — display labels only, internal enum/serialization/CLI keyword untouched. That's exactly right. The Moving on to code review and testing. 🔍 中文说明@LaZzyMan 感谢 PR,rename 范围控制得很好。 模板已按要求的标题更新( 方向:这是一个干净的 UX 改进。"Default" 是个 meta 概念,无法告诉用户该模式实际授予什么权限——其它模式名都描述行为,唯独 方案:范围紧凑——只改显示标签,内部枚举/序列化值/CLI 关键词不动,完全正确。 进入代码审查和测试阶段 🔍 — Qwen Code · qwen3.7-max |
|
Code Review Reviewed the diff against an independent proposal: I would have added a No critical blockers found. The change is pure display-label plumbing: one helper function, one schema string swap, nine locale key renames, ten snapshot regenerations, and a docs update. No correctness issues, no security concerns, no AGENTS.md violations. The Tests All 66 tests pass on the PR branch (head Real-Scenario Testing Drove the Before — installed After — PR branch Item 2 changed from 中文说明代码审查 对照独立提案审查了 diff:我会添加一个 未发现 critical blocker。改动纯粹是显示标签层面的调整:一个 helper 函数、一处 schema 字符串替换、9 个 locale key 重命名、10 个 snapshot 更新、一份文档更新。无正确性问题、无安全隐患、无 AGENTS.md 违规。 测试 PR 分支(head 真实场景测试 在 tmux 中分别用已安装的 qwen(v0.17.0,before)和 PR dev build(after)驱动了
— Qwen Code · qwen3.7-max |
|
Stepping back — this is a clean, well-executed rename that solves a real UX problem. "Default" was the one mode name that described a meta-property (it's the starting value) instead of behavior (what permissions it grants). The fix is surgical: display labels only, internal values untouched, zero migration burden for existing users. The implementation matches what I would have proposed independently. No over-engineering, no unnecessary abstractions. The The acknowledged tradeoff — case-mixing in the picker ( One thing worth noting for the future: if more mode names eventually get display-label treatment, the This is ready to ship. ✅ 中文说明退一步看——这是一个干净、执行良好的重命名,解决了真实的 UX 问题。"Default" 是唯一一个描述 meta 属性("它是默认值")而非行为("它授予什么权限")的模式名。修复方式是精准的:只改显示标签,内部值不动,现有用户零迁移负担。 实现与我的独立提案完全一致。没有过度工程化,没有不必要的抽象。 已知的 tradeoff——picker 中大小写混排( 值得注意的一点:如果未来更多模式名也加上显示标签, 可以合并 ✅ — Qwen Code · qwen3.7-max |
pomelo-nwu
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
tanzhenxin
left a comment
There was a problem hiding this comment.
Approving — the rename is correctly scoped and value-safe: the enum (ApprovalMode.DEFAULT), the serialized "default" config value, and the /approval-mode default keyword are all preserved, i18n is consistent across all 9 locales, and CI is green.
One non-blocking follow-up (a fast-follow PR is fine — no need for a separate issue): the rename is complete for the CLI surfaces, but APPROVAL_MODE_INFO[ApprovalMode.DEFAULT].name in packages/core/src/config/config.ts still reads 'Default'. ACP/editor clients surface that string via buildModesData/buildConfigOptions in acpAgent.ts, so they'll keep showing "Default" while the CLI now shows "Ask permissions". Updating that one field (or routing all mode-name displays through a single source of truth) would make the rename consistent across every client.
Thanks for the careful, well-documented change!
What this PR does
Renames the approval mode previously displayed as Default to Ask Permissions in user-facing UI. The change is confined to display labels — the internal enum value (
ApprovalMode.DEFAULT), the serialized settings value (tools.approvalMode: "default"), and the/approval-mode defaultCLI identifier are preserved. Existingsettings.jsonfiles and CLI invocations continue to work unchanged.Affected surfaces: settings dialog,
/approval-modepicker (entry forDEFAULTonly), 9 i18n locales (en, zh, zh-TW, de, fr, ja, pt, ru, ca), anddocs/users/features/approval-mode.md.Why it's needed
The label Default told the user "this is what you get if you don't pick anything" without saying what authorization the mode actually grants. Every other mode name (
Plan,Auto-Edit,Auto,YOLO) describes behavior;Defaultwas the odd one out. Ask Permissions answers the user's mental-model question — "what permission level is this?" — directly, and matches the convention Claude Code uses for the equivalent mode, lowering the cognitive cost for users who move between tools. See issue #4625 for the full rationale.Reviewer Test Plan
How to verify
/settings. TheTool Approval Moderow showsAsk permissions(instead ofDefault) whenDEFAULTis active./approval-mode. The second entry renders asAsk permissions - Require approval for file edits or shell commands(wasdefault - Require approval for file edits or shell commands).settings.jsoncontaining"tools": { "approvalMode": "default" }loads and applies theDEFAULTmode without migration./approval-mode defaultstill switches into the mode and printsApproval mode set to "default"(CLI ID, by design).cd packages/cli && npx vitest run src/ui/components/SettingsDialogpasses (53 tests, 10 snapshots).Evidence (Before & After)
Settings dialog row — from
SettingsDialog.test.tsx.snap(authoritative TUI render):Before (parent of this branch, commit
707f1bdb5):After (this PR):
/approval-modepicker — entry forApprovalMode.DEFAULT:default - Require approval for file edits or shell commandsAsk permissions - Require approval for file edits or shell commandsOther picker entries (
plan,auto-edit,auto,yolo) are intentionally unchanged — see "Not validated / out of scope" below.Tested on
CI passed all three Test matrix jobs on
3c3144a3d(macOS 18m44s, Linux 12m18s, Windows 16m23s).Environment (optional)
Local:
npm install --ignore-scripts && cd packages/cli && npx vitest run src/ui/components/SettingsDialog src/ui/components/Footer src/ui/components/AutoAcceptIndicator src/ui/components/Composer src/ui/components/InputPrompt src/ui/commands/approvalModeCommand src/ui/hooks/useApprovalModeCommand— 247 passed, 1 skipped. Lint + typecheck clean.Risk & Scope
/approval-modepicker now mixes letter-case styles —Ask permissions(Title case viat()) sits alongside lowercase raw-enum names (plan,auto-edit,auto,yolo). This is the deliberate consequence of scoping the rename toDEFAULTonly. Normalizing the other picker entries to a consistent display map is left to a future PR.packages/vscode-ide-companion/src/types/approvalModeTypes.ts) already uses its own friendlier label"Ask before edits"and is not touched. The/approval-modecommand output (Approval mode set to "{{mode}}") continues to echo the raw CLI identifier the user typed, by design.ApprovalMode.DEFAULT, the serialized config value"default", and the/approval-mode defaultCLI keyword are unchanged. The migration note indocs/users/features/approval-mode.mddocuments the rename for users encountering the new label.Linked Issues
Closes #4625.
中文说明
这个 PR 做了什么
把审批模式 (approval mode) 在用户可见 UI 里原本叫 Default 的那一档改名为 Ask Permissions。改动仅限显示标签:内部枚举值
ApprovalMode.DEFAULT、settings.json 序列化值"default"、CLI 命令/approval-mode default全部保持不变,老配置无需迁移。为什么需要
Default这个名字只表达"默认值"这个 meta 概念,无法告诉用户该模式实际授予哪种权限级别。其它 mode (Plan、Auto-Edit、Auto、YOLO) 都直接描述行为,唯独Default例外。Ask Permissions直接回答用户的关键问题——"这个模式下我会被询问吗?"——并且对齐 Claude Code 同类模式的命名,降低跨工具的认知成本。详细背景见 issue #4625。影响范围
Tool Approval Mode行/approval-mode选择器中DEFAULT项docs/users/features/approval-mode.md不影响
ApprovalMode.DEFAULT枚举与"default"序列化值/approval-mode default命令与tools.approvalMode: "default"设置"Ask before edits"标签)