Repository navigation
fix: bili pi launcher disables pi's native auto-compaction (#447) - #448
Conversation
The `bili pi` launcher never disabled pi's own context compaction, so pi's native summarizer (shouldCompact, enabled by default) could fire ahead of / alongside bili's ACP compression and lossily rewrite the context bili is managing — losing the detailed history. The pi overlay (<piHome>-bili) is now ALWAYS built when the real pi home exists and always carries a settings.json with compaction.enabled=false (merged over the user's real settings.json, which is never mutated). This makes bili's ACP compression the sole compression path under `bili pi`, mirroring how codex/claude already get their native auto-compact aligned. - refreshOverlayHome / mergeOverlayEntry now accept a SET of generated files (models.json + settings.json) so both stay out of the real-home symlink and merge-back sets. - models.json is still rewritten for HTTP/wrapped-HTTPS upstreams when present. - preparePiHttpRewrite returns undefined only for a missing real home.
📦 Built Package ArtifactBranch: Option A — Install from npm PR tag (recommended)npm install -g billion-context@pr-448Each push to this PR publishes a new version under the Option B — Download artifact
tar xzf billion-context-pr448.tgz
npm install -g packageThis comment is automatically updated on each push. |
[bot] 🏷 Reviewed PR #448 (fixes #447). Verified and analyzed in detail — assessment below. Verification (all green):
The root cause is real and the fix targets it correctly. For pi, raw-HTTPS providers (the common case) are classified into
The #410 guarantee now holds for both generated files.
Consistent with codex/claude, with an intentional mechanism difference. Same goal (ACP is the sole compression path). codex's local compaction is benign (same-session truncation the kernel deactivates by message id), so codex gets threshold alignment ( Two small notes (non-blocking):
Bottom line: LGTM to merge. Correct fix, well-tested (the new/updated |
- wire-contract goldens regenerated for acp-kernel 0.0.93→0.0.95 via scripts/update-wire-contract-goldens.ts: compress/decompress/search schemas gain explicit typed anyOf alternatives (kernel #448, the Copilot-Gemini portability fix). Reviewed: no unrelated drift. - preflight e2e windows 10_600 → 12_000: the typed-alternative schema grew tool definitions by ~1.4KB (~340 tokens of wireOverhead, which every fit decision adds per #470). At 10_600 the recent zone no longer fit after folding — fold-all is correct behavior for a tight window, but these tests pin 'recent messages survive', so they need the headroom the pre-#448 schema size had. Payload still overflows 12k (~13k-token history), so the preflight-fire premise is intact.
…chema (ranxianglei#1414) Kernel ranxianglei#448 (acp-kernel 0.0.95) replaced the compress tool's union type arrays and untyped anyOf fragments with explicit typed alternatives; Bili bundles that schema at build time, so the exact dev-dependency pin is the delivery path. Adds tests/wire-schema-portable.test.ts walking Bili's full outgoing ACP tool surface on all four wires (anthropic/openai/responses/google, including withRangeParams rewrites): no union type arrays, every anyOf alternative declares an explicit scalar type, top level stays a plain object. Red against 0.0.93 (3/4 wires fail), green against 0.0.95. Fixes ranxianglei#1414
Problem (#447)
bili pinever disabled pi's own context compaction, so pi's native summarizer (shouldCompact,enabled: trueby default) could fire ahead of / alongside bili's ACP compression and lossily rewrite the context bili is managing — losing the detailed history.Fix
The pi overlay (
<piHome>-bili) is now always built when the real pi home exists, and always carries asettings.jsonwithcompaction.enabled=false(merged over the user's realsettings.json, which is never mutated). This makes bili's ACP compression the sole compression path underbili pi, mirroring how codex/claude already get their native auto-compact aligned (codexmodel_auto_compact_token_limit, claudeCLAUDE_CODE_AUTO_COMPACT_WINDOW).Changes:
refreshOverlayHome/mergeOverlayEntrynow accept a set of generated files (models.json+settings.json) so both stay out of the real-home symlink and merge-back sets (the 真实 models.yml 可被塞进死端口代理地址且永不解包:"real file never touched" 前提被嵌套 merge-back 递归与遗留插件写破,裸 omp 永久拨死号 #410 guarantee now holds for both).preparePiHttpRewritereturnsundefinedonly for a missing real home;models.jsonis still rewritten for HTTP/wrapped-HTTPS upstreams when present, and copied verbatim otherwise.writePiCompactionDisabledSettingsmerges the realsettings.jsonwithcompaction.enabled=false(other keys —packages,theme,reserveTokens, … — preserved).Verification
npm run typecheck✅npm test— 899 pass, 0 fail ✅npm run build✅settings.json) → overlaysettings.json={packages, theme, compaction:{reserveTokens:16384, enabled:false}},models.jsonbaseUrl rewritten to/bili/, realsettings.jsonuntouched ✅Launcher-only change (no request-pipeline change), so the codex E2E suite is not exercised by this diff.