Repository navigation
v0.5.1 — Independent extension preview for Pi 1.3.0, 1.2.0 and 1.1.0
Pre-releasePi Context Compaction v0.5.1 supplies an ordinary extension for unmodified official Pi 1.3.0, 1.2.0 and 1.1.0.
Install this release's extension package (a fixed package tag) from your terminal, then restart Pi:
pi install git:github.com/youxi-huang/pi-context-compaction@extension-v0.5.1Start a new persistent text session and run /compaction-doctor to check it without calling a model. Source tag v0.5.1 selects the development monorepo, not the package. To follow later previews instead, install the moving extension-preview branch in place of the tag and update only this package with pi update --extension git:github.com/youxi-huang/pi-context-compaction@extension-preview. A plain pi update updates Pi itself.
This pre-release supports manual /compact and Pi's threshold compaction after completed text turns, source-linked history retrieval and explicit disk-confirmed failure recovery. In the sessions it handles, overflow recovery still requires explicit /compact, and background cache warming is paused. Sessions it never protected and cannot check, such as ones with native checkpoints, images or another Pi version, are left to Pi without a failure marker. Other checkpoint formats, parent-history grants, attachments, concurrent writers and Windows are outside its verified scope.
Ordinary Agent retries after transient provider failures are supported, including partial-response connection drops. Existing retry-related blocks and text-only context-overflow failures can use explicit /compact recovery when sufficient completed source history exists. Arbitrary context edits and unfinished tool-call omissions remain unsupported.
Optional preparation has two arms, both disabled by default: A prepares with the configured writer; B merges data-only work notes from the session model. A validated candidate can commit its covered prefix without a writer call while every later original stays verbatim. B carries covered user messages in full and falls back to the configured writer when they do not fit. Every writer call is journaled, including cancelled or discarded preparation and unknown usage. These are experimental paths; real-provider pause, total cost, cache behavior and recovery benefits remain unproven.
Validation: this publication run passed 88 stock-Pi package and lifecycle checks on official Pi 1.3.0, 1.2.0 and 1.1.0 and the full default-settings scenario suite on Pi 1.3.0 with strict acceptance and no performance exceptions or known gaps. Scenario evidence is bound to this exact package and source commit; the 50 ms request-overhead target and checkpoint-growth bound are required checks. Focused, security and frozen evaluator checks also remain required on final main. Services are synthetic and loopback only; no real-provider quality, latency or interactive TUI claim is made.
Source commit: e215597. Preview runtime: stock-preview+src.a6732408742a34f4. Resident runtime keeps its v0.3.0 fingerprint.
Usage and recovery · Validation
Changes
v0.5.1 makes the independent extension's quotation repair cheaper and its failures easier to diagnose. The repair now runs without reasoning, whatever the writer's effort: in v0.5.0 one repair at high spent its output on reasoning and returned nothing usable. /compaction-status names what each writer call asked for, what its request carried and how it ended, and counts the citations behind a scope refusal. A repair can no longer withdraw a ruling a user stated, and context_history's list no longer marks a still-valid fact as superseded. The changes are in the independent preview only: the resident runtime, its build fingerprint, the checkpoint schema and the evaluation pin are unchanged. Two bounded runs with DeepSeek V4.1 Flash on Pi 1.3.0 are in the validation record: over 38 planted repair cases, two attempts each, the repair passed 76 of 76 without reasoning against 75 of 76 at high, and in writer benches beside a same-day run of the v0.5.0 release build the candidate committed 121 of 128 notes against 62 of 64. They cover one model and synthetic tasks, not a general failure rate.
Added
/compaction-statusreports for each writer call the reasoning effort it asked for, the reasoning settings and output cap its provider request carried, read from the request Pi built without its content, and how the response ended; a quotation repair's withdrawn facts are also counted by section. In v0.5.0 a repair that spent its output on reasoning could not be told apart from other failed calls. On official Pi 1.1.0 to 1.3.0, a DeepSeek Flash session at thinking levelmediumalready runs athigh, because the model declares nomedium, so its writer sendsreasoning_effort: "high".- For a note refused with
CONTEXT_NOTE_SCOPE,/compaction-statuscounts the cited IDs that name no entry on the branch and those of entries with no readable text, by entry kind, without naming them. The two call for different fixes, and the refused note itself is not stored. Four such refusals in one DeepSeek writer bench left their cause unknown.
Changed
- The quotation repair runs without reasoning, whatever the writer's effort. In v0.5.0 one repair at
highspent 10,720 of its 11,962 output tokens reasoning and returned nothing usable. On DeepSeek V4.1 Flash over the 38 planted repair cases, two attempts each, the repair passed 76 of 76 without reasoning against 75 of 76 athighand atlow, at a median of 65 output tokens and 1.4 s against 277 and 2.4 s athigh, and none of the three levels lost a user's ruling. The size repair keeps the writer's effort; it was not measured. - The quotation and size repairs set no tool choice, as the session writer does. Their requests offer no tools, so the model sees the same request; they no longer send
tool_choice: "none"without any tool to choose.
Fixed
context_history's list no longer marks a still-valid fact as superseded because a revision names the entry it shares with a revised fact. A note'ssupersedesnames entries, not facts: a constraint stated in the same message as a timeout that was later raised was listed as replaced by the new timeout. A revision now marks only the facts of its own section on that entry, and only when they are no more than the revisions naming it; other facts on a revised entry carrysourceRevisedBy, and the tool description says what it means.- A quotation repair can no longer withdraw an instruction whose quoted text a user message contains. Such a repair committed a note without the rule; it now refuses the note with
CONTEXT_NOTE_REPAIR_LOSS, and re-citing the rule or dropping its quote remains possible. Withdrawing a fact no user message supports is unchanged.
Maintenance
- The preview writer bench has a
repairmode over 38 deterministic quotation-repair cases planted in the P fixtures: misattributed, misspaced, echoed and paraphrased rulings, and an order only a tool wrote. Only the repair reaches the measured model, and scoring counts lost rulings and instructions quoted from assistant or tool text without a judge.--provider deepseek-localbuilds the requests from Pi's DeepSeek catalog model and answers them locally.