Repository navigation
feat(#3546): settings-panel toggles (imageRescale, absorb) + acp_ rename for read_original_image - #3565
Conversation
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.
(ai: vllm-qwen/qwen3.8-27b) 查重:不重复。本 PR 关闭 #3546,open/closed 的 issue 与 PR 里没有第二个「改同一工具名 / 加同一面板开关」的条目。(说明:这是我自己上一轮开的 PR,按「识别自己的 PR」不重做,只拉分支核对代码 + 查 CI + 报告结论。)
PR 描述与 commit message 都断言「#3400 还在
也就是说:旧名今天已经随一个已发布的 npm 版本出过门了,「零兼容面」不再成立。这不是 PR 写错,是它落地期间 master 发了版、把前提改变了。 这意味着什么(逐条核过代码路径):本 PR 是「裸改名」——只把常量从旧值改成新值,dispatch / manifest / 循环守卫全跟新常量走,没有保留旧名接受。对仍在用 0.1.198、且历史会话里真的调用过
影响面很窄(要同时满足:升到 0.1.198 + 会话里有被降采样的图 + 模型真的调了这个工具),0.1.198 今天才发、真实调用量几乎为零;但它是真实的回归类,而且正是「已上线的 wire 标识符裸改名不留兼容」这种本仓库政策明令不许静默放行的类型。所以裸改名不能按现状合入。 另外:PR 落后 master ~30 个提交,有真冲突。 结构化八问(决策请求)
选项对比
我的推荐:B。 你当初就是主动要的这项改进,B 能干净地兑现它又不破坏任何存量行为,也是「改已上线 wire 标识符」的标准正确做法(旧名保持可用)。若你想保持面最小、宁可留着那个命名瑕疵,那就走 A,同样成立。 无论 A/B,我都会接着做:rebase 到当前 master、解掉那 3 处冲突、跑定向套件(issue3400-image-rescale / wire-contract / plugin-* / cache-proof)+ typecheck + build,再把结果更新回这里。设置面板开关(commit 1)不受此决策影响,两条路都保留。 请拍板 A 还是 B(或直接说「按你推荐的来」)。我不会擅自合并(合并是你来),也不会在你拍板前擅自改写 PR 方案。 |
d168188 to
9582c43
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4306-pr.3565.ffd1d17This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3565.tgz
npm install -g packageInstall instructions are refreshed on each push. |
(ai: vllm-qwen/qwen3.8-27b) 上游冲突已解决:分支已 rebase 到当前 master(含 v0.1.198 release、#3543 WebUI tab row、#3513/#3511 等)并推回,PR 恢复可合并( 八问
收工判定:冲突已清,等 CI 绿即可合并(合并请人工执行)。 |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.557-master.7005249 # this exact build
npm install -g billion-context@master # always the newest merged build
|
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
imageRescalewas previously only reachable through the raw JSON editor orBILI_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_imageThe 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 constantREAD_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 likeminToolTokensare preserved); unchecked deletes the wholeabsorbblock (and an emptiedcompressobject). The hint notes the #3422mediaOnlydefault (only image-bearing results are absorbed;mediaOnly: falserestores 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)
read_original_image->acp_read_original_image. Zero compatibility surface: Egress image downscale: shrink big images before sending to the model, originals stay local and self-readable | 重做图片降采样(简化版):发模型前压大图、原图留本地不动、模型被告知尺寸后可自读原图 #3400 still sits in the[Unreleased]batch (package.json 0.1.197), so the old name has never shipped in a published npm release; no legacy-name acceptance added.imageRescale,compress.absorb.enabled); checked/unchecked semantics as above. Default behavior unchanged (downscale on by default; absorb off by default; env override precedence untouched).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_DIMand allcompress.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:toolNamesarray + anthropic/openai/responses shapes);kernel.jsonandbili.jsonnever 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.