Repository navigation
[PR] fix(image): preserve restored originals in PTC results (#4070) - #4102
qiangu2020 wants to merge 2 commits into
Conversation
[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b) PR #4102 审核结论(独立审核,未照抄 issue/作者描述作依据) 查重:不重复。全仓仅本 PR 引用 #4070;相邻 image 类 PR(#4061 outbound reserve 计费、#4016 sidecar 计价、#3735 fold-footer recarry、#3577 docs)机制与失败域均不同,无重叠。 审核独立性:我独立 rebase 到当前 master( 结构化八问
行为变更披露(Deliverables 规则 4,旧值→新值+原因)
测试有效性(§④):4 个新测试断言有牙——对象恒等( Auto-merge 门禁(§7.4)判定:不合 auto-merge,须人工 review。触碰 wire/message shape(①result 文本加行、②steady 新降采样 tool output 图片并往 tool text 追加 note),违反第 4 条「no change to wire protocol/message shape」;且引入新处理面偏 feat/refactor。其余项(回归测试绿、rebase head 绿、不碰 kernel/update/security)达标。 CI 现状:全部静态/guard gate success(kernel-guard、pi-subagents-guard、config-surface-guard、version-guard、docs-sync、lock-sync、unused-exports、test-import-graph、lane-guard、build-artifact 等); 一处非阻塞小观察(可选精修):回执前缀串 结论:可合(待 CI |
ranxianglei#4070) Reviewer-added completion of PR ranxianglei#4102: the receipt predicate landed for Anthropic and Responses but not Google, so a restored original attached by a PTC host beside its entry-level inlineData part would still be rescaled/shed on that wire. Same mechanism, same fix shape: - rescaleGoogle skips inlineData whose decoded bytes match a receipt line in the same content-entry parts; the egress-shed google collector applies the same skip before archiving/downscaling. - matchesOriginalImageReceipt now accepts any string .text part (the Google text part is untyped {text}); typed-wire behavior is unchanged. - Images nested inside functionResponse.parts were already invisible to both passes and remain so (unchanged). Tests: positive+negative rescale rows plus both shed rungs added to tests/issue3400-image-rescale.test.ts. Local: typecheck clean, targeted files green.
|
(ai: zhipuai-lb/glm-5.3) 已并入合并列车 #4525(master 6d7c587,合并方式 merge commit,提交保留原作者署名)。本 PR 关单收尾;若列车中对应提交出问题,回滚点为 #4525 单提交 revert。 感谢 @qiangu2020 的贡献——你的提交以原作者署名随列车进入 master(合并方式为 merge commit),仓库贡献者列表可见。 |
ranxianglei#4070) Reviewer-added completion of PR ranxianglei#4102: the receipt predicate landed for Anthropic and Responses but not Google, so a restored original attached by a PTC host beside its entry-level inlineData part would still be rescaled/shed on that wire. Same mechanism, same fix shape: - rescaleGoogle skips inlineData whose decoded bytes match a receipt line in the same content-entry parts; the egress-shed google collector applies the same skip before archiving/downscaling. - matchesOriginalImageReceipt now accepts any string .text part (the Google text part is untyped {text}); typed-wire behavior is unchanged. - Images nested inside functionResponse.parts were already invisible to both passes and remain so (unchanged). Tests: positive+negative rescale rows plus both shed rungs added to tests/issue3400-image-rescale.test.ts. Local: typecheck clean, targeted files green. (cherry picked from commit 9534fb5)
Fixes #4070
Problem
Restoring an original image through a PTC host leaves the outer tool named
ipython/run_code. Both normal image rescaling and byte-pressure shedding then treat the restored bytes as ordinary images.Change
The footer is a caller-fabricable non-security convention, not authentication. There is no exemption registry, history mutation, new configuration, dependency/version change, or blanket tool-name exemption. Hosts must forward the complete receipt beside the image. This does not by itself update a host SDK or establish every API's carrier behavior. OpenAI Chat Completions sidecars and other serializers are not covered by this change.
Checks
npm run typecheck: passed.node --import tsx --test tests/issue3400-image-rescale.test.ts tests/responses-tool-images.test.ts tests/issue3701-ws-byte-budget.test.ts: 40/40 passed, no skips.git diff --check: passed.Independent three-file review: no actionable findings.
Actual candidate CLI/plugin roundtrip: passed 8 checks across Responses and Anthropic. Each original was indexed through a real inbound request, discovered via the public restoration list, restored through nativeCaller=true, then forwarded with its full returned receipt. Egress retained the original SHA256 while ordinary and mixed unrelated images still shrank. A 1600px control stayed unchanged. This used synthetic host carriers, not a live Prime kernel.
Additional host acceptance (outside this three-file PR): actual Rust daemon + freshly built Python kernel + proxy CLI against a loopback fake provider passed 8/8 checks twice. Official 0.1.202 explicitly refused legacy nested-image receipts; the isolated PR candidate retained the original 2000x1625 image SHA256 through the real kernel on Anthropic. This is candidate validation, not an installed production release or a claim of Chat support.
No production installation or release was changed. Remote full-suite CI remains authoritative.