feat(config): AutoContextWindow regex inference + Qwen/GLM/DeepSeek model presets
Summary / 概述
Add AutoContextWindow regex inference and refresh the Qwen/GLM/DeepSeek model presets.
新增 AutoContextWindow 正则推断,并刷新 Qwen/GLM/DeepSeek 模型预设。
Changes / 改动
internal/config/context_auto.go(new, 85 lines) — infer the model's context window from the configured model name via regex rules, so catalog models without an explicit context entry get a correct compaction budget instead of a blanket default. / 通过正则规则从配置的模型名推断上下文窗口,让目录中没有显式上下文条目的模型获得正确的 compaction 预算而非一刀切默认值。internal/config/provider_presets.go— update Qwen/GLM/DeepSeek presets: refreshed model lists and context-window overrides for the current catalogs. / 更新 Qwen/GLM/DeepSeek 预设:刷新模型列表与上下文窗口覆盖。- The DashScope price table is intentionally dropped from this PR (kept the AutoContextWindow + Qwen presets only), per the refactor commit. / 按重构提交,DashScope 价格表不包含在本 PR(只保留 AutoContextWindow + Qwen 预设)。
Relation to prior PRs / 与先前 PR 的关系
This branch originally grew out of the same local chain as the footer fixes — #7128 (footer overflow scope) and #7138 (footer test hardening) — and shares their base commits. It has been rebased onto the latest main-v2 (11a797b0c), so there is no code dependency on #7128/#7138. The Qwen context-limit work builds on the already-merged #6971 (session recovery + Qwen context limits).
本分支最初与 footer 修复 #7128 和 #7138 同源于一条本地提交链,共享其基础提交。现已变基到最新 main-v2(11a797b0c),与 #7128/#7138 无代码依赖;Qwen 上下文限制工作建立在已合并的 #6971 之上。
Files / 文件
| File / 文件 | Change / 改动 |
|---|---|
internal/config/context_auto.go |
new, 85 lines / 新增 85 行 |
internal/config/provider_presets.go |
78 changed / 修改 78 行 |
Verification / 验证
go test ./internal/config ./internal/provider/responses ./internal/bootgo vet ./...git diff --check
Cache-impact: low - config presets and context-window inference are resolved at config load; they do not change request serialization for unchanged user configurations.
Cache-guard: go test ./internal/config ./internal/provider/responses ./internal/boot -count=1
System-prompt-review: config-only change; the system-prompt composition is not modified by this PR.