Skip to content

fix(pi): declare each model's context window in Pi models.json - #106

Merged
duyet merged 1 commit into
mainfrom
fix/pi-context-window
Oct 20, 2026
Merged

duyet merged 1 commit into
mainfrom
fix/pi-context-window

Conversation

@duyet

@duyet duyet commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #105

Root cause: src/spawn.rs pi_models_config wrote {"id"} only, so Pi assumed 128k for every model. Now writes contextWindow (catalog context_length) and maxTokens (top_provider.max_completion_tokens).

Before/after for minimax/minimax-m3.1-flash: 128000 -> 1000000 window, maxTokens 524288. Tests: models.json carries both; parser reads max_completion_tokens. cargo test + clippy green.

Separate from #102 (Claude [1m] window) and the Rust-CLI claude path; no overlap.

🤖 Generated with Claude Code

Pi defaults to 128k unless an entry sets contextWindow. Write contextWindow
and maxTokens from the catalog context_length and top_provider.max_completion_tokens.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Co-authored-by: Duyet Le <me@duyet.net>
Co-authored-by: duyetbot <bot@duyet.net>
@duyet
duyet merged commit 3302bc6 into main Oct 20, 2026
6 of 7 checks passed
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.

anyr pi gives Pi a 128k context window for every model

1 participant