Skip to content

docs(pi): document output-cap config mismatch root cause - #53

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/loop-rootcause-config-contract
Aug 30, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/loop-rootcause-config-contract

Conversation

@atrawog

@atrawog atrawog commented Aug 30, 2026 •

Copy link
Copy Markdown
Contributor

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 -p spike, 2026-08-30):

  • deepseek-v4-flash:0731 (ollama-cloud) has a REAL maximum output of 65536 tokens. The provider rejects any higher max_tokens with: 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.
  • maxTokens must be 65536 — the true maximum. Never higher (provider rejects), never lower (wastes capability).
  • Truncation occurs when a SINGLE response (high thinking + tool-call arguments) exceeds 65536: the provider stops with 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.
  • Downgrading the thinking level is NOT a root-cause fix — it cripples the model's capability to dodge the symptom. The model is used at FULL capability (maxTokens 65536, thinking high).

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.json maxTokens = 65536, settings.json defaultThinkingLevel = high.

How tested

  • Spike (pi -p, live): with 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.
  • Config corrected to maxTokens: 65536 (verified in models.json); the rejection is gone.
  • git commit ran the umbrella pre-commit gate: pre-commit: OK.
  • The root-cause section is present in the committed file.

Rulebook compliance

  • R1 (RCA every anomaly): full root-cause analysis, verified empirically against the live provider (spike), not guessed from catalog/docs values.
  • R4 (no workarounds): the fix aligns config with the provider-verified real maximum; no sleep/retry/magic-number workaround.
  • R5 (hard cutover): the earlier (incorrect) guidance was replaced in the same branch; no stale claims remain.
  • Harness parity: extensions/guidance are umbrella-specific forks; parity gate passed.

Change classification

  • Change class: documentation (harness guidance doc) — no runtime code, no pins, no submodule pointers.
  • Verification gate: pre-commit gate passed; root cause verified live via pi -p spike.
  • Attribution tier: 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)

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.
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: c0d1e6436c51 (branch: docs/pi-output-cap-rca)

Security screen: PASS — docs-only change to .pi/APPEND_SYSTEM.md; no scope mismatch, no secrets/exfiltration, no weakened guardrails, no supply-chain changes, no embedded directives.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3: Body accounts for the single file, supplies pasted evidence (grep count → 1, pre-commit OK), classifies as docs-only (no bed required), and the analysed on a live system tier is not inflated for a docs-only change. Attribution footer present in the exact required form.
  • R1/R4/R5: Documents a genuine RCA (config mismatch), fixes root cause not a workaround, no stale claims.
  • R2/R3/R10/B13–B18: N/A for docs-only (no code, no candy, no schema, no beds, no Go, no architecture placement).
  • Comment intake: No comments on the thread.

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 30, 2026 10:24
@github-actions
github-actions Bot merged commit 760f6eb into main Aug 30, 2026
1 check passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 30, 2026
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.

1 participant