mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-08-06 23:35:34 +00:00
* feat(core): preload deferred tools within a context-window threshold Adds tools.toolSearch.threshold (default 10, percent of the context window). At session start, when the combined estimated schema footprint of every deferred tool - bundled built-ins and MCP alike - fits within the budget, all are revealed upfront so the declaration list stays stable for the whole session and prefix KV caches survive; otherwise everything stays deferred. Set 0 to always defer. Mirrors Claude Code's ENABLE_TOOL_SEARCH=auto threshold mode, extended to bundled deferred tools because here every reveal rewrites the declaration list and busts the prompt-cache prefix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * feat(core): log deferred-tool preload budget decision Emit debugLogger diagnostics in preloadDeferredToolsWithinBudget covering the computed budget, estimated token footprint, candidate count, and which branch of the all-or-nothing gate was taken (no candidates, over budget, or preloaded). Lets an operator diagnosing session-startup cost tell from debug logs whether the deferred set fit the budget or was left behind ToolSearch, without adding temporary instrumentation. No behavior change. * fix(tools): bound toolSearch.threshold to 0-100% The threshold setting is a percentage of the context window but had no upper bound, so a value like 200 (a typo or misreading of the "(%)" label) made the preload budget exceed the whole window and unconditionally preloaded every deferred tool — the opposite of the prefix-stability the threshold buys. - Add minimum:0/maximum:100 to the setting schema (jsonSchemaOverride, like autoCompactThreshold) and regenerate the VS Code settings schema. - Add a symmetric runtime upper guard next to the existing 'thresholdPercent <= 0' lower guard in client.ts, clamping to 100% so a hand-edited settings file cannot slip a larger budget past validation. Adds a client test asserting a 200% threshold clamps to a full-context budget. * test(core): cover configured preload budget * fix(tool-search): harden preload threshold * test(tool-search): cover preload exclusions --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| _meta.ts | ||
| auth.md | ||
| model-providers.md | ||
| qwen-ignore.md | ||
| settings.md | ||
| themes.md | ||
| trusted-folders.md | ||