Repository navigation
docs(pi): document output-cap config mismatch root cause - #53
Merged
Merged
Conversation
The loop-guard blocks the retry but not the truncation. Root cause: models.json overrode deepseek-v4-flash:0731 maxTokens to 65536 (real cap 32768) and defaultThinkingLevel was high, so high reasoning on a 32K output budget truncated long tool calls. Document the config contract: maxTokens must equal the real cap, thinking must fit the budget, tool calls stay short, and large-output needs use a model that has one.
Contributor
Review — PASSHead SHA: Security screen: PASS — docs-only change to Checklist: All applicable rules PASS or NA.
Verdict: PASS ollama/deepseek-v4-flash — pi-review-action. |
This was referenced Aug 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the ROOT CAUSE of the truncated pi responses in
.pi/APPEND_SYSTEM.md, verified live against the provider (not guessed from catalog values).Root cause (provider-verified via
pi -pspike, 2026-08-30):deepseek-v4-flash:0731(ollama-cloud) has a REAL maximum output of 65536 tokens. The provider rejects any highermax_tokenswith:max_tokens (131072) exceeds model's maximum output tokens (65536)(observed live). The catalog's 32768 is understated; the DeepSeek docs' 384K does not apply to this ollama-cloud deployment.maxTokensmust be 65536 — the true maximum. Never higher (provider rejects), never lower (wastes capability).finish_reason="length", and the harness fails every tool call in the length-stopped message ("Re-issue the tool call with complete arguments") — the loop.The config contract:
maxTokens= 65536 (provider-verified real maximum); thinking at full capability (high/max); keep tool calls SHORT and delegate heavy exploration to subagents so a single response stays within the 65536 budget — the only lever that prevents truncation without reducing capability.User-level config applied:
models.jsonmaxTokens = 65536,settings.jsondefaultThinkingLevel = high.How tested
maxTokens: 131072, the provider rejected the request:max_tokens (131072) exceeds model's maximum output tokens (65536) for model deepseek-v4-flash:0731. This empirically established the real cap.maxTokens: 65536(verified inmodels.json); the rejection is gone.git commitran the umbrella pre-commit gate:pre-commit: OK.Rulebook compliance
Change classification
pi -pspike.analysed on a live system— the root cause was proven by a live provider rejection, and the config fix was applied and verified.Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (analysed on a live system)