qwen-code/packages
Shaojin Wen 1e8bc031cc
feat(core): adaptive output token escalation (8K default + 64K retry) (#2898)
* feat(core): adaptive output token escalation (8K default + 64K retry)

99% of model responses are under 5K tokens, but we previously reserved
32K for every request. This wastes GPU slot capacity by ~4x.

Now the default output limit is 8K. When a response hits this cap
(stop_reason=max_tokens), it automatically retries once at 64K — only
the ~1% of requests that actually need more tokens pay the cost.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add design doc and user doc for adaptive output token escalation

- Add design doc covering problem, architecture, token limit
  determination, escalation mechanism, and design decisions
- Document QWEN_CODE_MAX_OUTPUT_TOKENS env var in settings.md
- Add max_tokens adaptive behavior explanation in model config section

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 17:30:39 +08:00
..
channels fix(weixin): add missing iLink-App-Id and iLink-App-ClientVersion headers 2026-04-07 15:26:00 +08:00
cli Merge pull request #2897 from QwenLM/feat/thinking-cross-turn-retention-idle-cleanup 2026-04-08 15:26:53 +08:00
core feat(core): adaptive output token escalation (8K default + 64K retry) (#2898) 2026-04-08 17:30:39 +08:00
sdk-java feat: simplify subagent model configuration with model selector 2026-03-27 11:49:45 +08:00
sdk-typescript Merge pull request #2698 from QwenLM/refactor/subagent-model-selection 2026-04-01 16:17:54 +08:00
test-utils chore: bump version to 0.14.1 2026-04-03 16:17:10 +08:00
vscode-ide-companion Merge pull request #2897 from QwenLM/feat/thinking-cross-turn-retention-idle-cleanup 2026-04-08 15:26:53 +08:00
web-templates chore: bump version to 0.14.1 2026-04-03 16:17:10 +08:00
webui Merge remote-tracking branch 'origin/main' into feat/plan-mode 2026-04-07 21:04:25 +08:00
zed-extension chore(zed-extension): update package version to 0.10.0 2026-02-06 14:26:01 +08:00