Repository navigation
fix: allow configuring Pi output token limit - #12393
Conversation
…ens option and opencode output limit for Pi
|
Review record for #12393, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#270. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
Pi launches regenerate models.json with a fixed output cap (a quarter of the context window, up to 32,000 tokens), so users cannot request longer responses without editing each session's config.
Add
--max-tokenstounsloth start piand pass it into both the normal provider config and the local subagent config. For example:unsloth start pi --model 'path' --max-tokens 10000The option is the same shared
--max-tokensthatunsloth start opencodealready takes, with the same rules: the default is unchanged when omitted, nonpositive values are rejected, and a value above half the loaded context window is capped at half with a warning so the conversation keeps room. When Studio reports no context length, the requested value is written as given. The option must be supplied each launch; it does not create a saved preference.Validation:
unsloth_cli/tests/test_start.pyandunsloth_cli/tests/test_pi_subagent.pypass. Tests cover both launch modes, repeated config generation, the half-window cap, invalid values, and missing or alternate context metadata.