Skip to content

feat(absorb): revive absorb scoped to image results + fix plugin-lane tool visibility (#3402) - #3422

Merged
ranxianglei merged 9 commits into
masterfrom
feat/absorb-revival-media-only
Oct 17, 2026
Merged

ranxianglei merged 9 commits into
masterfrom
feat/absorb-revival-media-only

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Revives the absorb distillation feature removed by #3309 (revert commit a900499), now scoped to image-bearing tool results by default through a new compress.absorb.mediaOnly knob. Also pins the plugin-lane prompt/tool parity that #3293 reported as broken.

Closes #3402

What changed

config surface

Adds one key: compress.absorb.mediaOnly (boolean, default true). The existing surface cannot express "absorb only image-bearing results": the closest mechanism, excludeTools, filters by tool NAME and cannot inspect payload shape, so a payload-shape predicate is required. No migration needed — unset resolves to true; set false to restore legacy full-text absorption.

behavior change (old → new)

  • mediaOnly default true: when absorb is enabled, ONLY tool results carrying media (images) are marked [ACP absorb]; plain-text large results are no longer marked by default. Pre-feat: remove the absorb distillation feature (#3293) #3309 behavior marked any large text result. Set mediaOnly: false to restore it.
  • absorb.enabled still defaults false (feature remains opt-in). Flipping it to true is left to the owner per the issue thread ("等 owner 表态再定").
  • Proxy lane is byte-for-byte identical to pre-feat: remove the absorb distillation feature (#3293) #3309 under mediaOnly: false; media-scoped under true.

kernel-change:

new optional mediaOnly field scoping absorb to image-bearing results (#3402). Version 0.0.127 → 0.0.128. Wire-contract goldens UNCHANGED: the media-scoped default lives in the host layer (resolveAbsorbSettings), so defaultConfig(100_000) goldens are untouched and the ledger neither grows nor shrinks.

testing

Review fix (2026-10-16): round-2 absorb join broke the fold-seam prefix — fixed on branch

The cache-seam probe failures (P1+P2 pair 5→6, P3 pair 9→10) were not environment-specific — they are deterministic and caused by this branch: src/server/relay.ts's round-2 rebuild nested absorbSection INSIDE withProjectAttribution(...), so round-2 emitted [compress prompt][absorb][attribution] while every steady prepare* path emits [compress prompt][attribution][absorb]. The system element therefore flipped at every fold while absorb was armed — a prefix-cache break, exactly what the probes pin. Fixed in commit 3116b06 (fix: keep round-2 absorb join byte-identical with steady paths): absorbSection now joins outside withProjectAttribution, matching steady byte-for-byte. Also regenerated package-lock.json for the kernel 0.0.128 bump (lock-sync gate, commit 3608324). Verified locally on the fixed head: cache-seam-probes 2/2 + cache-seam-fuzz green, plus all targeted suites (kernel absorb 19/19; root absorb/wire-contract/plugin-protocol/issue1192/side-lane/ccr-v2/fork-ccr/opencode-v2/native/rules/search-plan/store 94+/142/33 green); full-suite verdict via CI.

Golden refresh (2026-10-16): storage-render snapshots pick up the new effectiveAbsorb metadata key

storeEffectiveAbsorb stamps one NEW persisted key (session.metadata["effectiveAbsorb"], the session's last adjudicated absorb block, or null when the feature is off) on every prepared request — by design, so the plugin tool API reads the same block the wire saw (shadowing semantics pinned in tests/absorb.test.ts). The committed storage-render goldens therefore drift on the metadata section only (state/blockContents/stats digests and all wire bodies unchanged; "state-key divergence: none"). Refreshed via node --import tsx scripts/update-storage-render-goldens.ts (commit 634e50f) and reviewed line-by-line: each of the four wire snapshots changes exactly two digest fields (metadata section digest + overall stateDigest). Compatibility: the key is purely additive — pre-existing persisted sessions load unaffected (absent key → effectiveAbsorbConfig falls back to the base config).

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: feat/absorb-revival-media-only (acd981d)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4134-pr.3422.700ad38

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Option B — Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr3422.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

查重:不重复。 检索 open/closed issue 与 PR(关键词 absorb / mediaOnly / image distillation):无并行的 absorb 复活工作。相关谱系仅为本 PR 自身引用的 #3309(revert)、#3402(目标 issue)、#3293(plugin-lane 可见性)、#3371(纪律引用),无冲突条目。

已接单核对(本 PR 是 #3402 的交付,按 [PR] 流程拉分支核对代码 + 确认 CI,不重做)。先报 CI 现状:2 个红灯,均为机械问题,正在修——

  1. kernel-guard:PR 正文有 ## kernel-change 小节但没写冒号,guard 按字面 grep 'kernel-change:'(带冒号)匹配失败 → 正文标题补冒号即可,无需改代码。
  2. lock-sync:kernel 版本 0.0.127→0.0.128 后 package-lock.json 未重新生成(lock 里 acp-kernel 还记着 0.0.127)→ 本地重生成 lockfile 提交一行 diff。

另注意到 head 上全套 test (os,node,shard) 等测试 lane 显示 skipped(疑似被前置 gate 挡住),修完两个红灯后会确认测试 lane 是否真正跑起并转绿;若仍 skipped 会单独排查。代码与 PR 描述的一致性核对进行中,完成后按八问体例给结论。

ranxianglei pushed a commit that referenced this pull request Oct 16, 2026
…ibution before absorb section (cache-seam, #3422 review)
@ranxianglei ranxianglei reopened this Oct 16, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

进度更新:发现并修掉了一个真回归,两个机械红灯已清,测试矩阵正在跑。

① 真回归(已修)— round-2 重建把 absorb 段拼错了位置,每次折叠都断前缀缓存。
本地跑 tests/cache-seam-probes.test.ts 复现了 P1+P2(pair 5→6)和 P3(pair 9→10)失败,逐字节 diff 定位:src/server/relay.ts 的 round-2 重建把 absorbSection 嵌套在 withProjectAttribution(...) 里面,导致 round-2 系统元素是 [压缩提示][absorb][attribution],而四条稳态 prepare* 路径都是 [压缩提示][attribution][absorb]——absorb 开启时每次折叠系统元素翻转一次,前缀缓存必断。这正是探针要钉死的 seam。所以原正文「该失败是既有/环境相关、与本分支无关」的说法不成立:它是确定性的、本分支引入的,探针有牙且抓得对。修法一行:absorbSection 移到 withProjectAttribution 外面与稳态逐字节对齐(commit 3116b065d)。修后本地 cache-seam-probes 2/2 + cache-seam-fuzz 全绿。PR 正文的 Note 段已改写为准确的 review-fix 记录。

② lock-sync(已修):重生成 package-lock.json(acp-kernel 0.0.127→0.0.128 一行 diff,commit 36083243a),gate 转绿。

③ kernel-guard(已修):正文标题补冒号成 ## kernel-change:;因 push 事件快照用的是旧正文,close/reopen 刷新了一次 payload,gate 现绿。

④ 顺带说明:review 期间分支上落了一个并行 docs commit af013dec3(CONFIGURATION en/zh 的 mediaOnly 参考措辞对齐),与本 PR 目的同向、与我的提交无冲突,保留未动。

本地定向验证(rebased head 上):kernel absorb 19/19;root absorb/wire-contract/plugin-protocol/issue1192/side-lane/ccr-v2/fork-ccr/opencode-v2/native/rules/search-plan/store 全绿;typecheck 干净。golden 核对过:bili.json 与 #3309 删除前逐字节一致(纯恢复),manifest 两文件差异仅为 #3309 之后 master 新增的描述文案,kernel.json 未动。

CI 现状:所有 gate 绿,test (os,node,shard) 矩阵在跑(之前 skipped 正是被这两个红灯挡住的)。全绿后按八问体例给最终结论。

@ranxianglei
ranxianglei force-pushed the feat/absorb-revival-media-only branch from 634e50f to 2f60d2e Compare October 16, 2026 16:22
ranxianglei pushed a commit that referenced this pull request Oct 16, 2026
…ibution before absorb section (cache-seam, #3422 review)
@ranxianglei

Copy link
Copy Markdown
Owner Author

冲突

@ranxianglei
ranxianglei force-pushed the feat/absorb-revival-media-only branch from 2f60d2e to af162bc Compare October 17, 2026 01:22
ranxianglei pushed a commit that referenced this pull request Oct 17, 2026
…ibution before absorb section (cache-seam, #3422 review)
ranxianglei pushed a commit that referenced this pull request Oct 17, 2026
…data key (#3422)

Rebased onto master 2164823: the digests also fold in #3431's
config-file epoch metadata stamp (master-side change landed on the
same lines since the branch diverged). Regenerated with
scripts/update-storage-render-goldens.ts; diff is digest-only.
@ranxianglei
ranxianglei force-pushed the feat/absorb-revival-media-only branch from af162bc to 64c3f52 Compare October 17, 2026 01:38
ranxianglei pushed a commit that referenced this pull request Oct 17, 2026
…ibution before absorb section (cache-seam, #3422 review)
ranxianglei pushed a commit that referenced this pull request Oct 17, 2026
…data key (#3422)

Rebased onto master 2164823: the digests also fold in #3431's
config-file epoch metadata stamp (master-side change landed on the
same lines since the branch diverged). Regenerated with
scripts/update-storage-render-goldens.ts; diff is digest-only.
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

冲突已解决:feat/absorb-revival-media-only 已 rebase 到当前 master(269accd)并推送,新 head 64c3f52,PR 恢复可合并状态(无冲突)。

冲突来源与解决

  • src/server/relay.ts:本分支通过 revert 复活 absorb 时恢复了旧的 absorb 代码块,与 master 侧新加的 Vertex ?? prepared.model 回退落在同一处。按并集合并——absorb 块与 master 的 model 回退都保留,两边语义不互斥。
  • tests/golden/storage-render/*.json:master 的 config-epoch 元数据戳(fix(session): refuse stale effectiveConfig stamps via config-file epoch #3431)与本分支的 effectiveAbsorb 元数据键同时改动了同一组摘要行。用官方脚本 scripts/update-storage-render-goldens.ts 重新生成,diff 逐行核对过,纯摘要值变化,无语义漂移。
  • kernel 版本重排:master 期间合入的 区间审查(#3331)残留 11 项中小问题集中修:守卫旋钮、存储竞态、静默丢参、CI 触发残角等 #3406 screen-observability kernel 提交已把 acp-kernel 推到 0.0.128,与本分支原本的同版本号 bump 撞车。按 kernel 版本纪律(kernel/src 有变更必须相对 base bump),本分支的 mediaOnly 变更改为 0.0.128 → 0.0.129,两个 lockfile 同步再生成(仅版本行变化)。这是 rebase 过程中唯一超出「解冲突」本身的改动,原因是 kernel-guard / lock-sync 门禁要求。

本地定向验证(全量以远程 CI 为准)


结构化八问

  1. 是什么问题:本 PR 分支与 master 产生文本冲突(GitHub 标 dirty),阻塞合并。
  2. 什么原因导致的:revert 复活 absorb 恢复的旧代码块与 master 后续新改动(Vertex model 回退、config-epoch 元数据戳)落在同一区域;master 快速前进又造成 kernel 版本号撞车。
  3. 影响范围与严重程度:仅该 PR 分支本身无法合并,不影响线上任何行为。
  4. 怎么修复的:rebase 到当前 master;relay 冲突取并集保留双方语义;golden 走官方脚本再生成并核对为纯摘要漂移;kernel 版本重排到 0.0.129 并同步 lockfile。
  5. 是否有回归问题:无。改动路径承担的既有行为(visibilityMarkers 计算、loopConfig 组装、storage-render 渲染面、wire-contract 钉住面、kernel 全量行为)逐项本地验证保持;无阈值/时序/输出格式漂移。
  6. 是否破坏缓存:不涉及运行时缓存;storage-render golden 是测试钉桩,cache-seam 字节一致套件通过。
  7. 是否改了设计方向:不涉及,纯冲突解决,未改 PR 原设计(absorb 仅限图片结果 + plugin-lane 工具可见性钉桩)。
  8. 是否引入了新的配置:不涉及(rebase 未新增任何配置项;PR 原有的 compress.absorb.mediaOnly 维持不变)。

判定:冲突闭环,分支干净且基于最新 master,等 CI 绿灯即可由你合并(我无权合并)。若 CI 红了我来排查;master 若再前进产生新冲突,系统会再次转发,我再处理。

@ranxianglei

Copy link
Copy Markdown
Owner Author

ci失败

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 失败已定位,正在修。两类问题:

  1. 确定性冲突(3 个 shard 红):master 在我们 rebase 窗口期新增了 tests/removed-compress-keys-inert.test.ts(Interval review – residual minor fix list: two stale doc entries, kernel lock file lag, missing INERT alert on delete config, SIGKILL escalation, ack header 2xx-only (7 items, all minor) | 区间审查残留小修清单:文档过期两处、kernel 锁文件滞后、删除配置缺 INERT 告警、SIGKILL 升级、ack 头 2xx-only(7 项,均为小修) #3344 的钉桩:被移除的 compress.absorb 必须 INERT)。本 PR 恰好复活 absorb → 解析结果不再是 undefined,断言必挂。修法:把 absorb 从惰性键列表移除(imageCompression 保持惰性),同步更新该测试——正在改。
  2. Windows 独有挂起(1 个 shard 红):lane-decisions-matrix 在 windows-22 上首个子测试挂起 4.7s 后 event loop 空转、后续全部 cancelledByParent;Linux 两个 shard 和本地全绿。待新 CI run 验证是否复现,复现则深挖。

修完会 force-push 并给完整结论。

ranxianglei and others added 2 commits October 17, 2026 13:56
Restore the absorb machinery reverted by #3309, as the base for the
media-scoped revival (#3398): conflicts resolved keeping both the restored
absorb wiring and post-#3309 additions (withProjectAttribution #3298,
withAcpNotes #3252). src/proxy-tool.ts is deleted again — its only export
isProxyToolFor moves back to absorb.ts (absorb-aware, pre-#3309 shape).

This revert is intentionally NOT pushed alone; the media-only scope
restriction lands on top in the same PR.
…esults (#3402)

New AbsorbConfig.mediaOnly (default unset = neutral): when true, isAbsorbCandidate rejects media-less results, appendAbsorbPrompts exempts media-bearing candidates from the minToolTokens floor (image bytes are not counted in text), and applyAbsorb mirror-rejects a non-media target so screening and execution agree. Bumps acp-kernel 0.0.128 -> 0.0.129 (rebased onto master whose kernel is already at 0.0.128 via the #3406 screen-observability change).

kernel-change: optional mediaOnly gate for absorb distillation — host-side config plumbing alone cannot express candidate scoping inside the kernel's absorb pipeline
awork added 7 commits October 17, 2026 13:57
…t parity (#3402)

Host applies the product policy the kernel leaves neutral: resolveAbsorbSettings defaults mediaOnly to true (image-bearing results only), so pure-text large results are no longer marked by default and the old over-compression mode is gone; mediaOnly:false restores legacy full-text behavior. absorb.enabled still defaults false. New config key compress.absorb.mediaOnly (boolean) added to the schema, cleaning loop, and plugin-lane divergence fields; config docs regenerated (EN/ZH/website). Adds a regression test pinning that the plugin-lane absorb prompt gate and the manifest advertisement read the same base config block (#3293: prompt appears iff tool is advertised). CHANGELOG backfills the entry #3309 omitted and records this revival.
The generated config index table already carried compress.absorb.mediaOnly, but the hand-maintained '#### absorb' reference prose still showed the pre-mediaOnly field set and described 'large tool results'. Add mediaOnly to the Type line + sub-field bullets and reword to 'qualifying tool results' so the authoritative reference is internally consistent.
…ibution before absorb section (cache-seam, #3422 review)
…data key (#3422)

Rebased onto master 2164823: the digests also fold in #3431's
config-file epoch metadata stamp (master-side change landed on the
same lines since the branch diverged). Regenerated with
scripts/update-storage-render-goldens.ts; diff is digest-only.
…-keys INERT list (#3402)

The #3309 revert revived absorb, but #3344 still listed compress.absorb alongside compress.imageCompression as a removed/inert key: old-config parsing dropped absorb and tests/removed-compress-keys-inert.test.ts asserted it parsed to undefined. Pull absorb out of INERT_REMOVED_COMPRESS_KEYS (imageCompression stays removed), correct the warning text, and update the test so absorb is asserted kept while only imageCompression warns.
…oved-key pin with #3402

CI red (run 38991748164, 3 shards): master's tests/removed-compress-keys-inert.test.ts
(#3344) pins compress.absorb as INERT (feature removed by #3293), while this PR
revives it — the key parses again, so the undefined assertion fails deterministically.

Drop absorb from INERT_REMOVED_COMPRESS_KEYS (imageCompression stays — its #3266
removal stands), narrow the warning text accordingly, and update the pin test:
absorb now asserts PARSED ({enabled,minToolTokens} survive) and absent from the
warning; imageCompression keeps its full-path naming assertions.
@ranxianglei
ranxianglei force-pushed the feat/absorb-revival-media-only branch from f4e8cc0 to acd981d Compare October 17, 2026 06:06
@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

(ai: vllm-qwen/qwen3.8-27b)

CI 失败已修复并重新推送(新 head acd981d73,已 rebase 到最新 master 5fc5fea32——期间又撞上新的上游冲突,一并解决了)。

八问

  1. 是什么问题:两件事叠加——① CI 红(run 38991748164,6 个 test shard 挂 4 个);② master 又前进了(Egress image downscale: shrink big images before sending to the model, originals stay local and self-readable | 重做图片降采样(简化版):发模型前压大图、原图留本地不动、模型被告知尺寸后可自读原图 #3400 read_original_image、feat: egress image downscale + read_original_image (#3400) #3425 image-rescale-v2 等),PR 分支再次冲突。
  2. 什么原因导致的:
  3. 影响范围与严重程度:类 1 阻断合并(确定性红);类 2 目前只影响一个 Windows shard,严重度待新 CI 判定;均无用户面影响(absorb 本身仍是 opt-in)。
  4. 怎么修复的:把 absorb 从 INERT_REMOVED_COMPRESS_KEYS 移除(imageCompression 保留,image_full 无法被正确调用:同一张图每轮重复降采样(38 次)、restore 提示注入 38 次,模型只能猜 ref → 每轮一次失败+重发,缓存命中从 75% 掉到 28% #3266 的删除仍然有效),修正告警文案,并把 Interval review – residual minor fix list: two stale doc entries, kernel lock file lag, missing INERT alert on delete config, SIGKILL escalation, ack header 2xx-only (7 items, all minor) | 区间审查残留小修清单:文档过期两处、kernel 锁文件滞后、删除配置缺 INERT 告警、SIGKILL 升级、ack 头 2xx-only(7 项,均为小修) #3344 的钉测更新为「absorb 正常解析 + 仅 imageCompression 触发 INERT 警告」;然后 rebase 到 5fc5fea32,冲突全部按并集解(本 PR 的 absorb 行 + master 的 read_original_image/rescale 行都保留)。
  5. 是否有回归问题:逐项过过——imageCompression 的惰性警告行为不变;absorb 恢复解析正是本 PR 目的;plugin manifest 工具表为并集(master 的 read_original_image 默认开启行为原样保留,wire-contract 黄金测试验证了合法性);storage-render 黄金摘要此前已刷新且本次干净应用。本地定向验证:typecheck 干净、build OK、batch1(inert/config-surface-guard/absorb×3/plugin-protocol/side-lane-invariants/wire-contract)112/112、batch2(lane-decisions-matrix/golden-storage-render/cache-seam-probes/fuzz)29/29、kernel 套件 1289/1289。
  6. 是否破坏缓存:否——cache-seam 探针/fuzz 全绿,round-2 absorb 拼接字节一致的修复仍在链上。
  7. 是否改了设计方向:没有。
  8. 是否引入了新的配置:本轮没有(mediaOnly 是本 PR 早前提交引入的,已在此前回复披露)。

行为变更披露(旧→新):INERT 告警旧文案同时点名 compress.absorb, compress.imageCompression;新文案只点名 compress.imageCompression(absorb 不再被当作已移除键,而是正常解析)。原因:absorb 已由本 PR 复活,#3344 的钉测前提失效。

两点透明说明:

  • 修复过程中另一个工作会话推了一个等价修复(f4e8cc00a);rebase 后链上保留两个提交——前者落主修,后者(acd981d73)补强测试断言(加 doesNotMatch /compress\.absorb/ 防回归守卫 + 精确匹配告警文案),二者非空且后者严格包含前者语义。
  • 类 2 的 Windows 挂起留待本次 push 触发的新 CI 裁决:若在新 head 上复现,我会深入定位(对照 master 近期 Windows leg 记录判断归属);若不现,按一次性抖动关闭观察。

@ranxianglei
ranxianglei merged commit 4c62d2a into master Oct 17, 2026
34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.523-master.4c62d2a (rolling master tag).

npm install -g billion-context@0.0.523-master.4c62d2a  # this exact build
npm install -g billion-context@master  # always the newest merged build

npm view billion-context@master prints the current version at any time.

@github-actions github-actions Bot mentioned this pull request Oct 17, 2026
ranxianglei pushed a commit that referenced this pull request Oct 17, 2026
Third item from #3546 follow-up: absorb (default off) had no panel
control either - enabling it meant hand-editing JSON. Adds the
quick-fields checkbox mirroring the imageRescale pattern: checked writes
compress.absorb.enabled=true preserving any existing sub-fields,
unchecked deletes the whole absorb block (and an emptied compress object).
Hint notes the #3422 mediaOnly default (image-bearing results only) and
points sub-fields at the JSON editor. CHANGELOG [Unreleased] entry now
covers both panel toggles.
ranxianglei pushed a commit that referenced this pull request Oct 17, 2026
Third item from #3546 follow-up: absorb (default off) had no panel
control either - enabling it meant hand-editing JSON. Adds the
quick-fields checkbox mirroring the imageRescale pattern: checked writes
compress.absorb.enabled=true preserving any existing sub-fields,
unchecked deletes the whole absorb block (and an emptied compress object).
Hint notes the #3422 mediaOnly default (image-bearing results only) and
points sub-fields at the JSON editor. CHANGELOG [Unreleased] entry now
covers both panel toggles.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

absorb 恢复回来但只对带图片的工具结果生效(revert #3309 + 范围限制 + 修 #3293 工具不可见)

1 participant