Repository navigation
feat!: remove image pre-compression and the image_full tool (#3266) - #3295
Conversation
The opt-in compress.imageCompression pass and its image_full restore channel are structurally broken where they matter most: - hosts that reject bili-injected tools (codex) can never deliver the restore call — the downscale is permanent for them (#3270 disarmed the lane, which proved the tool was dead weight there); - where the tool IS injectable, the model has no reliable way to learn the ref of the downscaled message (no ref annotations on the wire), producing the 38-round guess-reject-resend loop from #3266 (cache hit 75% -> 28%). Remove the whole feature from host and kernel: arrival-time downscale pass, image_full injection + sticky restore + fail-streak guardrail, image stats, persistence keys, wire-contract tool variants, config schema, docs, and the sharp optional dependency. Every image now passes through byte-identical at original resolution. Sessions persisted by older versions load unchanged; legacy imageShrinks/imageFullRestored state keys and imageShrunk* stats are ignored on load (storage corpus pins that as a fixture). kernel 0.0.126.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.3844-pr.3295.a9b37faThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3295.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…tats fields + stale comments Review of the main removal commit left dead code behind: ImageFormat/ ImageBillingMode type aliases and the CompressionStats imagesShrunk/ imageBytesSaved/imageTokensSaved fields (seeded by createInitialState, asserted in the kernel persist test) had zero remaining readers after src/image-compress.ts went away. Removed them and reworded three comments that still described the image_full restore channel as live.
The first commit regenerated the corpus after stripping the legacy image keys, so tests/storage-corpus.test.ts asserted 'keys must NOT materialize' against a fixture that never carried them — a vacuous pin while the PR body claimed the corpus pinned back-compat. The generator now re-injects the pre-#3266 keys into the on-disk record after the normal write (writeAndPin mutateFiles hook), so the fixture carries exactly what an older version persisted. Verified load behavior pins honestly: whitelisted readers DROP stats.imageShrunk*/imageFull* and state.imageShrinks/imageFullRestored; metadata is an opaque host bag and passes THROUGH (legacy imageShrinks survives as inert data — the digest covers the loaded view, so it pins that split). All case digests shift because the kernel state.stats blob lost its three image fields; folded/zstd pair stays byte-identical.
(ai: vllm-qwen/qwen3.8-27b) Review 结论:PR #3295 — 删除图片预压缩与 image_full 工具查重:不重复(首条评论已给:仅祖先 #3266/#3270,均已关闭)。 八问:
审阅中发现并已直接修复的问题(2 个 commit 已推 PR 分支):
作者侧在我审阅期间自行落了 da58486(website yaml 陈旧种子清理),与我发现的 stale-docs 问题重合,未重复修。 观察项(不拦):corpus 全量再生成含既有漂移——biliVersion 戳 0.1.191→0.1.197、storageMode 字段新增、folded fixture tail 顺序(master 自 v0.1.191 以来有 #3050/#3194 等多个 persist 提交,goldens 只是追平,非本 PR 引入);我的第 2 个 commit 使所有 case digest 因 kernel state.stats blob 缩 3 字段而平移(有意,commit message 已注明)。 验证:定向本地测试 storage-corpus + wire-contract 29/29、kernel persist 45/45、 判定:可合(CI 全绿后)。 方向成立、删除彻底、back-compat 真正钉住、死代码已收尾、行为变更全部披露。 |
…the PR body after the last push kernel-guard snapshots github.event.pull_request.body at dispatch time (ci.yml PR_BODY), so the runs triggered by the review-fix commits still carry the pre-marker body and would fail on a red herring. This empty commit produces a fresh pull_request event whose payload includes the declaration.
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.463-master.e479ed3 # this exact build
npm install -g billion-context@master # always the newest merged build
|
…am (#3252) The compress/absorb loop's round-2 replay rebuilt its system prompt without the project attribution line, so the trigger turn and the replay diverged in the pre-summary head — every cache-friendly, cache-proof and seam-probe leg went red. Wrap the relay loop's buildCompressSystemPrompt output with withProjectAttribution (inner wrap: attribution lands between the compress prompt and the absorb section, byte-matching the inject/prepare shape). Storage-render goldens regenerated via scripts/update-storage-render-goldens.ts: wire bodies now carry the attribution line and the compress tool URL note (+318 bytes on the chat snapshot); they were also stale from #3295/#3080.
…olden-rebaseline test: rebaseline storage-render goldens after #3295 dropped dead image-stats fields from state.stats
…nglei#4351) The suite grew ~399 -> ~860 files in three weeks while the core matrix shape stayed frozen at its ~650-file design point (ranxianglei#3295), so its heaviest legs became the per-PR wall-clock floor: the ubuntu-24 single-leg whole suite measured ~21 min and the windows 2-shard halves ~13-17 min (up to ~35 min tails on flake re-runs). All three core combos now shard /3. partitionAll stays total for any i/N, so the union of shards is still every file — zero coverage loss; the wall drops to the slowest shard (~7-12 min instead of 20-25). The win node-24 legs stay FULL-scope only. Check-run names are unchanged (explicit job name template), and all nine core leg names already sit in master's required-checks list.
…3295) Review follow-up on this PR (owner-directed in-PR fix): after dropping master from ci.yml's push arm, the janitor's "never cancel master" guard only matched event==push && branch==master, so it no longer covered master's new verification signal — the :03/:33 schedule runs. Extend the guard to also exempt master schedule runs (push stays covered for master-build/release, which remain push-triggered), and correct the now-stale "head's required checks" comment.
…mers (ranxianglei#3295) Owner decision 2026-11-01: every merge into master re-ran the CORE matrix (~30 heavy shards across two OSes) whose results nobody consumes — nothing blocks on them and nobody reads their red, while they burn minutes other PRs are waiting for (the queue pile-up of this week was fed by exactly these runs). Master coverage does not lapse: - pre-merge blocking stays intact (pull_request arm + the 14 required test-shard checks on PRs are untouched) - the :03/:33 schedule cron, which re-runs the FULL matrix whenever master moved since the last green scheduled run, becomes master's standing verifier (bounded ~30 min window) - release-ci-gate --wait already accepts green runs at EXTRA_MATCH_SHAS (PR head HEAD^2), and release-branch releases ride the UNCHANGED push arms - master-build.yml / release.yml fire on their own master-push triggers independent of CI green Release/bugfix push arms stay: bot-authored PR checks sit in action_required, so head sha checks must come from real-token ref pushes (ranxianglei#772). Verified: YAML parse OK; tests/release-ci-gate.test.ts 16/16 (all mock API).
What
Removes the entire
compress.imageCompressionfeature and theimage_fulltool — host and kernel — per the decision on #3266 (fixes shipped as #3270 first, then the call was made to delete instead of redesign).Why delete (not fix)
imageCompression.enabled: false), so only explicit opt-ins are affected; for them every image now passes through byte-identical at original resolution.What's removed
image-compress.ts(downscale pass, restore, notes), tool declarations, config schema/state/persist keys — kernel 0.0.125 → 0.0.126src/image-compress.ts, 4 prepare lanes' pass + tool injection + trailing note, handle stamping, session stats/Maps, persist fields, loop/stream tool dispatch, side-request + pi-subagent allowlists, ingest whitelist, config schema, compress-settings plumbingsharpis no longer an optional dependency (package-lock −583 lines)Back-compat
Sessions persisted by older versions load unchanged: the legacy
imageShrinks/imageFullRestoredstate keys and allimageShrunk*/imageFull*stats are dropped on load (whitelisted readers). One nuance pinned in review:metadatais an opaque host bag and passes through as-is, so a legacymetadata.imageShrinksentry survives in memory as inert data nothing reads. The storage corpus pins this as a REAL fixture — the generator re-injects the pre-#3266 keys into the on-disk record after write (scripts/update-storage-corpus.ts), andtests/storage-corpus.test.tsasserts each key lands where the contract says (dropped: stats/state; passed through: metadata).Tests
tsc --noEmitclean,npm run buildOKCloses #3266 (redesign tracked there if it ever comes back).
kernel-change: image-compression removal — kernel/src/image-compress.ts deleted (downscale pass, image_full tool, restore + fail-streak), config schema/state/persist keys removed; kernel 0.0.125 → 0.0.126. Part of the #3266 feature deletion (PR title and body carry the full rationale).