fix(models): use the 1M context window Qoder actually supports (#13)

auto, efficient and lite carried a 180K contextWindow, so pi showed >100%
context usage and auto-compacted early. Live testing in #13 drove global
lite to 1,000K tokens successfully, so the 180K value was a stale
max_input_tokens floor rather than a real limit.

Introduce DEFAULT_CONTEXT_WINDOW (1M) and use it for the global static
models, including gm51model. Apply it as the catalog fallback too, but only
when /model/list advertises no context_config: models that do advertise a
smaller window (kmodel at 256K, CN GLM-5.2 and MiniMax at 200K) keep it
rather than being inflated to 1M. CN Auto stays at 200K since only global
lite was verified at 1M.

Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-08-31 15:57:49 +00:00
co-authored by Simon Shi
parent 1dd1b0988b
commit 1e44cde685
4 changed files with 159 additions and 36 deletions
+6 -1
View File
@@ -111,6 +111,11 @@ Exposes the backing model keys returned by Qoder, including:
- `kmodel_latest` (Kimi K3)
- `mmodel` (MiniMax M3)
Global models default to a 1M context window, matching the Qoder API (verified
against `lite` with prompts up to 1,000K tokens). `kmodel` stays at the 256K its
catalog entry advertises. Once you log in, the live `/model/list` catalog
overrides these fallbacks with the largest context option each model exposes.
### China `qoder-cn`
The China provider exposes friendly model IDs and maps them back to Qoder CN's
@@ -118,7 +123,7 @@ internal keys at request time:
| Friendly ID | Qoder CN key | Context | Images | Reasoning |
| --- | --- | ---: | :---: | :---: |
| `auto` | `auto` | 180K | ✅ | ✅ |
| `auto` | `auto` | 200K | ✅ | ✅ |
| `qwen3.7-max` | `qmodel_latest` | 1M | ✅ | ✅ |
| `qwen3.7-plus` | `qmodel` | 1M | ❌ | ✅ |
| `qwen3.6-flash` | `q36fmodel` | 1M | ❌ | ✅ |