fix: normalize unsupported Anthropic inline images#102537
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 12:06 AM ET / 04:06 UTC. Summary PR surface: Source +141, Tests +278. Total +419 across 9 files. Reproducibility: yes. Current-main behavior is reproducible by sending a within-limit unsupported image through the real Anthropic payload builder and observing the unsupported Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the byte-aware conversion at the Anthropic payload boundary with one shared implementation, and explicitly approve and lock the optional host-port contract before merging. Do we have a high-confidence way to reproduce the issue? Yes. Current-main behavior is reproducible by sending a within-limit unsupported image through the real Anthropic payload builder and observing the unsupported Is this the best way to solve the issue? Yes, technically: provider-boundary byte normalization is narrower and safer than MIME relabeling or a global Anthropic-specific sanitizer rule. The remaining uncertainty is ownership of the new host capability, not the conversion algorithm. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 135aa7a0025d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +141, Tests +278. Total +419 across 9 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (11 earlier review cycles; latest 8 shown)
|
a82e4c5 to
4317cdd
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
0e3c3df to
a92d003
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
a92d003 to
2021524
Compare
2021524 to
fe8aa29
Compare
e5f4c46 to
78fc292
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
CI is green on c4652e1. The branch compare shows behind_by: 0 and the PR diff is unchanged; GitHub still shows the exact-merge required status as expected/waiting, likely waiting on the external status reporter. |
c4652e1 to
a172460
Compare
|
Refreshed this PR onto current Exact tested head: Verification:
The loopback proof used the real packaged Final-head CI: Please re-review this exact head. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: TUARAN <[email protected]>
fca297e to
50acd5c
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix: normalize unsupported Anthropic inline images This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Closes #102323. Anthropic accepts only JPEG, PNG, GIF, and WebP image blocks, but OpenClaw could forward within-limit HEIC, TIFF, or BMP MIME values and bytes unchanged. Anthropic rejected the whole turn, so the user received no reply.
Why This Change Was Made
@openclaw/aiindependent of Rastermill through one optional, source-compatible host port with an inert identity default; OpenClaw core injects the byte-aware implementation.The host capability is accepted as the permanent package/core seam: it is optional for published package consumers, while the runtime getter always supplies the inert fallback.
User Impact
Supported-size HEIC/TIFF/BMP images now reach Anthropic in a supported encoded format instead of failing the turn. Existing JPEG/PNG/GIF/WebP and text-only behavior remains unchanged. Oversized or aggregate-abusive inline payloads fail locally before unbounded decode/conversion work.
Evidence
@anthropic-ai/sdkrestricts base64 image media types to JPEG, PNG, GIF, and WebP.node scripts/run-vitest.mjs <package host/provider/transport and core normalizer tests>— 204 tests passed on exact rebased head50acd5c74db.image/tiff, normalized through the core host, and completed onclaude-haiku-4-5withstopReason: stop, 4 output tokens, and no error. Temporary image/script and credential window were removed afterward.node scripts/check-changed.mjs -- <eleven touched files>— core/core-test typecheck, full core lint, format, import cycles, dependency/API/database guards passed on Node 24.18 using the documented local fallback after repeated Blacksmith status API failures.node scripts/build-all.mjs— full AI/packages/unified build, runtime postbuild, 140 Plugin SDK export checks, and Control UI build passed.git diff --checkpassed.Original fix by @TUARAN; replacement commit preserves
Co-authored-by: TUARAN <[email protected]>.