Skip to content

Write context window and max tokens into Pi's models.json on configure - #37

Closed
devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1791370894-pi-configure-context-window
Closed

devin-ai-integration[bot] wants to merge 2 commits into
mainfrom
devin/1791370894-pi-configure-context-window

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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 model-registry.ts), so a 1M-context model run through plain pi stopped at 128k.

The TUI model picker already loads client.Model from /v1/models. It now copies the picked model's ContextWindow and MaxOutputTokens into ConfigureOptions. In both configure paths, Pi builds its entry from those with piCatalogModelFrom, the same function the requesty pi launch catalog uses:

{"id": "openai/gpt-5.5", "contextWindow": 1050000, "maxTokens": 128000}

If the list has no value for one of these, the launch defaults are written (piCatalogContextWindow 200k, piCatalogMaxTokens 8192). Other harnesses ignore the new options.

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

@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 7, 2026 •

Copy link
Copy Markdown

AI Cost

No spend detected for branch devin/1791370894-pi-configure-context-window in the last 30 days.

Updated 2026-10-07T11:13Z · last 30 days · data from Requesty

@github-actions github-actions Bot added the cost:$0.00 AI cost for this branch label Oct 7, 2026
Comment thread internal/harnesses/pi.go Outdated
// modelConfig describes model in models.json with the capacities the model
// list reports, since Pi caps a model without them at 128k tokens. When the
// list cannot be fetched, the launch defaults stand in.
func (p *PiHarness) modelConfig(model string) piModelConfig {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you're doing here. If we have access to the Model, don't we also have the context window information?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, refetching wasn't needed. The TUI model picker already has the full client.Model. In dfe9c5f the picker copies ContextWindow/MaxOutputTokens into ConfigureOptions with the ID, and Pi builds its entry from those with piCatalogModelFrom. That drops the network call and the httptest server. If the list has no values, the launch defaults (200k / 8192) apply.

Written by Devin

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.

1 participant