@qwen-code/qwen-code 0.14.1 → 0.14.2-nightly.20260409.f208801b0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/qc-helper/docs/configuration/settings.md +30 -16
- package/bundled/qc-helper/docs/features/approval-mode.md +16 -8
- package/bundled/qc-helper/docs/features/commands.md +1 -0
- package/bundled/qc-helper/docs/features/followup-suggestions.md +1 -1
- package/cli.js +1257 -832
- package/locales/de.js +11 -0
- package/locales/en.js +11 -0
- package/locales/ja.js +11 -0
- package/locales/pt.js +11 -0
- package/locales/ru.js +11 -0
- package/locales/zh.js +10 -0
- package/package.json +2 -2
|
@@ -168,6 +168,18 @@ Settings are organized into categories. All settings should be placed within the
|
|
|
168
168
|
}
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
+
**max_tokens (adaptive output tokens):**
|
|
172
|
+
|
|
173
|
+
When `samplingParams.max_tokens` is not set, Qwen Code uses an adaptive output token strategy to optimize GPU resource usage:
|
|
174
|
+
|
|
175
|
+
1. Requests start with a default limit of **8K** output tokens
|
|
176
|
+
2. If the response is truncated (the model hits the limit), Qwen Code automatically retries with **64K** tokens
|
|
177
|
+
3. The partial output is discarded and replaced with the full response from the retry
|
|
178
|
+
|
|
179
|
+
This is transparent to users — you may briefly see a retry indicator if escalation occurs. Since 99% of responses are under 5K tokens, the retry happens rarely (<1% of requests).
|
|
180
|
+
|
|
181
|
+
To override this behavior, either set `samplingParams.max_tokens` in your settings or use the `QWEN_CODE_MAX_OUTPUT_TOKENS` environment variable.
|
|
182
|
+
|
|
171
183
|
**contextWindowSize:**
|
|
172
184
|
|
|
173
185
|
Overrides the default context window size for the selected model. Qwen Code determines the context window using built-in defaults based on model name matching, with a constant fallback value. Use this setting when a provider's effective context limit differs from Qwen Code's default. This value defines the model's assumed maximum context capacity, not a per-request token limit.
|
|
@@ -206,6 +218,7 @@ The `extra_body` field allows you to add custom parameters to the request body s
|
|
|
206
218
|
| `context.fileFiltering.respectQwenIgnore` | boolean | Respect .qwenignore files when searching. | `true` |
|
|
207
219
|
| `context.fileFiltering.enableRecursiveFileSearch` | boolean | Whether to enable searching recursively for filenames under the current tree when completing `@` prefixes in the prompt. | `true` |
|
|
208
220
|
| `context.fileFiltering.enableFuzzySearch` | boolean | When `true`, enables fuzzy search capabilities when searching for files. Set to `false` to improve performance on projects with a large number of files. | `true` |
|
|
221
|
+
| `context.gapThresholdMinutes` | number | Minutes of inactivity after which retained thinking blocks are cleared to free context tokens. Aligns with typical provider prompt-cache TTL. Set higher if your provider has a longer cache TTL. | `5` |
|
|
209
222
|
|
|
210
223
|
#### Troubleshooting File Search Performance
|
|
211
224
|
|
|
@@ -490,22 +503,23 @@ For authentication-related variables (like `OPENAI_*`) and the recommended `.qwe
|
|
|
490
503
|
|
|
491
504
|
### Environment Variables Table
|
|
492
505
|
|
|
493
|
-
| Variable | Description
|
|
494
|
-
| ------------------------------ |
|
|
495
|
-
| `QWEN_TELEMETRY_ENABLED` | Set to `true` or `1` to enable telemetry. Any other value is treated as disabling it.
|
|
496
|
-
| `QWEN_TELEMETRY_TARGET` | Sets the telemetry target (`local` or `gcp`).
|
|
497
|
-
| `QWEN_TELEMETRY_OTLP_ENDPOINT` | Sets the OTLP endpoint for telemetry.
|
|
498
|
-
| `QWEN_TELEMETRY_OTLP_PROTOCOL` | Sets the OTLP protocol (`grpc` or `http`).
|
|
499
|
-
| `QWEN_TELEMETRY_LOG_PROMPTS` | Set to `true` or `1` to enable or disable logging of user prompts. Any other value is treated as disabling it.
|
|
500
|
-
| `QWEN_TELEMETRY_OUTFILE` | Sets the file path to write telemetry to when the target is `local`.
|
|
501
|
-
| `QWEN_TELEMETRY_USE_COLLECTOR` | Set to `true` or `1` to enable or disable using an external OTLP collector. Any other value is treated as disabling it.
|
|
502
|
-
| `QWEN_SANDBOX` | Alternative to the `sandbox` setting in `settings.json`.
|
|
503
|
-
| `SEATBELT_PROFILE` | (macOS specific) Switches the Seatbelt (`sandbox-exec`) profile on macOS.
|
|
504
|
-
| `DEBUG` or `DEBUG_MODE` | (often used by underlying libraries or the CLI itself) Set to `true` or `1` to enable verbose debug logging, which can be helpful for troubleshooting.
|
|
505
|
-
| `NO_COLOR` | Set to any value to disable all color output in the CLI.
|
|
506
|
-
| `CLI_TITLE` | Set to a string to customize the title of the CLI.
|
|
507
|
-
| `CODE_ASSIST_ENDPOINT` | Specifies the endpoint for the code assist server.
|
|
508
|
-
| `
|
|
506
|
+
| Variable | Description | Notes |
|
|
507
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
508
|
+
| `QWEN_TELEMETRY_ENABLED` | Set to `true` or `1` to enable telemetry. Any other value is treated as disabling it. | Overrides the `telemetry.enabled` setting. |
|
|
509
|
+
| `QWEN_TELEMETRY_TARGET` | Sets the telemetry target (`local` or `gcp`). | Overrides the `telemetry.target` setting. |
|
|
510
|
+
| `QWEN_TELEMETRY_OTLP_ENDPOINT` | Sets the OTLP endpoint for telemetry. | Overrides the `telemetry.otlpEndpoint` setting. |
|
|
511
|
+
| `QWEN_TELEMETRY_OTLP_PROTOCOL` | Sets the OTLP protocol (`grpc` or `http`). | Overrides the `telemetry.otlpProtocol` setting. |
|
|
512
|
+
| `QWEN_TELEMETRY_LOG_PROMPTS` | Set to `true` or `1` to enable or disable logging of user prompts. Any other value is treated as disabling it. | Overrides the `telemetry.logPrompts` setting. |
|
|
513
|
+
| `QWEN_TELEMETRY_OUTFILE` | Sets the file path to write telemetry to when the target is `local`. | Overrides the `telemetry.outfile` setting. |
|
|
514
|
+
| `QWEN_TELEMETRY_USE_COLLECTOR` | Set to `true` or `1` to enable or disable using an external OTLP collector. Any other value is treated as disabling it. | Overrides the `telemetry.useCollector` setting. |
|
|
515
|
+
| `QWEN_SANDBOX` | Alternative to the `sandbox` setting in `settings.json`. | Accepts `true`, `false`, `docker`, `podman`, or a custom command string. |
|
|
516
|
+
| `SEATBELT_PROFILE` | (macOS specific) Switches the Seatbelt (`sandbox-exec`) profile on macOS. | `permissive-open`: (Default) Restricts writes to the project folder (and a few other folders, see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) but allows other operations. `strict`: Uses a strict profile that declines operations by default. `<profile_name>`: Uses a custom profile. To define a custom profile, create a file named `sandbox-macos-<profile_name>.sb` in your project's `.qwen/` directory (e.g., `my-project/.qwen/sandbox-macos-custom.sb`). |
|
|
517
|
+
| `DEBUG` or `DEBUG_MODE` | (often used by underlying libraries or the CLI itself) Set to `true` or `1` to enable verbose debug logging, which can be helpful for troubleshooting. | **Note:** These variables are automatically excluded from project `.env` files by default to prevent interference with the CLI behavior. Use `.qwen/.env` files if you need to set these for Qwen Code specifically. |
|
|
518
|
+
| `NO_COLOR` | Set to any value to disable all color output in the CLI. | |
|
|
519
|
+
| `CLI_TITLE` | Set to a string to customize the title of the CLI. | |
|
|
520
|
+
| `CODE_ASSIST_ENDPOINT` | Specifies the endpoint for the code assist server. | This is useful for development and testing. |
|
|
521
|
+
| `QWEN_CODE_MAX_OUTPUT_TOKENS` | Overrides the default maximum output tokens per response. When not set, Qwen Code uses an adaptive strategy: starts with 8K tokens and automatically retries with 64K if the response is truncated. Set this to a specific value (e.g., `16000`) to use a fixed limit instead. | Takes precedence over the capped default (8K) but is overridden by `samplingParams.max_tokens` in settings. Disables automatic escalation when set. Example: `export QWEN_CODE_MAX_OUTPUT_TOKENS=16000` |
|
|
522
|
+
| `TAVILY_API_KEY` | Your API key for the Tavily web search service. | Used to enable the `web_search` tool functionality. Example: `export TAVILY_API_KEY="tvly-your-api-key-here"` |
|
|
509
523
|
|
|
510
524
|
## Command-Line Arguments
|
|
511
525
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Approval Mode
|
|
2
2
|
|
|
3
|
-
Qwen Code offers
|
|
3
|
+
Qwen Code offers four distinct permission modes that allow you to flexibly control how AI interacts with your code and system based on task complexity and risk level.
|
|
4
4
|
|
|
5
5
|
## Permission Modes Comparison
|
|
6
6
|
|
|
@@ -40,6 +40,18 @@ You can switch into Plan Mode during a session using **Shift+Tab** (or **Tab** o
|
|
|
40
40
|
|
|
41
41
|
If you are in Normal Mode, **Shift+Tab** (or **Tab** on Windows) first switches into `auto-edits` Mode, indicated by `⏵⏵ accept edits on` at the bottom of the terminal. A subsequent **Shift+Tab** (or **Tab** on Windows) will switch into Plan Mode, indicated by `⏸ plan mode`.
|
|
42
42
|
|
|
43
|
+
**Use the `/plan` command**
|
|
44
|
+
|
|
45
|
+
The `/plan` command provides a quick shortcut for entering and exiting Plan Mode:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
/plan # Enter plan mode
|
|
49
|
+
/plan refactor the auth module # Enter plan mode and start planning
|
|
50
|
+
/plan exit # Exit plan mode, restore previous mode
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
When you exit Plan Mode with `/plan exit`, your previous approval mode is automatically restored (e.g., if you were in Auto-Edit before entering Plan Mode, you'll return to Auto-Edit).
|
|
54
|
+
|
|
43
55
|
**Start a new session in Plan Mode**
|
|
44
56
|
|
|
45
57
|
To start a new session in Plan Mode, use the `/approval-mode` then select `plan`
|
|
@@ -59,14 +71,10 @@ qwen --prompt "What is machine learning?"
|
|
|
59
71
|
### Example: Planning a complex refactor
|
|
60
72
|
|
|
61
73
|
```bash
|
|
62
|
-
/
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
|
|
74
|
+
/plan I need to refactor our authentication system to use OAuth2. Create a detailed migration plan.
|
|
67
75
|
```
|
|
68
76
|
|
|
69
|
-
Qwen Code analyzes the current implementation
|
|
77
|
+
Qwen Code enters Plan Mode and analyzes the current implementation to create a comprehensive plan. Refine with follow-ups:
|
|
70
78
|
|
|
71
79
|
```
|
|
72
80
|
What about backward compatibility?
|
|
@@ -235,7 +243,7 @@ qwen --prompt "Run the test suite, fix all failing tests, then commit changes"
|
|
|
235
243
|
|
|
236
244
|
### Keyboard Shortcut Switching
|
|
237
245
|
|
|
238
|
-
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the
|
|
246
|
+
During a Qwen Code session, use **Shift+Tab** (or **Tab** on Windows) to quickly cycle through the four modes:
|
|
239
247
|
|
|
240
248
|
```
|
|
241
249
|
Default Mode → Auto-Edit Mode → YOLO Mode → Plan Mode → Default Mode
|
|
@@ -61,6 +61,7 @@ Commands for managing AI tools and models.
|
|
|
61
61
|
| `/mcp` | List configured MCP servers and tools | `/mcp`, `/mcp desc` |
|
|
62
62
|
| `/tools` | Display currently available tool list | `/tools`, `/tools desc` |
|
|
63
63
|
| `/skills` | List and run available skills | `/skills`, `/skills <name>` |
|
|
64
|
+
| `/plan` | Switch to plan mode or exit plan mode | `/plan`, `/plan <task>`, `/plan exit` |
|
|
64
65
|
| `/approval-mode` | Change approval mode for tool usage | `/approval-mode <mode (auto-edit)> --project` |
|
|
65
66
|
| →`plan` | Analysis only, no execution | Secure review |
|
|
66
67
|
| →`default` | Require approval for edits | Daily use |
|
|
@@ -12,7 +12,7 @@ After Qwen Code finishes responding, a suggestion appears as dimmed text in the
|
|
|
12
12
|
> run the tests
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
The suggestion is generated by sending the conversation history to the model, which predicts what you would naturally type next.
|
|
15
|
+
The suggestion is generated by sending the conversation history to the model, which predicts what you would naturally type next. If the response contains an explicit tip (e.g., `Tip: type post comments to publish findings`), the suggested action is extracted automatically.
|
|
16
16
|
|
|
17
17
|
## Accepting Suggestions
|
|
18
18
|
|