Repository navigation
fix(chutes): report accurate context windows for sparse catalog rows - #119196
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 7:41 AM ET / 11:41 UTC. ClawSweeper reviewWhat this changesThe PR makes Chutes model discovery use a valid serving Merge readinessThis is a necessary, narrow Chutes catalog fix with no actionable defect found. Current main ignores valid Priority: P2 Review scores
Verification
How this fits togetherThe Chutes provider plugin fetches its vendor model catalog and projects each row into OpenClaw model metadata. That metadata supplies the context window used by the authenticated provider catalog for agent model selection and budgeting. flowchart LR
Auth[Authenticated Chutes profile] --> Catalog[Chutes model catalog]
Catalog --> Projection[Chutes row projection]
Projection --> Choice{Valid context limit}
Choice --> Window[Registered context window]
Window --> Provider[Chutes provider catalog]
Provider --> Agents[Agent model selection]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +35. Total +39 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the provider-local precedence chain and land it after required GitHub checks complete for the exact head. Do we have a high-confidence way to reproduce the issue? Yes. Current main's fallback expression source-proves the sparse-row failure, and the PR supplies exact-head public-catalog output through the production discovery path. Is this the best way to solve the issue? Yes. The Chutes projector owns this vendor-specific field shape; shared runtime already delegates projection there, and sibling providers use equivalent positive-value precedence rather than a core workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2a3a840aaf80. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: (22 commits) refactor(plugins): consolidate lifecycle hook dispatch (#119429) fix(ci): stabilize TUI PTY proof ownership (#119420) test(system-agent): reduce suite setup overhead (#119424) fix(ui): keep session rail pill status from overlapping the headline (#119397) fix(discord): avoid doctor runtime loading (#119391) fix(media): decouple playback cache retention (#119417) fix(slack): infer upload filename extensions from MIME types (#119399) refactor(channels): unify configured binding resolution (#119414) refactor(google-meet): unify gateway and tool dispatch (#119413) test(state): reuse legacy database fixtures (#119423) fix(reset): preserve bootstrap guidance for dynamic models (#119179) fix(chutes): honor serving context limits (#119196) refactor(status): consolidate scan projections and lazy loaders (#119412) fix(status): status --all slows down with missing plugins (#119203) refactor(gateway): consolidate usage reporting and caches (#119409) perf(gateway): keep reload and recovery machinery off gateway cold start (#119094) fix(cli): align TaskFlow controller columns for wide text (#118801) fix: make startup migration restart guidance install-neutral (#119406) fix(ci): preserve cache warmer shard envelopes (#119403) fix(sessions): preserve compatible auth profiles on model changes (#117550) ...
Related: #118868
What Problem This Solves
Fixes an issue where Chutes users could have models registered with a smaller context window when a live catalog row omitted
context_lengthbut provided a validmax_model_len. The current public catalog exposes two such models withmax_model_len=131072, while OpenClaw registered both with the generic128000fallback.Why This Change Was Made
The Chutes-owned live catalog projection now selects the first valid value in this order:
context_length,max_model_len, then the existing128000default. Keepingcontext_lengthfirst preserves the provider's explicit product-level limit when both fields are present, whilemax_model_lensupplies the serving limit only when that primary field is unavailable or invalid.User Impact
Chutes model discovery now preserves the provider's available context capacity for sparse catalog entries. Existing rows with
context_lengthkeep their current behavior, and malformed or non-positive metadata still falls back safely.Evidence
context_lengthcases registered128000instead of131072.node scripts/run-vitest.mjs extensions/chutes/models.test.ts— 14 tests passed.scripts/run-vitest.mjs— 27 tests passed.node scripts/run-tsgo.mjs -p extensions/chutes/tsconfig.json --noEmit— passed.oxfmt --check, targeted oxlint, andgit diff --check— passed.max_model_lenas the maximum sequence length, and its catalog aggregation preserves the instance value by excluding it from metadata overrides.Exact-head live proof (
704192488b3cffd1e2b64c2d39129ef3c756e239), using the publichttps://llm.chutes.ai/v1/modelsresponse and the productiondiscoverChutesModels()path: