Repository navigation
fix(media): convert multi-frame HEIC and HEIF photos for image providers - #128501
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: found issues before merge. Reviewed August 24, 2026, 1:02 AM ET / 05:02 UTC. ClawSweeper reviewWhat this changesThe PR recognizes HEIC and HEIF sequence MIME types and converts them to JPEG before Gateway and media-understanding image-provider requests. Merge readinessKeep open: the branch repairs Gateway and media-understanding conversion, but leaves the parallel Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherOpenClaw accepts image bytes through Gateway input and direct media-description APIs, detects their MIME type, applies an operator allowlist, then converts HEIC-family images before sending them to an image provider. The CLI model-run command is another direct provider-input path with its own HEIC conversion check. flowchart LR
Upload[Gateway or file image input] --> Detect[MIME detection]
Detect --> Validate[Allowlist and byte validation]
Validate --> Convert[HEIC-family JPEG conversion]
Convert --> Provider[Image provider request]
ModelRun[CLI model run file input] --> Detect
ModelRun --> Provider
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +111. Total +114 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Apply the same two sequence aliases to the CLI model-run conversion decision, add table-driven CLI coverage for them, and retain byte detection plus the existing HEIC/HEIF allowlist behavior. Do we have a high-confidence way to reproduce the issue? Yes, from source: a detector result of image/heic-sequence or image/heif-sequence passes the model-run image check but misses its two-value conversion set, leaving raw bytes for the provider. Is this the best way to solve the issue? No: the approach is correct for the changed owners but is incomplete because the equivalent direct model-run conversion owner retains the old two-value policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d2e62c6b8206. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where users uploading valid multi-frame HEIC or HEIF photos would see Gateway image requests rejected, or would have unsupported image bytes silently passed to image-description providers, when the image detector identified the files as HEIC/HEIF image sequences.
Why This Change Was Made
The pinned image detector correctly distinguishes sequence variants from ordinary HEIC/HEIF images, but the existing Gateway input owner and media-understanding image detector recognized only the still-image MIME names. Normalize exactly the two existing sequence aliases at the canonical image-conversion boundary, and recognize them before image-provider execution, while preserving byte-signature validation, restrictive configured MIME allowlists, conversion limits, public MIME detection, and existing HEIC/HEIF defaults. The production change is +3 lines; it adds no configuration, dependency, public API, or accepted image family.
User Impact
Valid HEIC and HEIF image sequences are converted into ordinary JPEG images before Gateway and image-understanding provider delivery, including inputs with opaque filenames. Spoofed non-image content and image types excluded by operator configuration remain rejected.
Evidence
heix, HEIC-sequencehevc, and HEIF-sequencemsf1inputs all produced provider-accepted JPEG bytes beginning withffd8ff.sipsbackend unavailable; every other executable was selected by the original trusted production resolver. Existing follow-up: on this macOS host,sipsproduces unreadable JPEG output even for ordinary previously supported HEIC, and the image dependency currently stops before its working ImageMagick backend.node scripts/run-vitest.mjs src/media/input-files.fetch-guard.test.ts src/media-understanding/runtime.test.ts src/media-understanding/apply.test.ts packages/media-core/src/mime.test.ts --configLoader runner— 311 tests passing.pnpm tsgo:core; exact touched test-owner typechecks:node scripts/run-tsgo.mjs -b test/tsconfig/tsconfig.core.test.other.json --builders 1andnode scripts/run-tsgo.mjs -b test/tsconfig/tsconfig.core.test.plugins-platform.json --builders 1; targeted formatting and lint checks all pass.@panzoom/panzoomand@types/pako; both actual changed-owner test-type programs pass independently.