Repository navigation
feat(gateway): table the GLM-5.3-Flash window, drop GLM-4.7-cc - #350
Merged
Merged
Conversation
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: the context gauge understated the window and auto-compaction fired ~62K tokens early. Trigger is the uniform 90% (235930); as with M3 that target plus the 40000 reserve exceeds the window, so declaredInput's clamp pins limit.input at the window and the effective trigger is 222144. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Its 200000 restated DEFAULT_WINDOW exactly, so limitsFor returns the same
{context: 200000, trigger: 180000} through the default tier and every config
block is written byte-identically. The table now carries only the models
whose window differs from the default.
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
In
packages/codev-gateway/src/model-limits.ts:zai-org/GLM-5.3-Flashat 262,144 tokens, the same window asMiniMax/MiniMax-M3zai-org/GLM-4.7-ccThe table now carries only the models whose window differs from the default.
Why
Without a table entry GLM-5.3-Flash resolved to
DEFAULT_LIMITS(the safe 200K fallback), so every config written for it — TUI/configure,codev configure, the desktop SSO sign-in, and the sandbox guest block — understated the window in the "% context used" gauge and started auto-compacting about 62K tokens earlier than the model can actually take.The GLM-4.7-cc entry's
200000restatedDEFAULT_WINDOWexactly, so removing it changes nothing:limitsForreturns the same{ context: 200000, trigger: 180000 }through the default tier, and a config block for that model is written byte-identically. The file's own comment already said an entry restating the default is one more thing to keep in sync.Numbers
limitsFor("zai-org/GLM-5.3-Flash")→{ context: 262144, trigger: 235930 }(the uniform 90%). As with M3,trigger + COMPACT_RESERVED(235930 + 40000) exceeds the window, sodeclaredInput's clamp pinslimit.inputat 262144 and the effective trigger is262144 − 40000 = 222144(~85% of the window). That clamp is pre-existing behaviour for every model with a window under 400K, not something this PR introduces.limit.inputAssumption to confirm
The 262,144 window is taken from "configure it like MiniMax-M3" — M3 is capped there by the deployment's resources rather than by the model. If the gateway actually serves GLM-5.3-Flash with a different window, say so and I'll change the one number. Guessing too high is the direction that hurts (a session can run past the real ceiling and 400 mid-chat), so this is worth a second pair of eyes. It can also be overridden without a release: the moment an admin sets
max_input_tokenson the model in LiteLLM,fetchModelWindowscaches it and the remote tier outranks this table.Scope
DIVERGENCES.mdrow:packages/codev-gatewayis a fork-only package, and no upstream file is touched.Testing
bun testinpackages/codev-gateway— 65 pass, 0 failbun typecheckinpackages/codev-gateway— clean🤖 Generated with Claude Code