Repository navigation
fix(#2698,#2699,#2697): repair stripImages-removal race — typecheck + budget tests + doc - #2702
Conversation
…dget test #2688 removed compress.stripImages/stripImagesKeepRecent from CompressSettings, but #2613's image-request-budget test (merged after #2688) still referenced them, breaking master typecheck. Drop the dead keys from the fixture config and the inert stripImages=false toggle line; keep every assertion intact (over-budget rebuilt request -> forward-stage 413, no upstream contact). Zero behavioral change.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2918-pr.2702.e81f07aThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2702.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…semantics Supplement to 990cbe8 (which fixed only the tsc errors): under post-#2688 semantics there is no wire-side image reduction left, so the two tests that asserted the removed stripImages recovery path (200 + reduced rebuilt body) fail at runtime with the forward-stage 413. Adapt them to assert the actual contract: over-budget rebuilt bodies stop at stage=forward / request_too_large without touching upstream, whether images sit in messages or tool outputs; the admission-slot flow ends at the same forward guard once a slot is released. Also fix reference/request-body-budget.md (en+zh), which still told users to configure the removed compress.stripImages. Verified locally: tsc --noEmit clean; node --import tsx --test --test-concurrency=1 tests/image-request-budget.test.ts tests/request-body-budget.test.ts -> 10/10 pass.
Review 结论(含在本分支上直接完成的补充工作): 方向关:正确。issue 家族(#2699/#2698/#2697)同一机制(#2688/#2613 merge race),修复方向是适配 post-#2688 语义而非恢复被删机制——即 #2698 的 option 2。 首轮 review 发现(已就地修掉,commit 八问:
测试有效性:改写后的断言有牙——未来若有人重新引入对超预算 body 的静默缩减、或让大 body 触碰上游, 验证:本地 tsc clean;受影响全套 10/10 pass(含两个改写测试);合并前复现了 master 基线(tsc 2 错 + 2 个 runtime 失败)。 diff 整洁度:2 文件(测试 + reference 文档),每行都与本 PR 目的相关;lockfile churn 已还原。 结论:可合。顺带观察(不在本 PR):master lock 版本元数据漂移 → 已独立立项 #2704。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.239-master.ba0b532 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Summary
Fixes the master typecheck breakage reported in #2699 — and completes the repair of the same breakage reported in #2698 and #2697 (identical mechanism: merge race between #2688 removing
compress.stripImagesand #2613 addingtests/image-request-budget.test.tswritten against the pre-removal base; master broke atae7d9c0b).#2688(remove-strip-images) removedcompress.stripImages/stripImagesKeepRecentfromCompressSettings, but #2613's budget test — merged after #2688 — still referenced both fields, leaving master red on typecheck (TS2353 @ line 49, TS2339 @ line 111) and failing every open PR's CI at the tsc step. It was not only a type error (#2698): two of the file's tests also exercised the removed stripImages recovery path at runtime and fail on master with the forward-stage 413.Change
Test file + one reference doc, zero runtime behavior change (no
src/diff):Commit 1 (
990cbe86f):compressconfig: drop the deadstripImages: true, stripImagesKeepRecent: 1keys.opts.compress.stripImages = false;line (already ignored at runtime post-refactor(#2607): remove compress.stripImages — default media folding replaces it #2688) and rename the now-unusedopts→_opts; reword the title/session id to drop the stale "disabled stripping" framing. Every assertion preserved verbatim.Commit 2 (
b0d511987, supplement for #2698/#2697):request_too_large,stage: forward) without touching upstream — whether images sit in messages or tool outputs — and the admission-slot flow ends at that same guard once a slot is released. This is option 2 of master is typecheck-broken: image-request-budget test still uses removed compress.stripImages (#2688 x #2613 race) #2698's "decision needed" (adapt tests to post-refactor(#2607): remove compress.stripImages — default media folding replaces it #2688 semantics: over-budget rebuilt bodies 413, no silent shrink). Option 1 (restore an explicit over-budget reduction path under the Archive-then-fold: default folding for archivable media (Closes #2607, Fixes #2609) #2640 folding world) is a design decision left to the owner — if wanted later it is a separate feature item.reference/request-body-budget.md(en+zh): the doc still told users to configure the removedcompress.stripImages/stripImagesKeepRecent; it now points at default media folding (Archive-then-fold: default folding for archivable media (Closes #2607, Fixes #2609) #2640) +decompress({imageRef})as the image-mass reduction path and states that the byte budget itself performs no reduction.Verification
npx tsc --noEmit --project tsconfig.json→ clean (was red with exactly the two reported errors).node --import tsx --test --test-concurrency=1 tests/image-request-budget.test.ts tests/request-body-budget.test.ts→ 10/10 pass, 0 fail, including both adapted tests ("over-budget rebuilt bodies stop at the forward-stage byte budget without touching upstream…" and "third large decode gets retryable admission error, then hits the forward-stage budget once a slot is released").Notes
fix:scoped to the test file + its reference doc; no config schema / wire / persistence / kernel / updater change.src/diff → no behavior change: the proxy already behaves exactly as the adapted tests now assert (forward-stage 413 guard insrc/server/relay.ts; admission slot released infinally,src/server/handle.ts).package-lock.jsonchurn from local installs was reverted before committing.package-lock.jsonversion metadata lagspackage.json(lock records bili 0.1.190 / acp-kernel 0.0.112 vs actual 0.1.191 / 0.0.114);npm installself-heals it and CI is unaffected.Closes #2699
Closes #2698
Closes #2697