Repository navigation
refactor(model-limits): plain model id, uniform 90% trigger - #259
Merged
Merged
Conversation
The table now carries only context windows — the trigger is always 90% of the window regardless of source (table, default, or gateway-reported) — and the 1M model's id is a plain string instead of base64. Effective changes: the 1M model's compaction target moves from 800K to 900K (OpenCode limit.input 940000, Codex auto_compact_token_limit 900000); 200K-class models trigger at 180000 for Codex, while their OpenCode declared input stays clamped at the window (effective 160000) and Claude Code stays at its 80% ceiling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The gateway serves MiniMax-M3 with a 262144-token window (resource cap), not the model's native 1M. Trigger at 90% is 235930; for OpenCode the target + 40000 reserve exceeds the window, so declaredInput's clamp pins limit.input at the window (effective trigger 222144). Codex takes 235930 directly; Claude Code stays at its 200K ceiling. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
quickbeard
added a commit
that referenced
this pull request
Sep 10, 2026
…262) * feat(model-limits): give GLM-5.3-Flash its served 262144 window The gateway serves zai-org/GLM-5.3-Flash with the same 262144-token window as MiniMax-M3 (a deployment resource cap, not the model's native window), but with no table entry it fell back to the safe 200K default — so every agent CoDev configures for it was told the wrong window. One table entry covers every command: install, config, model, and the launch-time key refresh all write through the four configure.ts writers, and each resolves its numbers from limitsFor. Also refreshes the AGENTS.md section that still described the pre-#259 model-limits shape (explicit per-model triggers, an atob-encoded M3_ID, DEFAULT_LIMITS at 200K/160K) and notes that the table has a twin in codev-code that has to move with it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * feat(model-limits): drop the GLM-4.7-cc window entry Its 200000 restated DEFAULT_WINDOW exactly, so limitsFor returns the same {context: 200000, trigger: 180000} through the default tier and all four writers emit identical config. The table now carries only the models whose window differs from the default. Tests that used the id as a stand-in for a 200K model now use DEFAULT_LIMITS or an unlisted id, so each still covers the default-window branch it was written for. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two changes to
src/lib/model-limits.ts, matching quickbeard/codev-code#337 so the hub and CoDev Code's own configure flows keep writing the same numbers:M3_ID = atob(...)is gone; the table keys on"MiniMax/MiniMax-M3"directly.TABLEnow carries only context windows (Record<string, number>), and the trigger is always 90% of the window (COMPACT_PCT = 90, replacingDEFAULT_COMPACT_PCT = 80) whatever the window's source: the table, the 200K default, or a gateway-reported window vialimitsFromWindow. Cachedmodel_limitsentries in auth.json keep whatever trigger they were stored with.MiniMax-M3's table window is 262,144 — the current deployment serves it with that cap (resource limit), not the model's native 1M.
Effective numbers
Per agent:
declaredInput's existing clamp pinslimit.inputat the window itself — M3 262,144 (effective trigger 222,144), 200K-class 200,000 (effective 160,000). Never past the ceiling.model_auto_compact_token_limit= 235,930 for M3, 180,000 for 200K-class (written directly, no clamp).contextLength262,144 for M3.Tests
pnpm test(1431 passed),pnpm typecheck,pnpm checkall clean. Updated expectations inmodel-limits.test.ts,configure.test.ts(OpenCode input math, Codex pins, Continue contextLength), andModelSelect.test.tsx(window→limits conversion at 90%).🤖 Generated with Claude Code