diff --git a/docs/users/configuration/settings.md b/docs/users/configuration/settings.md index ccf44c849ae..4b7a96fd8f1 100644 --- a/docs/users/configuration/settings.md +++ b/docs/users/configuration/settings.md @@ -106,6 +106,7 @@ Settings are organized into categories. All settings should be placed within the | `ui.showMemoryUsage` | boolean | Display memory usage information in the UI. | `false` | | `ui.showLineNumbers` | boolean | Show line numbers in code blocks in the CLI output. | `true` | | `ui.showCitations` | boolean | Show citations for generated text in the chat. | `true` | +| `ui.compactMode` | boolean | Hide tool output and thinking for a cleaner view. Toggle with `Ctrl+O` during a session. When enabled, a `compact` indicator appears in the footer. The setting persists across sessions. | `false` | | `enableWelcomeBack` | boolean | Show welcome back dialog when returning to a project with conversation history. When enabled, Qwen Code will automatically detect if you're returning to a project with a previously generated project summary (`.qwen/PROJECT_SUMMARY.md`) and show a dialog allowing you to continue your previous conversation or start fresh. This feature integrates with the `/summary` command and quit confirmation dialog. | `true` | | `ui.accessibility.enableLoadingPhrases` | boolean | Enable loading phrases (disable for accessibility). | `true` | | `ui.accessibility.screenReader` | boolean | Enables screen reader mode, which adjusts the TUI for better compatibility with screen readers. | `false` | @@ -203,9 +204,9 @@ The `extra_body` field allows you to add custom parameters to the request body s #### fastModel -| Setting | Type | Description | Default | -| ----------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| `fastModel` | string | Model for background tasks ([suggestion generation](../features/followup-suggestions), speculation). Leave empty to use the main model. A smaller/faster model (e.g., `qwen3.5-flash`) reduces latency and cost. Can also be set via `/model --fast`. | `""` | +| Setting | Type | Description | Default | +| ----------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| `fastModel` | string | Model used for generating [prompt suggestions](../features/followup-suggestions) and speculative execution. Leave empty to use the main model. A smaller/faster model (e.g., `qwen3-coder-flash`) reduces latency and cost. Can also be set via `/model --fast`. | `""` | #### context diff --git a/docs/users/features/commands.md b/docs/users/features/commands.md index eb1f25d3d9e..ce26c2962a7 100644 --- a/docs/users/features/commands.md +++ b/docs/users/features/commands.md @@ -34,6 +34,7 @@ Commands for adjusting interface appearance and work environment. | ------------ | ---------------------------------------- | ----------------------------- | | `/clear` | Clear terminal screen content | `/clear` (shortcut: `Ctrl+L`) | | `/context` | Show context window usage breakdown | `/context` | +| → `detail` | Show per-item context usage breakdown | `/context detail` | | `/theme` | Change Qwen Code visual theme | `/theme` | | `/vim` | Turn input area Vim editing mode on/off | `/vim` | | `/directory` | Manage multi-directory support workspace | `/dir add ./src,./tests` | @@ -56,21 +57,21 @@ Commands specifically for controlling interface and output language. Commands for managing AI tools and models. -| Command | Description | Usage Examples | -| ---------------- | ------------------------------------------------- | --------------------------------------------- | -| `/mcp` | List configured MCP servers and tools | `/mcp`, `/mcp desc` | -| `/tools` | Display currently available tool list | `/tools`, `/tools desc` | -| `/skills` | List and run available skills | `/skills`, `/skills ` | -| `/plan` | Switch to plan mode or exit plan mode | `/plan`, `/plan `, `/plan exit` | -| `/approval-mode` | Change approval mode for tool usage | `/approval-mode --project` | -| →`plan` | Analysis only, no execution | Secure review | -| →`default` | Require approval for edits | Daily use | -| →`auto-edit` | Automatically approve edits | Trusted environment | -| →`yolo` | Automatically approve all | Quick prototyping | -| `/model` | Switch model used in current session | `/model` | -| `/model --fast` | Set or select the fast model for background tasks | `/model --fast qwen3.5-flash` | -| `/extensions` | List all active extensions in current session | `/extensions` | -| `/memory` | Manage AI's instruction context | `/memory add Important Info` | +| Command | Description | Usage Examples | +| ---------------- | --------------------------------------------- | --------------------------------------------- | +| `/mcp` | List configured MCP servers and tools | `/mcp`, `/mcp desc` | +| `/tools` | Display currently available tool list | `/tools`, `/tools desc` | +| `/skills` | List and run available skills | `/skills`, `/skills ` | +| `/plan` | Switch to plan mode or exit plan mode | `/plan`, `/plan `, `/plan exit` | +| `/approval-mode` | Change approval mode for tool usage | `/approval-mode --project` | +| →`plan` | Analysis only, no execution | Secure review | +| →`default` | Require approval for edits | Daily use | +| →`auto-edit` | Automatically approve edits | Trusted environment | +| →`yolo` | Automatically approve all | Quick prototyping | +| `/model` | Switch model used in current session | `/model` | +| `/model --fast` | Set a lighter model for prompt suggestions | `/model --fast qwen3-coder-flash` | +| `/extensions` | List all active extensions in current session | `/extensions` | +| `/memory` | Manage AI's instruction context | `/memory add Important Info` | ### 1.5 Built-in Skills diff --git a/docs/users/features/followup-suggestions.md b/docs/users/features/followup-suggestions.md index 6b72a1d7089..b4eb19fabf3 100644 --- a/docs/users/features/followup-suggestions.md +++ b/docs/users/features/followup-suggestions.md @@ -49,7 +49,7 @@ By default, suggestions use the same model as your main conversation. For faster ### Via command ``` -/model --fast qwen3.5-flash +/model --fast qwen3-coder-flash ``` Or use `/model --fast` (without a model name) to open a selection dialog. @@ -58,11 +58,11 @@ Or use `/model --fast` (without a model name) to open a selection dialog. ```json { - "fastModel": "qwen3.5-flash" + "fastModel": "qwen3-coder-flash" } ``` -The fast model is used for background tasks like suggestion generation. When not configured, the main conversation model is used as fallback. +The fast model is used for prompt suggestions and speculative execution. When not configured, the main conversation model is used as fallback. Thinking/reasoning mode is automatically disabled for all background tasks (suggestion generation and speculation), regardless of your main model's thinking configuration. This avoids wasting tokens on internal reasoning that isn't needed for these tasks. @@ -75,13 +75,13 @@ These settings can be configured in `settings.json`: | `ui.enableFollowupSuggestions` | boolean | `true` | Enable or disable followup suggestions | | `ui.enableCacheSharing` | boolean | `true` | Use cache-aware forked queries to reduce cost (experimental) | | `ui.enableSpeculation` | boolean | `false` | Speculatively execute suggestions before submission (experimental) | -| `fastModel` | string | `""` | Model for background tasks (suggestion generation, speculation) | +| `fastModel` | string | `""` | Model for prompt suggestions and speculative execution | ### Example ```json { - "fastModel": "qwen3.5-flash", + "fastModel": "qwen3-coder-flash", "ui": { "enableFollowupSuggestions": true, "enableCacheSharing": true diff --git a/docs/users/reference/keyboard-shortcuts.md b/docs/users/reference/keyboard-shortcuts.md index fdfc41b879b..e6a259e88a6 100644 --- a/docs/users/reference/keyboard-shortcuts.md +++ b/docs/users/reference/keyboard-shortcuts.md @@ -10,7 +10,7 @@ This document lists the available keyboard shortcuts in Qwen Code. | `Ctrl+C` | Cancel the ongoing request and clear the input. Press twice to exit the application. | | `Ctrl+D` | Exit the application if the input is empty. Press twice to confirm. | | `Ctrl+L` | Clear the screen. | -| `Ctrl+O` | Toggle the display of the debug console. | +| `Ctrl+O` | Toggle compact mode (hide/show tool output and thinking). | | `Ctrl+S` | Allows long responses to print fully, disabling truncation. Use your terminal's scrollback to view the entire output. | | `Ctrl+T` | Toggle the display of tool descriptions. | | `Shift+Tab` (`Tab` on Windows) | Cycle approval modes (`plan` → `default` → `auto-edit` → `yolo`) | diff --git a/package-lock.json b/package-lock.json index ffca9b8995e..6954c9da836 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@qwen-code/qwen-code", - "version": "0.14.2", + "version": "0.14.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@qwen-code/qwen-code", - "version": "0.14.2", + "version": "0.14.3", "workspaces": [ "packages/*", "packages/channels/base", @@ -16888,7 +16888,7 @@ }, "packages/channels/base": { "name": "@qwen-code/channel-base", - "version": "0.14.2", + "version": "0.14.3", "dependencies": { "@agentclientprotocol/sdk": "^0.14.1" }, @@ -16898,7 +16898,7 @@ }, "packages/channels/dingtalk": { "name": "@qwen-code/channel-dingtalk", - "version": "0.14.2", + "version": "0.14.3", "dependencies": { "@qwen-code/channel-base": "file:../base", "dingtalk-stream-sdk-nodejs": "^2.0.4" @@ -16909,7 +16909,7 @@ }, "packages/channels/plugin-example": { "name": "@qwen-code/channel-plugin-example", - "version": "0.14.2", + "version": "0.14.3", "dependencies": { "@qwen-code/channel-base": "file:../base", "ws": "^8.18.0" @@ -16923,7 +16923,7 @@ }, "packages/channels/telegram": { "name": "@qwen-code/channel-telegram", - "version": "0.14.2", + "version": "0.14.3", "dependencies": { "@qwen-code/channel-base": "file:../base", "grammy": "^1.41.1", @@ -16935,7 +16935,7 @@ }, "packages/channels/weixin": { "name": "@qwen-code/channel-weixin", - "version": "0.14.2", + "version": "0.14.3", "dependencies": { "@qwen-code/channel-base": "file:../base" }, @@ -16945,7 +16945,7 @@ }, "packages/cli": { "name": "@qwen-code/qwen-code", - "version": "0.14.2", + "version": "0.14.3", "dependencies": { "@agentclientprotocol/sdk": "^0.14.1", "@google/genai": "1.30.0", @@ -17606,7 +17606,7 @@ }, "packages/core": { "name": "@qwen-code/qwen-code-core", - "version": "0.14.2", + "version": "0.14.3", "hasInstallScript": true, "dependencies": { "@anthropic-ai/sdk": "^0.36.1", @@ -21039,7 +21039,7 @@ }, "packages/test-utils": { "name": "@qwen-code/qwen-code-test-utils", - "version": "0.14.2", + "version": "0.14.3", "dev": true, "license": "Apache-2.0", "devDependencies": { @@ -21051,7 +21051,7 @@ }, "packages/vscode-ide-companion": { "name": "qwen-code-vscode-ide-companion", - "version": "0.14.2", + "version": "0.14.3", "license": "LICENSE", "dependencies": { "@agentclientprotocol/sdk": "^0.14.1", @@ -21298,7 +21298,7 @@ }, "packages/web-templates": { "name": "@qwen-code/web-templates", - "version": "0.14.2", + "version": "0.14.3", "devDependencies": { "@types/react": "^18.2.0", "@types/react-dom": "^18.2.0", @@ -21826,7 +21826,7 @@ }, "packages/webui": { "name": "@qwen-code/webui", - "version": "0.14.2", + "version": "0.14.3", "license": "MIT", "dependencies": { "markdown-it": "^14.1.0" diff --git a/package.json b/package.json index 5864f20dad2..04dcaa76834 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/qwen-code", - "version": "0.14.2", + "version": "0.14.3", "engines": { "node": ">=20.0.0" }, @@ -18,7 +18,7 @@ "url": "git+https://github.com/QwenLM/qwen-code.git" }, "config": { - "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.14.2" + "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.14.3" }, "scripts": { "start": "cross-env node scripts/start.js", diff --git a/packages/channels/base/package.json b/packages/channels/base/package.json index fd68209fb46..f0b2376b38d 100644 --- a/packages/channels/base/package.json +++ b/packages/channels/base/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-base", - "version": "0.14.2", + "version": "0.14.3", "description": "Base channel infrastructure for Qwen Code", "type": "module", "main": "dist/index.js", diff --git a/packages/channels/dingtalk/package.json b/packages/channels/dingtalk/package.json index 4be5a8f2588..8bda87c86e6 100644 --- a/packages/channels/dingtalk/package.json +++ b/packages/channels/dingtalk/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-dingtalk", - "version": "0.14.2", + "version": "0.14.3", "description": "DingTalk channel adapter for Qwen Code", "type": "module", "main": "dist/index.js", diff --git a/packages/channels/plugin-example/package.json b/packages/channels/plugin-example/package.json index d7385b3d5b8..fcb84b60e1d 100644 --- a/packages/channels/plugin-example/package.json +++ b/packages/channels/plugin-example/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-plugin-example", - "version": "0.14.2", + "version": "0.14.3", "private": true, "type": "module", "main": "dist/index.js", diff --git a/packages/channels/telegram/package.json b/packages/channels/telegram/package.json index 4ce1e90e3df..8e7e8871506 100644 --- a/packages/channels/telegram/package.json +++ b/packages/channels/telegram/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-telegram", - "version": "0.14.2", + "version": "0.14.3", "description": "Telegram channel adapter for Qwen Code", "type": "module", "main": "dist/index.js", diff --git a/packages/channels/weixin/package.json b/packages/channels/weixin/package.json index a244a5a4232..6a4469182fe 100644 --- a/packages/channels/weixin/package.json +++ b/packages/channels/weixin/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/channel-weixin", - "version": "0.14.2", + "version": "0.14.3", "description": "WeChat (Weixin) channel adapter for Qwen Code", "type": "module", "main": "dist/index.js", diff --git a/packages/channels/weixin/src/api.ts b/packages/channels/weixin/src/api.ts index 73f7f8ea738..93ccbf4b6d4 100644 --- a/packages/channels/weixin/src/api.ts +++ b/packages/channels/weixin/src/api.ts @@ -35,7 +35,7 @@ function randomUin(): string { return btoa(String.fromCharCode(...buf)); } -function buildHeaders(token?: string): Record { +export function buildHeaders(token?: string): Record { const headers: Record = { 'Content-Type': 'application/json', 'X-WECHAT-UIN': randomUin(), diff --git a/packages/channels/weixin/src/login.ts b/packages/channels/weixin/src/login.ts index 8771b237373..0adeda22656 100644 --- a/packages/channels/weixin/src/login.ts +++ b/packages/channels/weixin/src/login.ts @@ -2,6 +2,8 @@ * QR code login flow for WeChat iLink Bot. */ +import { buildHeaders } from './api.js'; + export interface LoginResult { connected: boolean; token?: string; @@ -54,7 +56,7 @@ export async function waitForLogin(params: { const resp = await fetch( `${apiBaseUrl}/ilink/bot/get_qrcode_status?qrcode=${encodeURIComponent(currentQrcodeId)}`, { - headers: { 'iLink-App-ClientVersion': '1' }, + headers: buildHeaders(), signal: controller.signal, }, ); diff --git a/packages/cli/package.json b/packages/cli/package.json index 5ee7b4860b8..837a485defb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@qwen-code/qwen-code", - "version": "0.14.2", + "version": "0.14.3", "description": "Qwen Code", "repository": { "type": "git", @@ -33,7 +33,7 @@ "dist" ], "config": { - "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.14.2" + "sandboxImageUri": "ghcr.io/qwenlm/qwen-code:0.14.3" }, "dependencies": { "@agentclientprotocol/sdk": "^0.14.1", diff --git a/packages/cli/src/commands/channel/start.ts b/packages/cli/src/commands/channel/start.ts index 2b702262276..ae5648932d2 100644 --- a/packages/cli/src/commands/channel/start.ts +++ b/packages/cli/src/commands/channel/start.ts @@ -183,7 +183,16 @@ async function startSingle(name: string): Promise { const channel = createChannel(name, config, bridge, { router }); channels.set(name, channel); registerToolCallDispatch(bridge, router, channels); - await channel.connect(); + + try { + await channel.connect(); + } catch (err) { + writeStderrLine( + `Error: ${err instanceof Error ? err.message : String(err)}`, + ); + bridge.stop(); + process.exit(1); + } writeServiceInfo([name]); writeStdoutLine(`[Channel] "${name}" is running. Press Ctrl+C to stop.`); diff --git a/packages/cli/src/config/keyBindings.ts b/packages/cli/src/config/keyBindings.ts index b13da27fa31..196602ba1d0 100644 --- a/packages/cli/src/config/keyBindings.ts +++ b/packages/cli/src/config/keyBindings.ts @@ -51,7 +51,7 @@ export enum Command { EXIT = 'exit', SHOW_MORE_LINES = 'showMoreLines', RETRY_LAST = 'retryLast', - TOGGLE_VERBOSE_MODE = 'toggleVerboseMode', + TOGGLE_COMPACT_MODE = 'toggleCompactMode', // Shell commands REVERSE_SEARCH = 'reverseSearch', @@ -173,7 +173,7 @@ export const defaultKeyBindings: KeyBindingConfig = { [Command.EXIT]: [{ key: 'd', ctrl: true }], [Command.SHOW_MORE_LINES]: [{ key: 's', ctrl: true }], [Command.RETRY_LAST]: [{ key: 'y', ctrl: true }], - [Command.TOGGLE_VERBOSE_MODE]: [{ key: 'o', ctrl: true }], + [Command.TOGGLE_COMPACT_MODE]: [{ key: 'o', ctrl: true }], // Shell commands [Command.REVERSE_SEARCH]: [{ key: 'r', ctrl: true }], diff --git a/packages/cli/src/config/settingsSchema.ts b/packages/cli/src/config/settingsSchema.ts index 29215522acb..8247102665d 100644 --- a/packages/cli/src/config/settingsSchema.ts +++ b/packages/cli/src/config/settingsSchema.ts @@ -591,15 +591,15 @@ const SETTINGS_SCHEMA = { description: 'The last time the feedback dialog was shown.', showInDialog: false, }, - verboseMode: { + compactMode: { type: 'boolean', - label: 'Verbose Mode', + label: 'Compact Mode', category: 'UI', requiresRestart: false, - default: true, + default: false, description: - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).', - showInDialog: false, + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).', + showInDialog: true, }, }, }, @@ -672,7 +672,7 @@ const SETTINGS_SCHEMA = { requiresRestart: false, default: '', description: - 'Model for background tasks (suggestion generation, speculation). Leave empty to use the main model. A smaller/faster model (e.g., qwen3.5-flash) reduces latency and cost.', + 'Model used for generating prompt suggestions and speculative execution. Leave empty to use the main model. A smaller/faster model (e.g., qwen3-coder-flash) reduces latency and cost.', showInDialog: true, }, diff --git a/packages/cli/src/i18n/locales/de.js b/packages/cli/src/i18n/locales/de.js index 11a64170532..4177edb3c6b 100644 --- a/packages/cli/src/i18n/locales/de.js +++ b/packages/cli/src/i18n/locales/de.js @@ -989,9 +989,10 @@ export default { // ============================================================================ // Commands - Model // ============================================================================ - 'Switch the model for this session': 'Modell für diese Sitzung wechseln', - 'Set fast model for background tasks': - 'Schnelles Modell für Hintergrundaufgaben festlegen', + 'Switch the model for this session (--fast for suggestion model)': + 'Modell für diese Sitzung wechseln (--fast für Vorschlagsmodell)', + 'Set a lighter model for prompt suggestions and speculative execution': + 'Leichteres Modell für Eingabevorschläge und spekulative Ausführung festlegen', 'Content generator configuration not available.': 'Inhaltsgenerator-Konfiguration nicht verfügbar.', 'Authentication type not available.': @@ -1970,9 +1971,9 @@ export default { 'Raw-Modus nicht verfügbar. Bitte in einem interaktiven Terminal ausführen.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(↑ ↓ Pfeiltasten zum Navigieren, Enter zum Auswählen, Strg+C zum Beenden)\n', - verbose: 'ausführlich', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Vollständige Tool-Ausgabe und Denkprozess im ausführlichen Modus anzeigen (mit Strg+O umschalten).', + compact: 'kompakt', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Tool-Ausgabe und Denkprozess ausblenden für eine übersichtlichere Ansicht (mit Strg+O umschalten).', 'Press Ctrl+O to show full tool output': 'Strg+O für vollständige Tool-Ausgabe drücken', diff --git a/packages/cli/src/i18n/locales/en.js b/packages/cli/src/i18n/locales/en.js index a27249410af..7ef40def257 100644 --- a/packages/cli/src/i18n/locales/en.js +++ b/packages/cli/src/i18n/locales/en.js @@ -1151,8 +1151,10 @@ export default { // ============================================================================ // Commands - Model // ============================================================================ - 'Switch the model for this session': 'Switch the model for this session', - 'Set fast model for background tasks': 'Set fast model for background tasks', + 'Switch the model for this session (--fast for suggestion model)': + 'Switch the model for this session (--fast for suggestion model)', + 'Set a lighter model for prompt suggestions and speculative execution': + 'Set a lighter model for prompt suggestions and speculative execution', 'Content generator configuration not available.': 'Content generator configuration not available.', 'Authentication type not available.': 'Authentication type not available.', @@ -2010,9 +2012,9 @@ export default { 'Raw mode not available. Please run in an interactive terminal.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n', - verbose: 'verbose', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).', + compact: 'compact', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).', 'Press Ctrl+O to show full tool output': 'Press Ctrl+O to show full tool output', diff --git a/packages/cli/src/i18n/locales/ja.js b/packages/cli/src/i18n/locales/ja.js index 57b1439707e..2789affd1e4 100644 --- a/packages/cli/src/i18n/locales/ja.js +++ b/packages/cli/src/i18n/locales/ja.js @@ -743,9 +743,10 @@ export default { 'Failed to generate summary - no text content received from LLM response': 'サマリーの生成に失敗 - LLMレスポンスからテキストコンテンツを受信できませんでした', // Model - 'Switch the model for this session': 'このセッションのモデルを切り替え', - 'Set fast model for background tasks': - 'バックグラウンドタスク用の高速モデルを設定', + 'Switch the model for this session (--fast for suggestion model)': + 'このセッションのモデルを切り替え(--fast で提案モデルを設定)', + 'Set a lighter model for prompt suggestions and speculative execution': + 'プロンプト提案と投機的実行用の軽量モデルを設定', 'Content generator configuration not available.': 'コンテンツジェネレーター設定が利用できません', 'Authentication type not available.': '認証タイプが利用できません', @@ -1462,9 +1463,9 @@ export default { 'Rawモードが利用できません。インタラクティブターミナルで実行してください。', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(↑ ↓ 矢印キーで移動、Enter で選択、Ctrl+C で終了)\n', - verbose: '詳細', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - '詳細モードで完全なツール出力と思考を表示します(Ctrl+O で切り替え)。', + compact: 'コンパクト', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'コンパクトモードでツール出力と思考を非表示にします(Ctrl+O で切り替え)。', 'Press Ctrl+O to show full tool output': 'Ctrl+O で完全なツール出力を表示', 'Switch to plan mode or exit plan mode': diff --git a/packages/cli/src/i18n/locales/pt.js b/packages/cli/src/i18n/locales/pt.js index b51b73f9207..c1a622a9e71 100644 --- a/packages/cli/src/i18n/locales/pt.js +++ b/packages/cli/src/i18n/locales/pt.js @@ -996,9 +996,10 @@ export default { // ============================================================================ // Commands - Model // ============================================================================ - 'Switch the model for this session': 'Trocar o modelo para esta sessão', - 'Set fast model for background tasks': - 'Definir modelo rápido para tarefas em segundo plano', + 'Switch the model for this session (--fast for suggestion model)': + 'Trocar o modelo para esta sessão (--fast para modelo de sugestões)', + 'Set a lighter model for prompt suggestions and speculative execution': + 'Definir modelo mais leve para sugestões de prompt e execução especulativa', 'Content generator configuration not available.': 'Configuração do gerador de conteúdo não disponível.', 'Authentication type not available.': 'Tipo de autenticação não disponível.', @@ -1960,9 +1961,9 @@ export default { 'Modo raw não disponível. Execute em um terminal interativo.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(Use ↑ ↓ para navegar, Enter para selecionar, Ctrl+C para sair)\n', - verbose: 'detalhado', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Mostrar saída completa da ferramenta e raciocínio no modo detalhado (alternar com Ctrl+O).', + compact: 'compacto', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Ocultar saída da ferramenta e raciocínio para uma visualização mais limpa (alternar com Ctrl+O).', 'Press Ctrl+O to show full tool output': 'Pressione Ctrl+O para exibir a saída completa da ferramenta', diff --git a/packages/cli/src/i18n/locales/ru.js b/packages/cli/src/i18n/locales/ru.js index 341277106d5..ae83eb6bfbf 100644 --- a/packages/cli/src/i18n/locales/ru.js +++ b/packages/cli/src/i18n/locales/ru.js @@ -997,9 +997,10 @@ export default { // ============================================================================ // Команды - Модель // ============================================================================ - 'Switch the model for this session': 'Переключение модели для этой сессии', - 'Set fast model for background tasks': - 'Установить быструю модель для фоновых задач', + 'Switch the model for this session (--fast for suggestion model)': + 'Переключение модели для этой сессии (--fast для модели подсказок)', + 'Set a lighter model for prompt suggestions and speculative execution': + 'Установить облегчённую модель для подсказок и спекулятивного выполнения', 'Content generator configuration not available.': 'Конфигурация генератора содержимого недоступна.', 'Authentication type not available.': 'Тип авторизации недоступен.', @@ -1967,9 +1968,9 @@ export default { 'Raw-режим недоступен. Пожалуйста, запустите в интерактивном терминале.', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(↑ ↓ стрелки для навигации, Enter для выбора, Ctrl+C для выхода)\n', - verbose: 'подробный', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - 'Показывать полный вывод инструментов и процесс рассуждений в подробном режиме (переключить с помощью Ctrl+O).', + compact: 'компактный', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + 'Скрывать вывод инструментов и процесс рассуждений для более чистого вида (переключить с помощью Ctrl+O).', 'Press Ctrl+O to show full tool output': 'Нажмите Ctrl+O для показа полного вывода инструментов', diff --git a/packages/cli/src/i18n/locales/zh.js b/packages/cli/src/i18n/locales/zh.js index 74f949a6dc5..50014ec5d4a 100644 --- a/packages/cli/src/i18n/locales/zh.js +++ b/packages/cli/src/i18n/locales/zh.js @@ -1092,8 +1092,10 @@ export default { // ============================================================================ // Commands - Model // ============================================================================ - 'Switch the model for this session': '切换此会话的模型', - 'Set fast model for background tasks': '设置后台任务的快速模型', + 'Switch the model for this session (--fast for suggestion model)': + '切换此会话的模型(--fast 可设置建议模型)', + 'Set a lighter model for prompt suggestions and speculative execution': + '设置用于输入建议和推测执行的轻量模型', 'Content generator configuration not available.': '内容生成器配置不可用', 'Authentication type not available.': '认证类型不可用', 'No models available for the current authentication type ({{authType}}).': @@ -1714,6 +1716,8 @@ export default { 'Show context window usage breakdown.': '显示上下文窗口使用情况分解。', 'Run /context detail for per-item breakdown.': '运行 /context detail 查看详细分解。', + 'Show context window usage breakdown. Use "/context detail" for per-item breakdown.': + '显示上下文窗口使用情况分解。输入 "/context detail" 查看详细分解。', 'body loaded': '内容已加载', memory: '记忆', '{{region}} configuration updated successfully.': '{{region}} 配置更新成功。', @@ -1814,9 +1818,9 @@ export default { '原始模式不可用。请在交互式终端中运行。', '(Use ↑ ↓ arrows to navigate, Enter to select, Ctrl+C to exit)\n': '(使用 ↑ ↓ 箭头导航,Enter 选择,Ctrl+C 退出)\n', - verbose: '详细', - 'Show full tool output and thinking in verbose mode (toggle with Ctrl+O).': - '详细模式下显示完整工具输出和思考过程(Ctrl+O 切换)。', + compact: '紧凑', + 'Hide tool output and thinking for a cleaner view (toggle with Ctrl+O).': + '紧凑模式下隐藏工具输出和思考过程,界面更简洁(Ctrl+O 切换)。', 'Press Ctrl+O to show full tool output': '按 Ctrl+O 查看详细工具调用结果', 'Switch to plan mode or exit plan mode': '切换到计划模式或退出计划模式', diff --git a/packages/cli/src/ui/AppContainer.tsx b/packages/cli/src/ui/AppContainer.tsx index 21314964c67..c564cc5ba93 100644 --- a/packages/cli/src/ui/AppContainer.tsx +++ b/packages/cli/src/ui/AppContainer.tsx @@ -71,7 +71,7 @@ import { useApprovalModeCommand } from './hooks/useApprovalModeCommand.js'; import { useResumeCommand } from './hooks/useResumeCommand.js'; import { useSlashCommandProcessor } from './hooks/slashCommandProcessor.js'; import { useVimMode } from './contexts/VimModeContext.js'; -import { VerboseModeProvider } from './contexts/VerboseModeContext.js'; +import { CompactModeProvider } from './contexts/CompactModeContext.js'; import { useTerminalSize } from './hooks/useTerminalSize.js'; import { calculatePromptWidths } from './components/InputPrompt.js'; import { useStdin, useStdout } from 'ink'; @@ -1262,8 +1262,8 @@ export const AppContainer = (props: AppContainerProps) => { const [showToolDescriptions, setShowToolDescriptions] = useState(false); - const [verboseMode, setVerboseMode] = useState( - settings.merged.ui?.verboseMode ?? true, + const [compactMode, setCompactMode] = useState( + settings.merged.ui?.compactMode ?? false, ); const [frozenSnapshot, setFrozenSnapshot] = useState< HistoryItemWithoutId[] | null @@ -1681,10 +1681,10 @@ export const AppContainer = (props: AppContainerProps) => { if (activePtyId || embeddedShellFocused) { setEmbeddedShellFocused((prev) => !prev); } - } else if (keyMatchers[Command.TOGGLE_VERBOSE_MODE](key)) { - const newValue = !verboseMode; - setVerboseMode(newValue); - void settings.setValue(SettingScope.User, 'ui.verboseMode', newValue); + } else if (keyMatchers[Command.TOGGLE_COMPACT_MODE](key)) { + const newValue = !compactMode; + setCompactMode(newValue); + void settings.setValue(SettingScope.User, 'ui.compactMode', newValue); refreshStatic(); // Only freeze during the actual responding phase. WaitingForConfirmation // must keep focus so the user can approve/cancel tool confirmation UI. @@ -1726,8 +1726,8 @@ export const AppContainer = (props: AppContainerProps) => { // debugKeystrokeLogging is read at call time, so no stale closure risk. settings, isAuthenticating, - verboseMode, - setVerboseMode, + compactMode, + setCompactMode, setFrozenSnapshot, pendingHistoryItems, refreshStatic, @@ -2154,9 +2154,9 @@ export const AppContainer = (props: AppContainerProps) => { ], ); - const verboseModeValue = useMemo( - () => ({ verboseMode, frozenSnapshot }), - [verboseMode, frozenSnapshot], + const compactModeValue = useMemo( + () => ({ compactMode, frozenSnapshot }), + [compactMode, frozenSnapshot], ); return ( @@ -2169,11 +2169,11 @@ export const AppContainer = (props: AppContainerProps) => { startupWarnings: props.startupWarnings || [], }} > - + - + diff --git a/packages/cli/src/ui/commands/contextCommand.ts b/packages/cli/src/ui/commands/contextCommand.ts index c693606a99a..540eb094164 100644 --- a/packages/cli/src/ui/commands/contextCommand.ts +++ b/packages/cli/src/ui/commands/contextCommand.ts @@ -373,4 +373,17 @@ export const contextCommand: SlashCommand = { context.ui.addItem(contextUsageItem, Date.now()); }, + subCommands: [ + { + name: 'detail', + get description() { + return t('Show per-item context usage breakdown.'); + }, + kind: CommandKind.BUILT_IN, + action: async (context: CommandContext) => { + // Delegate to main action with 'detail' arg to show detailed view + await contextCommand.action!(context, 'detail'); + }, + }, + ], }; diff --git a/packages/cli/src/ui/commands/modelCommand.test.ts b/packages/cli/src/ui/commands/modelCommand.test.ts index 41f95f19903..b39f1a6aaee 100644 --- a/packages/cli/src/ui/commands/modelCommand.test.ts +++ b/packages/cli/src/ui/commands/modelCommand.test.ts @@ -33,7 +33,9 @@ describe('modelCommand', () => { it('should have the correct name and description', () => { expect(modelCommand.name).toBe('model'); - expect(modelCommand.description).toBe('Switch the model for this session'); + expect(modelCommand.description).toBe( + 'Switch the model for this session (--fast for suggestion model)', + ); }); it('should return error when config is not available', async () => { diff --git a/packages/cli/src/ui/commands/modelCommand.ts b/packages/cli/src/ui/commands/modelCommand.ts index 2ccbda3237a..03454b859bd 100644 --- a/packages/cli/src/ui/commands/modelCommand.ts +++ b/packages/cli/src/ui/commands/modelCommand.ts @@ -17,15 +17,17 @@ import { getPersistScopeForModelSelection } from '../../config/modelProvidersSco export const modelCommand: SlashCommand = { name: 'model', get description() { - return t('Switch the model for this session'); + return t('Switch the model for this session (--fast for suggestion model)'); }, kind: CommandKind.BUILT_IN, completion: async (_context, partialArg) => { - if ('--fast'.startsWith(partialArg)) { + if (partialArg && '--fast'.startsWith(partialArg)) { return [ { value: '--fast', - description: t('Set fast model for background tasks'), + description: t( + 'Set a lighter model for prompt suggestions and speculative execution', + ), }, ]; } diff --git a/packages/cli/src/ui/components/Footer.tsx b/packages/cli/src/ui/components/Footer.tsx index 9934f3582e6..54956faf6d7 100644 --- a/packages/cli/src/ui/components/Footer.tsx +++ b/packages/cli/src/ui/components/Footer.tsx @@ -17,7 +17,7 @@ import { useStatusLine } from '../hooks/useStatusLine.js'; import { useUIState } from '../contexts/UIStateContext.js'; import { useConfig } from '../contexts/ConfigContext.js'; import { useVimMode } from '../contexts/VimModeContext.js'; -import { useVerboseMode } from '../contexts/VerboseModeContext.js'; +import { useCompactMode } from '../contexts/CompactModeContext.js'; import { ApprovalMode } from '@qwen-code/qwen-code-core'; import { t } from '../../i18n/index.js'; @@ -26,7 +26,7 @@ export const Footer: React.FC = () => { const config = useConfig(); const { vimEnabled, vimMode } = useVimMode(); const { text: statusLineText } = useStatusLine(); - const { verboseMode } = useVerboseMode(); + const { compactMode } = useCompactMode(); const { promptTokenCount, showAutoAcceptIndicator } = { promptTokenCount: uiState.sessionStats.lastPromptTokenCount, @@ -101,10 +101,10 @@ export const Footer: React.FC = () => { ), }); } - if (verboseMode) { + if (compactMode) { rightItems.push({ - key: 'verbose', - node: {t('verbose')}, + key: 'compact', + node: {t('compact')}, }); } diff --git a/packages/cli/src/ui/components/HistoryItemDisplay.tsx b/packages/cli/src/ui/components/HistoryItemDisplay.tsx index 02c4b04141d..dcfb47b9013 100644 --- a/packages/cli/src/ui/components/HistoryItemDisplay.tsx +++ b/packages/cli/src/ui/components/HistoryItemDisplay.tsx @@ -48,7 +48,7 @@ import { ContextUsage } from './views/ContextUsage.js'; import { ArenaAgentCard, ArenaSessionCard } from './arena/ArenaCards.js'; import { InsightProgressMessage } from './messages/InsightProgressMessage.js'; import { BtwMessage } from './messages/BtwMessage.js'; -import { useVerboseMode } from '../contexts/VerboseModeContext.js'; +import { useCompactMode } from '../contexts/CompactModeContext.js'; interface HistoryItemDisplayProps { item: HistoryItem; @@ -80,7 +80,7 @@ const HistoryItemDisplayComponent: React.FC = ({ ? 0 : 1; - const { verboseMode } = useVerboseMode(); + const { compactMode } = useCompactMode(); const itemForDisplay = useMemo(() => escapeAnsiCtrlCodes(item), [item]); const contentWidth = terminalWidth - 4; const boxWidth = mainAreaWidth || contentWidth; @@ -120,7 +120,7 @@ const HistoryItemDisplayComponent: React.FC = ({ contentWidth={contentWidth} /> )} - {verboseMode && itemForDisplay.type === 'gemini_thought' && ( + {!compactMode && itemForDisplay.type === 'gemini_thought' && ( = ({ contentWidth={contentWidth} /> )} - {verboseMode && itemForDisplay.type === 'gemini_thought_content' && ( + {!compactMode && itemForDisplay.type === 'gemini_thought_content' && ( { const { version } = useAppContext(); const uiState = useUIState(); - const { frozenSnapshot } = useVerboseMode(); + const { frozenSnapshot } = useCompactMode(); const { pendingHistoryItems, terminalWidth, diff --git a/packages/cli/src/ui/components/SettingsDialog.tsx b/packages/cli/src/ui/components/SettingsDialog.tsx index 8a0decb7165..bf6ed7c9280 100644 --- a/packages/cli/src/ui/components/SettingsDialog.tsx +++ b/packages/cli/src/ui/components/SettingsDialog.tsx @@ -130,6 +130,9 @@ export function SettingsDialog({ : key, value: key, type: definition?.type, + description: definition?.description + ? t(definition.description) || definition.description + : undefined, toggle: () => { if (!TOGGLE_TYPES.has(definition?.type)) { return; @@ -385,10 +388,17 @@ export function SettingsDialog({ setMode('settings'); }; + // Get the description for the currently active setting + const activeDescription = + mode === 'settings' && items[activeSettingIndex]?.description + ? items[activeSettingIndex].description + : undefined; + // Height constraint calculations similar to ThemeDialog const DIALOG_PADDING = 2; const SETTINGS_TITLE_HEIGHT = 2; // "Settings" title + spacing const SCROLL_ARROWS_HEIGHT = 2; // Up and down arrows + const DESCRIPTION_HEIGHT = 2; // Description line + margin const BOTTOM_HELP_TEXT_HEIGHT = 1; // Help text const RESTART_PROMPT_HEIGHT = showRestartPrompt ? 1 : 0; @@ -401,6 +411,7 @@ export function SettingsDialog({ DIALOG_PADDING + SETTINGS_TITLE_HEIGHT + SCROLL_ARROWS_HEIGHT + + DESCRIPTION_HEIGHT + BOTTOM_HELP_TEXT_HEIGHT + RESTART_PROMPT_HEIGHT; @@ -881,7 +892,14 @@ export function SettingsDialog({ initialScope={selectedScope} /> )} - + {activeDescription && mode === 'settings' && ( + + + {activeDescription} + + + )} + {mode === 'settings' ? t('(Use Enter to select, Tab to configure scope)') diff --git a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap index 633f0bba751..a198a131641 100644 --- a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap +++ b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap @@ -2,7 +2,7 @@ exports[`