Skip to content

[eng-2213] Write context window and max tokens into Pi's models.json on configure - #40

Merged
lavicosa merged 2 commits into
mainfrom
fix/eng-2213-pi-configure-context-window
Oct 27, 2026
Merged

lavicosa merged 2 commits into
mainfrom
fix/eng-2213-pi-configure-context-window

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Replaces #37 so the branch name matches the ticket. The code is the same, squashed into one commit.

Before this change, requesty configure for Pi wrote only {"id": "<model>"} into ~/.pi/agent/models.json. Pi then used its custom-model defaults (contextWindow ?? 128000, maxTokens ?? 16384 in modelFromJson), so plain pi auto-compacted a 1M-context model at 128k.

The shared modelpicker already holds the full client.Model from /v1/models and /v1/models/managed. modelpicker.ChosenMsg now carries that Model instead of just the ID. The integrations wizard copies its ContextWindow and MaxOutputTokens into ConfigureOptions. Both Pi configure paths (merge and overwrite) build the entry with piCatalogModelFrom, the same function the requesty pi launch catalog uses:

{"id": "anthropic/claude-sonnet-5-5", "contextWindow": 1000000, "maxTokens": 128000}

If the model list has no value for one of these fields, the launch default is written instead (piCatalogContextWindow 200k, piCatalogMaxTokens 8192). Other harnesses ignore the new options.

These values are fixed when you run configure. If the pi-requesty extension is installed, it replaces them with live limits when Pi starts.

I tested this end to end on #37 with the real Requesty catalog: TUI configure, then plain Pi with --no-extensions. The Pi footer showed /1.0M; results are in the #37 comments.

Link to Devin session: https://app.devin.ai/sessions/ed8e81b7f4e246f79baeef970ae8f691
Open in Devin Desktop: https://app.devin.ai/desktop/session/ed8e81b7f4e246f79baeef970ae8f691?variant=devin
Requested by: @requesty-JohnCosta27

…on configure

Co-Authored-By: john <john@requesty.ai>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

AI Cost

No spend detected for branch fix/eng-2213-pi-configure-context-window in the last 30 days.

Updated 2026-10-27T13:10Z · last 30 days · data from Requesty

@github-actions github-actions Bot added the cost:$0.00 AI cost for this branch label Oct 27, 2026
Comment thread internal/harnesses/harnesses.go Resolved
Co-Authored-By: john <john@requesty.ai>
@lavicosa
lavicosa self-requested a review October 27, 2026 13:11
@lavicosa
lavicosa merged commit 2358187 into main Oct 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cost:$0.00 AI cost for this branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants