fix(runtimes): preserve native Pi output and report provider limits #102
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/3695edba-pi-output-limit"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Pi could finish with an empty successful turn after spending its output budget on thinking, and provider HTTP400 errors hid their context-overflow classification. Report output exhaustion clearly, retain partial output/cancellation, and settle recovered prompts from the final assistant outcome. Known overflow codes become a fixed safe category after bounded parsing; raw provider messages stay discarded.
thinking-only limit → explicit failure; partial limit → max_tokens; recovered assistant → final outcomeMorten requested direct harness fidelity and CLI paging/counts on2026-10-29. The previously proposed Pi tool-result shortening hook has been withdrawn. Pi retains native tool output and compaction. The oversized task-list issue remains pending the source-level CLI work.
Evidence
docs/implementation/cli-output-audit.md; Morten approved structured JSON page envelopes on 2026-10-29 at 17:02. The follow-up draft and its budget stop are recorded on task HOMEIT-456.docs/implementation/pi-providers.md. The CLI audit covers list/history/revision collections, existing cursors/caps, composite details, mutation echoes andwaitcursor safety. No CLI paging implementation is present yet.Merge danger
Door: reversible code change; release publication is irreversible.
Blast radius: app. No new tool capability, extension, dependency, permission, destination, credential, personal-model/limit change or migration. Prior setup Security review remains linked; removing an unshipped restriction adds no capability beyond the native Pi configuration already reviewed. Provider error classification remains fixed and bounded to16KiB under existing deadlines.
No release approval granted. Main creates a release draft and publishes docs/server image. The next decision is the cumulative code ceiling for the wider CLI work; release approval follows a concrete final implementation. Production is independently v0.57.1,1/1 ready at server sha256:238b1ab492ebe11dc80e043371c1e2f02312f57c334ca4bfd48f583b461507ad; none of PR102 is deployed. The prior v0.56.3 approval request at5ca0928 is superseded, not treated as accepted.
Rollback and verification
Task3695edba-e6e0-4611-bd99-82c991a7d28a; related proposed HOMEIT-472 does not reset the cumulative feature ceiling. Branch
fix/3695edba-pi-output-limit.CLI follow-up budget stop — 2026-10-29
The source head of this PR remains
922dc119, with all eight Forgejo statuses success and pipelines 725/726 green. No failing paging draft has been pushed into this head.Morten approved the paged JSON compatibility change. A preserved draft against this head implements SQL summary pages/counts, scoped continuation, byte limits and terminal hints for task discovery. Full suite: 1,072 passed, six opt-in skipped. A real 16k Gemma assigned-task discovery/page/detail/done flow passed twice. The wider live batch passed five cases; its full-MC output-limit case passed one isolated retry after an initial waiting-vs-failed mismatch, which remains recorded.
The draft adds 202 retained production lines to the existing 1,788, reaching 1,990/2,000. Its quality gate is blocked by style/module limits. A non-mutating automatic-fix forecast reaches exactly 2,000 before structural cleanup. Work stopped before the ceiling; no waiver or deployment. Cleanup is estimated at 30–60 additional lines, and the remaining audited CLI scope at 650–1,050. Morten must choose the budget/scope before implementation continues. A 3,200 ceiling covers the full forecast; a smaller 2,100 option finishes only task discovery and explicitly defers the broader audit.
Task comment
2af00ee5-f7e4-461d-bf07-d6b4bdb991becontains the reviewable patch, inventory and detailed review. Patch file2ba6e564-90da-42eb-9a61-a7be4699024ccan be retrieved withmission-control file get; it applies cleanly to this head. The persistent worktree has been restored clean, with the patch retained in the Software Engineer home. Production is still v0.57.1, ready 1/1. Original Moxie verification and publication remain pending.Author review of
b2c27d0against40f8d71, task HOMEIT-456 and its output-limit acceptance finding.Standards
No remaining findings. One adapter correction; no new interfaces, loop, configuration, dependency, auth/destination/permission or concurrency capability. Repository ESLint/type/format/dependency checks pass. Tests use ACP and subprocess edges, retaining real Pi RPC framing. No temporary debug code remains. Cumulative retained production is 1764/2000 against initial5529986; tests/docs excluded and inventoried. Prior required setup Security review remains zero findings; this correction has no new security trigger.
Spec
No remaining code finding. Thinking-only length fails clearly; partial text returns max_tokens; cancellation wins; a new prompt resets the outcome. Known Pi length takes priority over incidental completed-stream ECONNRESET. Before/after regression observed; 14 focused tests passed. Real Home Llama direct cap/resume and full Mission Control failed-run/recovery passed. No personal configured limit was changed.
Exact-head push708 and PR709 are SUCCESS: 1,052 tests and both image builds, without publication. Main creates a draft, so fresh Morten v0.56.3 release approval remains a separate merge gate. After approval verify paired images/mirror/Argo/actual new agent and explicit limit/recovery on released images; rollback is paired v0.56.2 pins, retaining all data. Full context, other models, genuine authenticated endpoints, saturation/backlog and all expiry paths remain unverified live.
Standards: 0 findings. Spec: 0 findings. Release approval outstanding.
fix(runtimes): report Pi output exhaustion without an empty successto fix(runtimes): bound Pi tool context and report exhausted outputAuthor review at
5ca0928against40f8d71. Standards: 0 findings. Spec: 0 findings in the prepared change; release/live Moxie verification remains gated. Checked the complete diff, installed Pi 1.4.0 hook/compaction semantics, exact same-task red/green reproduction, six Home Llama acceptance cases, standalone compiled bridge and task ci:quality (1,053 passed; six opt-in cases executed separately). Fixed source receives only a computed bounded number, lives in the private runtime temporary directory and is loaded explicitly; user/provider content cannot become executable code. Tool-result content is bounded with a shortening notice; tool arguments, error flags and capabilities are unchanged. The error reader consumes at most 16 KiB under existing request deadlines and returns only fixed categories, never raw upstream text. Final assistant outcome can supersede a recovered provider error while transport/buffer/deadline failures remain fatal. Cancellation/partial-output/resume regressions passed. No new security trigger: no expanded destination/auth/permission/execution capability, dependency or user-controlled extension. Prior setup Security review remains linked in the PR; this is author review of the corrective restriction. Cumulative retained production 1,807/2,000. Fresh v0.56.3 release approval is still required before release-creating merge. Production remains v0.56.2; native successful overflow compaction, actual production Moxie retry, real authenticated providers, other models/full context, peak backlog and every deadline expiry remain unverified.fix(runtimes): bound Pi tool context and report exhausted outputto fix(runtimes): preserve native Pi output and report provider limitsAuthor review at922dc11 against current main
dd2050d. Standards: no code findings. Spec: prepared native-output withdrawal/error reporting is verified; CLI paging/counts remain unimplemented and block parent completion. The raw-array JSON compatibility decision is explicitly pending, so this is not merge/release-ready. Reviewed runtime diff, changed acceptances, complete CLI source audit and budget. The fixed Pi tool_result hook and its loading arguments are removed; native tools/compaction remain Pi-owned. Safe provider error classification is fixed-text only, at most16KiB and under existing deadlines; recoverable assistant outcomes do not clear fatal transport/buffer/deadline failures. Native-output regression went red with shortening and green after withdrawal; five real Home Llama cases passed. Local quality before merging current main:1,053 tests passed; combined exact-head CI is recorded in PR/task evidence. Earlier cap-dependent synthetic task-success acceptance was explicitly withdrawn with the rejected design, not silently claimed as passing on this head. No new authorization, destination, credential, dependency or execution capability. Current inventory1,788/2,000 including two pins; unrelated current-main UI/generated changes excluded as documented. Source-level CLI discovery, actual production Moxie retry, authenticated providers, other models/full context, backlog and every deadline expiry remain unverified. Main release automation still requires fresh approval after final implementation; earlier v0.56.3 request is superseded. Exact-head push725 and PR726 are now SUCCESS at922dc11, all eight Forgejo statuses success, including1,062 tests and both image builds without publication.Follow-up draft assessment; this is NOT a finding against the unchanged green source head
922dc119. Reviewed cli-pages-wip.patch against that head, SHA256 4da93a5e2ddcc0d20216db00de942e7aa6c199da7ffeed6210a89fe3bebc2e73, attached to task HOMEIT-456 comment 2af00ee5-f7e4-461d-bf07-d6b4bdb991be.Standards — BLOCKING draft findings: 19 style/structural gate failures (required braces, enclosing route/function size, paging parameter/complexity limits, existing TaskService file-size limit). Automatic fixes alone reach the hard 2,000-line ceiling; structural cleanup remains. The draft is preserved rather than pushed as a failing PR head. Current PR head retains eight green statuses, pipelines 725/726.
Spec — BLOCKING remaining scope: task-list SQL counts/summary pages/byte limits/cursors/hints work in the draft, but other audited collections, composite reads, mutation echoes and stream cursor safety remain unimplemented. Approved JSON compatibility is honored. No Pi output hook was added. Full draft suite 1,072 passed; real 16k Gemma discovery-to-done passed twice. Wider live batch 5 passed/1 failed, with its failed output-limit case passing one isolated retry; exact initial mismatch remains unverified.
Cumulative draft 1,990/2,000; cleanup forecast 30–60, broader CLI 650–1,050. Budget/scope decision required before more production code. No release approved or deployment performed. After completion and release approval, verify CI/mirror/ArgoCD/paired running digests and original Moxie flow; rollback through paired GitOps image pins.
Findings: Standards 1 blocking group, Spec 1 blocking group, neither waived. Software Engineer retains ownership.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.