-
Notifications
You must be signed in to change notification settings - Fork 3k
fix(cli): localize approval mode UI labels #6592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
50c815f
e4a5256
cb3e52d
999fef3
e31130a
4f95c9e
8b30501
037dca6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,12 +14,21 @@ import { useKeypress } from './useKeypress.js'; | |
| import type { HistoryItemWithoutId } from '../types.js'; | ||
| import { MessageType } from '../types.js'; | ||
| import { type LoadedSettings, SettingScope } from '../../config/settings.js'; | ||
| import { t } from '../../i18n/index.js'; | ||
|
|
||
| const AUTO_MODE_FIRST_TIME_MESSAGE = | ||
| const AUTO_MODE_FIRST_TIME_MESSAGE_KEY = 'auto_mode.entry_notice'; | ||
| const AUTO_MODE_FIRST_TIME_MESSAGE_FALLBACK = | ||
| 'Auto mode enabled.\n' + | ||
| ' An LLM classifier evaluates each tool call — safe actions auto-approve,\n' + | ||
| ' risky ones are blocked. Exit: Shift+Tab or /approval-mode default.'; | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] The fallback branch of — qwen3.7-max via Qwen Code /review |
||
| const getAutoModeFirstTimeMessage = () => { | ||
| const message = t(AUTO_MODE_FIRST_TIME_MESSAGE_KEY); | ||
| return message === AUTO_MODE_FIRST_TIME_MESSAGE_KEY | ||
| ? AUTO_MODE_FIRST_TIME_MESSAGE_FALLBACK | ||
| : message; | ||
| }; | ||
|
|
||
| export interface UseAutoAcceptIndicatorArgs { | ||
| config: Config; | ||
| /** Settings handle — used to read/write `ui.autoModeAcknowledged`. */ | ||
|
|
@@ -145,7 +154,7 @@ export function emitAutoModeEntryNotices(opts: { | |
| const acknowledged = settings?.merged.ui?.autoModeAcknowledged === true; | ||
| if (!acknowledged) { | ||
| addItem( | ||
| { type: MessageType.INFO, text: AUTO_MODE_FIRST_TIME_MESSAGE }, | ||
| { type: MessageType.INFO, text: getAutoModeFirstTimeMessage() }, | ||
| now, | ||
| ); | ||
| if (settings) { | ||
|
|
@@ -165,6 +174,8 @@ export function emitAutoModeEntryNotices(opts: { | |
| stripped && | ||
| (stripped.persistent.length > 0 || stripped.session.length > 0) | ||
| ) { | ||
| // Intentionally untranslated operational notice: rule text is copied from | ||
| // user/session allow-rule configuration and may contain command syntax. | ||
| const lines = [ | ||
| 'ℹ Auto mode temporarily disabled these allow rules', | ||
| ' (they would bypass the classifier):', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Critical] The PR adds
emitAutoModeEntryNotices()inapprovalModeCommand.tswhen switching to AUTO mode via the slash command, but this test file has no test case for theautoargument. Tests exist forplan,yolo,auto-edit, anddefault, but the newautocode path (the only place where the slash command triggers notice emission) is untested.Add a test case similar to the existing mode tests:
— qwen3.7-max via Qwen Code /review