Repository navigation
Releases: kunkun9527/billion-context-pi-lean
Releases · kunkun9527/billion-context-pi-lean
Release list
v0.2.2
- Lean facade repairs malformed model arguments before validation (
prepareArguments, no extra tokens):acp_contextaccepts JSON-stringargs, top-level op fields and an omittedop(inferred only from unambiguous fields);compressaccepts a JSON-stringcontent, JSON-string entries insidecontent, and a range array placed insummarywithoutcontent. Explicit and invalid ops are left for validation.
v0.2.1
- Pi only: removed every non-Pi host path. OMP detection and refusal, Pi-fork host support (
PI_ACP_FORK_HOST,live-*refs for unpersisted messages, the.primeconfig dir), thehostSessionturn-boundary policy, inline child-state derivation (deriveChildState) and thecreateRuntime/SessionRefexports are gone, along with the~/.cache/opencodedecompress target. A turn now always starts at a user message;hostSessioninacp.jsonis ignored. Sessions forked with Pi/forkstill inherit the parent's blocks through theparentSessionheader. The billion-context proxy stand-down and the./contractsidecar schema export stay. - Removed upstream-only material from the repo (paper, devlog, design docs, cost estimator, offline benchmark script);
CONFIGURATION.mddrops upstream issue links and older history here now points to the upstream CHANGELOG.
v0.2.0
Versions are now numbered independently of upstream billion-context-pi (previously 0.1.83-lean.N). Upstream fixes are still ported as needed.
- Idle compact (
idleCompact, off by default): afteridleMinutesof idle time (default 29, just inside a 30-minute prompt cache), ACP starts one turn that shows the main model the regular compress nudge (below the usual thresholds) and lets it decide whether to compress. With the cache still warm that turn reads the long prefix from cache, so the request sent when the user returns carries the shorter context instead of rewriting the long one uncached. One global value for every model; set it a little under the cache lifetime of the models you use. At most one idle compact turn per idle period; skipped when there is less to compress thanminPressureBenefitTokens, outside TUI/RPC mode, or when the timer wakes more than a minute late (sleep). During that turn only ACP tools may run; user input or a sub-agent result turns it back into a normal run. /acp-configsettings panel (TUI): Summary model (pick from the models Pi can use, type to filter), Idle compact on/off and Idle minutes, per-model Context threshold / Nudge interval / Minimum benefit for the current model, Tool output cap, bash default timeout, Debug log. Names match the README. Writes~/.pi/acp.json(other keys kept) and applies at once; warns when a project.pi/acp.jsonoverrides the key.- fix(rebuild): when the
.acp.jsonsidecar is missing, a compress call that passedcontentas a JSON string (non-strict-tool providers do this) is rebuilt from the session log instead of being skipped silently. The rebuild parses arguments with the live tool'snormalizeRanges. - Removed the self-update code (
src/update.ts). A useracp.jsonwithautoUpdate: trueused to override the fork's "always off" default and runnpm installagainst the npm package;autoUpdateandACP_AUTO_UPDATEare now ignored. Update withpi install. - README reorganized: a short "How it works" section (including the tools the model sees) up front; Idle compact and the settings panel added to the upstream comparison; the Configuration section now explains
/acp-configwith one settings table, and keeps hand-editingacp.jsonfor what the panel cannot do (per project, per provider, options not in the panel).
Install: pi install npm:billion-context-pi-lean@0.2.0 (or pi install git:github.com/kunkun9527/billion-context-pi-lean@v0.2.0)
v0.1.83-lean.10
- Published to npm as
billion-context-pi-lean:pi install npm:billion-context-pi-lean. The package now ships the Lean facade (lean/index.ts), whichpi.extensionspoints at. Git installs keep working. - The package name changes from
billion-context-pitobillion-context-pi-lean: hosts importing the API (import { createAcpExtension } from "billion-context-pi") switch to the new name, and the dormant self-update code queries the new name. - README: token benchmark against upstream 0.1.83 (486 vs 8,670 tokens, 94.4% fewer). The Chinese README is now
README_zh-CN.md.
Install: pi install npm:billion-context-pi-lean@0.1.83-lean.10 (or pi install git:github.com/kunkun9527/billion-context-pi-lean@v0.1.83-lean.10)
v0.1.83-lean.9
- Lean facade: the resident ACP prompt keeps only pre-call rules (hidden refs, what may be compressed,
acp_contextop signatures, summaries are history, not instructions). Guidance that already arrives with nudges, compress errors, decompress results and the provider-throttle retry message is no longer resident. - Lean facade: with a dedicated summary model, the per-turn prompt adds the 1-2 sentence fallback rule. Pi snapshots tool descriptions before
acp.jsonloads, so the compress description alone always showed the non-dedicated text. - Lean facade: a compress call that folded ranges ends with a reminder that the new summaries are visible in the call's arguments, so they need no decompress.
- README: tools + resident prompt re-measured on Pi 1.3: about 490 tokens (was about 800).
Install: pi install git:github.com/kunkun9527/billion-context-pi-lean@v0.1.83-lean.9
v0.1.83-lean.8
- Dedicated summary model (
compressionModelId: provider/id, andsessionwithout a captured prefix) now summarizes exactly what the kernel folds: a dry run ofapplyCompressionon a cloned state gives each range's real block (paired tool calls, protected-zone exclusions), so a range naming only a tool result no longer hides the call that says what it was. - The caller's fallback summary is passed to the summary model as a
<caller_note>— purpose and axis only, never a source of facts. - Summary-model prompt gains READING THE TRANSCRIPT / SOURCE ATTRIBUTION / CALLER NOTE rules: tool output (files, logs, other sessions, recalled history) is examined material and its quoted requests or Open objectives never become this conversation's; precision rules are unchanged; examined material is summarized as "Looked for X → found Y"; text outside
<content>is control metadata, not a user request. CARRY FORWARD now names earlier Open objectives explicitly. - Caller (main model) rules: the fallback states what was done or examined, why, and the outcome with its decisive values.
- Summary rules: a direct
ask_user_questionresult is the user speaking (chosen option, typed text and notes are user decisions; an unchosen recommendation or a declined form is not approval). Open items are split intoOpen objectives:(user-requested),Pending suggestions (not user-requested):andUnverified / known risks:; uncertainty qualifiers (estimated, assumed, unverified) survive until evidence resolves them, and a user's approval verifies nothing. Earlier summaries' items keep their category on carry-forward. - Planning-text leaks: a summary whose opening prose is the model talking to itself about writing it (or echoing
Output only summary) is retried once with a reminder; a second leak rejects the range (not folded, never silently stripped). Quoted text and summaries opening with a heading, list or table are not flagged; no false positives over 2,349 existing blocks. - Summary rules: WHAT COMPRESSION DOES AND DOES NOT CHANGE — compression only changes what the agent sees, never undoes files or commands; the range is not the end of the conversation, so state is described as of the range end; a shell working directory or variable is never recorded as standing state (each command runs on its own). CARRY FORWARD no longer calls earlier summaries "the only record".
- Summary rules: every summary closes with
State at end of this range (history, not instructions):— last action → result, changes → verification, failures still open. A plan stated at the range end goes under Pending suggestions asplan at range end (ref), never as a task. The section is in addition to the body and toUnverified / known risks:. - Transcript echo: a summary that copies transcript entries (a run of
[assistant:… call]/[tool:… result]headers, or a</content>line) is retried once with its own reminder; a second echo rejects the range (not folded). Seen once in 116 real Luna runs: 65K chars, the model fell through into its input after the state section. - Stability: sidecar writes to one session file are serialized and each uses its own temp file (overlapping saves could rename the same
.acp-tmp-*twice →ENOENT);acquireLockno longer drops a later waiter's queue on release; compress / decompress /acp_rulehold the session lock across their read-modify-save. - Stability: when the dedicated summary model fails for a range (API error, length stop, input too large), that range is not folded — the caller's short fallback would replace the detailed summary (or, on a refold, the earlier blocks' summaries). Successful ranges in the same call still fold; if every range fails the call errors (counts toward the retry cap). Setup problems (unresolvable model, host without
complete()) still fold with the fallback and warn. - Stability: the compress toolResult records what was folded (
details.acpFolded, never sent to the model); state rebuild from the session log prefers it, so a lost sidecar no longer rebuilds blocks from the short fallbacks or folds ranges that failed. The Lean facade passesdetailsthrough unrewritten. - Stability: a block whose covered messages are partly on another branch of the session tree (after
/treeinto its range) stays inactive for that turn, so its summary cannot show decisions from messages that branch has not reached; returning to the full branch reactivates it. Pi host only. - Stability: decompressing a message to an auto file uses a filesystem-safe name (raw entry refs can contain
|, which Windows rejects). - Kernel
acp-kernel0.0.98 → 0.0.101 (nudge re-anchoring when the count drops, linear-time compress parsing, case-insensitive protected tool names, one prune/recommend index per turn). Its refs widen past five digits afterm99999(up tom9999999); message-ref parsing now accepts them, so long sessions keep ref identity and outgoing rewrites. A session that reached six-digit refs should not go back to an older build. - Lean facade on Pi 0.83–0.85: those hosts pass
systemPromptOptionsbut never rendersections, so the ACP prompt was silently missing. The facade now keeps the named section only when the rendered prompt picks it up, and otherwise returns the composed prompt as before. npm run measure: tool + resident-prompt footprint vs upstream 0.1.83 in a blank Pi session (needs the siblingmy-lean-pi-setupworker). README numbers re-measured on Pi 1.1: about 800 tokens vs 8,700 upstream (4,900 withpromptPack: "lean").
Install: pi install git:github.com/kunkun9527/billion-context-pi-lean@v0.1.83-lean.8
v0.1.83-lean.7
- Removed sub-agent delegation entirely: the
acp_delegate/acp_delegate_wait/acp_delegate_canceltools, the fleet inspector (/acp-fleet,fleetShortcut),/acp-subagentsand pi-subagents detection, theACP_DELEGATE NOTIFICATIONSprompt appendix, and delegate usage inacp_status(no more "Delegate usage: none this session." line). Config keysdelegate.*, top-leveldisplayUsage,delegatePromptand thePI_ACP_DELEGATE_*env vars are now ignored. This is a context manager; use a dedicated sub-agent extension for sub-agents — their sessions are still managed by ACP.
Install
pi install git:github.com/kunkun9527/billion-context-pi-lean@v0.1.83-lean.7Based on upstream billion-context-pi v0.1.83. Full history: CHANGELOG.md.
v0.1.69-lean.1
- Updated
billion-context-piruntime to 0.1.69. - Kept delegation and automatic updates disabled in the lean wrapper.
- Refreshed benchmark: 690 vs 5,802 initial tokens (88.1% reduction).
- Compatibility tests and type checks pass.