qwen-code/packages/cli
Shaojin Wen 55893875b0
Some checks are pending
Qwen Code CI / Classify PR (push) Waiting to run
Qwen Code CI / Lint (push) Blocked by required conditions
Qwen Code CI / Test (macos-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Test (ubuntu-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Test (windows-latest, Node 22.x) (push) Blocked by required conditions
Qwen Code CI / Post Coverage Comment (push) Blocked by required conditions
Qwen Code CI / CodeQL (push) Blocked by required conditions
E2E Tests / E2E Test (Linux) - sandbox:docker (push) Waiting to run
E2E Tests / E2E Test (Linux) - sandbox:none (push) Waiting to run
E2E Tests / E2E Test - macOS (push) Waiting to run
feat(cli): add tools.toolSearch.enabled setting for prefix-caching models (#4069)
* feat(cli): add tools.toolSearch.enabled setting to disable ToolSearch for prefix-caching models

ToolSearch (PR #3589) defers MCP tool loading to reduce prompt size, but
breaks prefix-based KV caching for models like DeepSeek V4 where cached
token pricing is 1/120 of uncached. Users reported cache hit rates
dropping from ~98% to ~81% and 3x cost increases (discussion #4065).

Add a `tools.toolSearch.enabled` setting (default: true) that disables
ToolSearch by adding tool_search to the deny list, triggering the
existing eager-reveal fallback in client.ts. All deferred tools are then
included in the initial declaration list, restoring prompt prefix
stability.

Auto-disable ToolSearch for deepseek-v4-* models when the setting is not
explicitly configured, since their extreme cache discount makes prefix
stability far more valuable than the ~15K token savings from deferral.
Users can override with `tools.toolSearch.enabled: true`.

* fix: address PR review — expand model detection, add tests, regenerate schema

- Remove ^ anchor from regex to handle provider-prefixed model names
  (e.g. openrouter/deepseek/deepseek-chat)
- Expand auto-detection to all DeepSeek models with prefix caching:
  deepseek-v3, deepseek-v4-*, deepseek-chat
- Add 6 tests covering: explicit disable, auto-detect for v3/v4/chat
  with provider prefix, non-deepseek skip, explicit enable override
- Regenerate settings.schema.json for vscode-ide-companion
2026-05-12 12:04:26 +08:00
..
src feat(cli): add tools.toolSearch.enabled setting for prefix-caching models (#4069) 2026-05-12 12:04:26 +08:00
index.ts fix(cli): stop double-wrapping and double-printing API errors in non-interactive mode (#3749) 2026-05-03 08:39:31 +08:00
package.json chore(deps): upgrade ink 6.2.3 → 7.0.2 + bump Node engine to 22 (#3860) 2026-05-11 17:29:50 +08:00
test-setup.ts fix: prevent bogus shell permission rules in tests 2026-03-20 17:55:33 +08:00
tsconfig.json Add background agent resume and continuation (#3739) 2026-05-01 12:14:33 +08:00
vitest.config.ts refactor(core): Unify package exports and improve dev experience 2026-02-01 11:59:05 +08:00