Skip to content

feat(#3546): settings-panel toggles (imageRescale, absorb) + acp_ rename for read_original_image - #3565

Merged
ranxianglei merged 4 commits into
masterfrom
2026-10-17_issue3546-image-toggle-and-acp-rename
Oct 18, 2026
Merged

ranxianglei merged 4 commits into
masterfrom
2026-10-17_issue3546-image-toggle-and-acp-rename

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Closes #3546

Three follow-ups for the #3400 egress image-rescale feature surface - one commit each, independent.

1. Settings panel quick-field for outbound image downscale

imageRescale was previously only reachable through the raw JSON editor or BILI_IMAGE_RESCALE. The settings-panel quick-fields section now carries a checkbox following the existing debug/passthrough pattern: checked = default-on = key omitted from the file; unchecked writes "imageRescale": false. A dim hint beside it names the env-only longest-edge threshold (BILI_IMAGE_RESCALE_MAX_DIM, default 1600).

2. Rename read_original_image -> acp_read_original_image

The newest injected tool was the only bili tool without the acp_ prefix (acp_status/acp_cache/acp_retrieve all have it), so models and users could not tell at a glance which tools bili injects versus host/user tools. The single constant READ_ORIGINAL_IMAGE_TOOL_NAME (src/compress-tool.ts) is reused by all four wire shapes, manifest registration, server-side dispatch and the structural loop guard, so the rename propagates from one line. Model-visible text updated: the [bili] annotation next to shrunken images and the tool error messages. Docs synced (CONFIGURATION.md en/zh, CHANGELOG [Unreleased] entry).

3. Settings panel quick-field for compress.absorb (issue follow-up)

Absorb (default off, #3402/#3309) had no panel control either - enabling it meant hand-editing JSON. Same pattern as item 1: checked writes compress.absorb.enabled: true (read-modify-write - any existing sub-fields like minToolTokens are preserved); unchecked deletes the whole absorb block (and an emptied compress object). The hint notes the #3422 mediaOnly default (only image-bearing results are absorbed; mediaOnly: false restores full-text absorption) and points sub-fields (minToolTokens / contextThresholdPct / excludeTools) at the raw JSON editor, per the issue spec.

Behavior change (intended, flagged per policy)

Config surface

No new/renamed/re-semanticsed config field. The web panel exposes pre-existing keys (src/config.ts / src/knobs.ts unchanged); BILI_IMAGE_RESCALE, BILI_IMAGE_RESCALE_MAX_DIM and all compress.absorb.* sub-fields are untouched.

Wire-contract goldens (#1304)

Regenerated via node --import tsx scripts/update-wire-contract-goldens.ts. Justification: intended served-tool rename (item 2). Diff is exactly the name lines - manifest-default.json + manifest-optin.json (4 lines each: toolNames array + anthropic/openai/responses shapes); kernel.json and bili.json never pinned this host-side tool and are byte-identical.

Tests

Targeted suites green locally: web family (web-i18n incl. referenced-keys/dead-keys parity over the new i18n keys, web-routing, web-sessions, web-ptools-position - 44 pass) plus the rename-affected suites (issue3400-image-rescale, wire-contract, plugin-protocol, plugin-fork, launcher-plugin-mode, codex-official, side-lane-invariants, cache-proof - 139 pass); typecheck clean; build clean. Full-suite verdict = CI on the pushed head.

@ranxianglei ranxianglei changed the title feat(#3546): imageRescale toggle in settings panel + acp_ rename for read_original_image feat(#3546): settings-panel toggles (imageRescale, absorb) + acp_ rename for read_original_image Oct 17, 2026
awork added 3 commits October 17, 2026 19:58
Expose the existing top-level imageRescale key as a checkbox in the web
settings panel's quick fields (it was only reachable via raw JSON or
BILI_IMAGE_RESCALE). Checked = default-on = key omitted; unchecked writes
imageRescale:false. Hint names BILI_IMAGE_RESCALE_MAX_DIM.
Aligns the newest injected tool with the acp_ prefix convention used by
every bili tool added after the original three (acp_status/acp_cache/
acp_retrieve) so models and users recognize bili-injected tools at a
glance. The feature is unreleased (still in the [Unreleased] batch), so
the rename carries zero user-facing compatibility surface — no legacy
name support added.

Touches: READ_ORIGINAL_IMAGE_TOOL_NAME constant (all four wire shapes and
every registration/dispatch site reuse it), model-visible annotation and
error text in image-rescale.ts, comments, CONFIGURATION.md en/zh, the
CHANGELOG [Unreleased] entry, test assertions (sorted tool-name lists
re-sorted for the new position), and the wire-contract goldens
regenerated via scripts/update-wire-contract-goldens.ts — only
manifest-default.json and manifest-optin.json changed (kernel.json never
pinned this host-side tool).
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

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。本 PR 关闭 #3546,open/closed 的 issue 与 PR 里没有第二个「改同一工具名 / 加同一面板开关」的条目。(说明:这是我自己上一轮开的 PR,按「识别自己的 PR」不重做,只拉分支核对代码 + 查 CI + 报告结论。)

⚠️ 关键发现:改名那部分的兼容性前提已经失效——read_original_image 今天已经随 v0.1.198 发出去了。

PR 描述与 commit message 都断言「#3400 还在 [Unreleased] 批次(package.json 0.1.197),旧名从未出现在任何已发布 npm 版本里,故改名零兼容面、不加旧名兼容层」。这个判断开 PR 时是对的(merge-base 494571fee 时 package.json 还是 0.1.197)。但此后 master 合入了 release v0.1.198(c8fadf15c),而 #3400(含 read_original_image)正是在 v0.1.198 批次里。我实测确认:

  • npm 上 billion-context@0.1.198 已发布(time.modified 2026-10-17T11:51Z);
  • git show v0.1.198:src/compress-tool.ts 第 385 行 = READ_ORIGINAL_IMAGE_TOOL_NAME = "read_original_image"(旧名)。

也就是说:旧名今天已经随一个已发布的 npm 版本出过门了,「零兼容面」不再成立。这不是 PR 写错,是它落地期间 master 发了版、把前提改变了。

这意味着什么(逐条核过代码路径):本 PR 是「裸改名」——只把常量从旧值改成新值,dispatch / manifest / 循环守卫全跟新常量走,没有保留旧名接受。对仍在用 0.1.198、且历史会话里真的调用过 read_original_image 的用户,升级到改名后的版本后:

影响面很窄(要同时满足:升到 0.1.198 + 会话里有被降采样的图 + 模型真的调了这个工具),0.1.198 今天才发、真实调用量几乎为零;但它是真实的回归类,而且正是「已上线的 wire 标识符裸改名不留兼容」这种本仓库政策明令不许静默放行的类型。所以裸改名不能按现状合入。

另外:PR 落后 master ~30 个提交,有真冲突。 mergeStateStatus: dirty;三方冲突落在 3 个文件:CHANGELOG.md、src/image-rescale.ts(master 侧 #3511/#3516 的 jimp/zod 改动碰了它)、tests/plugin-fork.test.ts。合并前必须 rebase 到当前 master。CI 当前 head 上还没有 check run(0 条),rebase 后以新 head 的 CI 为准。


结构化八问(决策请求)

  1. 是什么问题:PR 做两件事——设置面板加 imageRescale 开关(独立、没问题);把注入工具 read_original_image 改名为 acp_read_original_image(命名一致性)。卡点在后者:它赖以成立的「未发布」前提已被 v0.1.198 发版推翻。
  2. 什么原因导致的:PR 开时对、落地时错——master 在其间合入并发布了 v0.1.198(含 Egress image downscale: shrink big images before sending to the model, originals stay local and self-readable | 重做图片降采样(简化版):发模型前压大图、原图留本地不动、模型被告知尺寸后可自读原图 #3400),旧名从此有了存量用户。是外部发版事件改变前提,非 PR 逻辑错误。
  3. 影响范围与严重程度(按选项):
  4. 怎么修(推荐 B 的思路):manifest 只对外广播新名 acp_read_original_image(新请求一律用新名),但在三处判定同时接受新旧两个名字——src/loop/core.ts:342 dispatch、src/absorb.ts:54 isProxyToolFor、src/image-rescale.ts:415/:490 循环守卫。这样存量历史调用继续正常执行、不被转发、不被再缩。
  5. 是否有回归问题:A=无;B=无(薄别名专门就是为了不留回归);C=有(见第 3 问)。高危模式逐项:语义漂移(C 命中)/ fail-fast 变吞错(不涉及)/ 阈值时序输出格式变化(不涉及)。
  6. 是否破坏缓存:不涉及。工具名不在 prefix-cache 前缀里;面板开关绑定既有顶层布尔,默认行为(env > file > default)不变。
  7. 是否改了设计方向:不涉及架构/边界/数据流转向;B 只是给一个已上线标识符补标准兼容层。
  8. 是否引入新配置:不涉及。面板暴露的是既有顶层 imageRescale,新增/重命名/改语义的配置字段为零;BILI_IMAGE_RESCALE / BILI_IMAGE_RESCALE_MAX_DIM 不动。

选项对比

达成命名一致性 对 0.1.198 存量用户 额外成本 风险
A 放弃改名 ✗(留着无 acp_ 前缀的外观瑕疵) 零影响 无 无
B 改名+薄别名(推荐) ✓ 零影响(旧名保持可用) 三处比较改 新||旧 或抽一个小集合 无
C 裸改名(现状) ✓ 回归(历史调用被拒/原图再缩) 无 中(随扩散扩大)

我的推荐:B。 你当初就是主动要的这项改进,B 能干净地兑现它又不破坏任何存量行为,也是「改已上线 wire 标识符」的标准正确做法(旧名保持可用)。若你想保持面最小、宁可留着那个命名瑕疵,那就走 A,同样成立。

无论 A/B,我都会接着做:rebase 到当前 master、解掉那 3 处冲突、跑定向套件(issue3400-image-rescale / wire-contract / plugin-* / cache-proof)+ typecheck + build,再把结果更新回这里。设置面板开关(commit 1)不受此决策影响,两条路都保留。

请拍板 A 还是 B(或直接说「按你推荐的来」)。我不会擅自合并(合并是你来),也不会在你拍板前擅自改写 PR 方案。

@ranxianglei
ranxianglei force-pushed the 2026-10-17_issue3546-image-toggle-and-acp-rename branch from d168188 to 9582c43 Compare October 17, 2026 12:07
@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-17_issue3546-image-toggle-and-acp-rename (2947b9f)

Option A — Install this exact build (recommended)

npm install -g billion-context@0.0.4306-pr.3565.ffd1d17

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-pr3565.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)

上游冲突已解决:分支已 rebase 到当前 master(含 v0.1.198 release、#3543 WebUI tab row、#3513/#3511 等)并推回,PR 恢复可合并(mergeable: true,blocked = 等 CI)。

八问

  1. 是什么问题:PR 分支与目标分支冲突——master 在 PR 生命周期内前进了 ~30 个提交,双方都在 CHANGELOG.md [Unreleased] 顶部加条目,产生文本冲突。
  2. 什么原因导致的:纯时序问题(stale base),不是内容分歧;代码文件全部自动合并干净,冲突只落在 CHANGELOG.md,且两个提交各撞一次(rename 提交改的是 egress-image 条目名,absorb 提交在同位置新增条目)。
  3. 影响范围与严重程度:仅阻塞合并;代码零改动、零行为变化。
  4. 怎么修复的:rebase 三个提交到 master b10c52576,两处 CHANGELOG 冲突均按「意图并集」解——保留 master 新条目(dsh 网页版设置里的 bili 面板永远显示「正在连接 bili 代理…」(跨源预检被 CORS 拦截,代理本身正常) #3513 desktop/web embed CORS、197-master 发版最后 #3511 zod dist gate)+ 保留本 PR 的条目(acp_read_original_image 改名后的 egress 条目、Two read_original_image follow-ups: settings-panel toggle + acp_-prefixed tool name | read_original_image 功能两处改进:设置面板加开关;工具名改 acp_ 前缀 #3546 quick-fields 新条目),不改任何一行代码。
  5. 是否有回归问题:无。rebase 后 diff vs master 与 rebase 前逐文件一致(22 文件,+97/-57);rebased head 本地验证:typecheck 干净、build 干净(含 fix: 打包 zod 进 dist——薄安装(dsh/pi 插件裸拷)启动即崩的 P0(#3511) #3519 新增的 dist-external-zod 门禁 OK)、定向套件 183/183 通过(web-i18n/web-routing/web-sessions/web-ptools-position + issue3400-image-rescale/wire-contract/plugin-protocol/plugin-fork/launcher-plugin-mode/codex-official/side-lane-invariants/cache-proof)。全量结论以推送 head 上的 CI 为准。
  6. 是否破坏缓存:不涉及。
  7. 是否改了设计方向:不涉及。
  8. 是否引入了新的配置:不涉及。

收工判定:冲突已清,等 CI 绿即可合并(合并请人工执行)。

@ranxianglei
ranxianglei merged commit 7005249 into master Oct 18, 2026
44 of 45 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📦 Merged Build Published

This merge to master was published as 0.0.557-master.7005249 (rolling master tag).

npm install -g billion-context@0.0.557-master.7005249  # 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant