Skip to content

feat(gateway): table the GLM-5.3-Flash window, drop GLM-4.7-cc - #350

Merged
quickbeard merged 2 commits into
mainfrom
feat/glm-5-3-flash-window
Sep 10, 2026
Merged

quickbeard merged 2 commits into
mainfrom
feat/glm-5-3-flash-window

Conversation

@quickbeard

@quickbeard quickbeard commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

What

In packages/codev-gateway/src/model-limits.ts:

  • adds zai-org/GLM-5.3-Flash at 262,144 tokens, the same window as MiniMax/MiniMax-M3
  • removes zai-org/GLM-4.7-cc

The 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 200000 restated DEFAULT_WINDOW exactly, so removing it changes nothing: limitsFor returns 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, so declaredInput's clamp pins limit.input at 262144 and the effective trigger is 262144 − 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.

context limit.input effective trigger
GLM-5.3-Flash before (200K default) 200 000 200 000 160 000
GLM-5.3-Flash after 262 144 262 144 222 144
GLM-4.7-cc, before and after 200 000 200 000 160 000

Assumption 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_tokens on the model in LiteLLM, fetchModelWindows caches it and the remote tier outranks this table.

Scope

  • Existing configs are not rewritten — a user picks the new numbers up by re-running a configure flow (or the hub).
  • No DIVERGENCES.md row: packages/codev-gateway is a fork-only package, and no upstream file is touched.
  • The parallel table in codev-hub gets both changes in feat(model-limits): table the GLM-5.3-Flash window, drop GLM-4.7-cc codev-hub#262 — the two are separate copies by design and have to move together.

Testing

  • bun test in packages/codev-gateway — 65 pass, 0 fail
  • bun typecheck in packages/codev-gateway — clean

🤖 Generated with Claude Code

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>
@quickbeard quickbeard changed the title feat(gateway): give GLM-5.3-Flash its served 262144 window feat(gateway): table the GLM-5.3-Flash window, drop GLM-4.7-cc Sep 7, 2026
@quickbeard
quickbeard merged commit f15e7e4 into main Sep 10, 2026
1 of 5 checks passed
@quickbeard
quickbeard deleted the feat/glm-5-3-flash-window branch September 10, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant