Repository navigation
fix(media-understanding): apply imageMaxDimensionPx resize to image description input (#101923) - #101953
fix(media-understanding): apply imageMaxDimensionPx resize to image description input (#101923)#101953lsr911 wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 5:26 AM ET / 09:26 UTC. Summary PR surface: Source +26. Total +26 across 3 files. Reproducibility: yes. source-reproducible: current main returns non-HEIC image-description buffers unchanged and sends configured provider-entry buffers through the same normalizer without compression policy. I did not run the live provider or channel repro in this read-only review. 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. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Use or extract the shared model-aware image compression policy and web-media optimizer for both media-understanding entry points, preserve HEIC and under-limit pass-through behavior, then land one proof-positive candidate. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main returns non-HEIC image-description buffers unchanged and sends configured provider-entry buffers through the same normalizer without compression policy. I did not run the live provider or channel repro in this read-only review. Is this the best way to solve the issue? No. The PR is a useful partial mitigation, but the best fix is to reuse or extract the existing shared model-aware image compression policy so Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4ae8d735bf54. Label changesLabel justifications:
Evidence reviewedPR surface: Source +26. Total +26 across 3 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 (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…penclaw#101923) Wire the image resize ladder into both media-understanding entry points so oversized channel photos are downscaled before provider submission. - image-input-normalize.ts: add maxSide + quality params, resize oversized non-HEIC images via resizeToJpeg (was HEIC-only before) - runtime.ts (explicit path): pass limits.maxDimensionPx as maxSide - runner.entries.ts (configured provider path): same, fixes the previously-unpatched entry point Co-Authored-By: Claude <[email protected]>
feca89a to
0e5f55c
Compare
… dream sessions, drop malformed artifacts (openclaw#70135, openclaw#118500, openclaw#66358, openclaw#101953)
Summary
Fixes #101923:
media://image references and the media-understanding pre-pass bypass the image resize ladder, sending original-size phone photos to vision providers. Oversized images then fail with provider pixel-limit errors.(Recreated from clean
upstream/main— the original branch had unrelated commits from a stale fork base. Apologies for the noise!)Root Cause
Two problems fixed:
normalizeImageDescriptionInputonly handled HEIC conversion — non-HEIC images (JPEG, PNG, BMP, etc.) were returned unchanged regardless of dimensions. ThemaxSideparameter didn't exist.Only one of two entry points was wired — the first version only passed
maxSideinruntime.ts(explicitopenclaw infer image describe), but not inrunner.entries.ts(configured provider-entry path used by channel-attachment flows).Fix
image-input-normalize.ts
maxSide?: numberandquality?: numberparamsreadImageMetadataFromHeadermaxSide, downscale viaresizeToJpeg({ buffer, maxSide, quality })runtime.ts (explicit path —
openclaw infer image describe)imageMaxDimensionPxfrom config viaresolveImageSanitizationLimitsmaxSidetonormalizeImageDescriptionInputrunner.entries.ts (configured provider path — channel attachments)
imageMaxDimensionPxand passmaxSideEvidence
Real behavior proof — resize applied at both entry points
Before (current main): oversized image sent unchanged → provider error:
After (PR branch): image downscaled before provider submission:
Both entry points now wired:
runtime.ts(explicitinfer image describe): passeslimits.maxDimensionPx✓runner.entries.ts(configured provider path): passeslimits.maxDimensionPx✓Vitest
Files changed
src/media-understanding/image-input-normalize.tssrc/media-understanding/runtime.tslimits.maxDimensionPxasmaxSide(explicit path)src/media-understanding/runner.entries.tslimits.maxDimensionPxasmaxSide(configured provider path)Closes #101923
🤖 Generated with Claude Code