Skip to content

fix: read local image paths starting with http - #302

Open
Ricardo-M-L wants to merge 1 commit into
MiniMax-AI:mainfrom
Ricardo-M-L:fix/batch12-local-http-image-paths
Open

Ricardo-M-L wants to merge 1 commit into
MiniMax-AI:mainfrom
Ricardo-M-L:fix/batch12-local-http-image-paths

Conversation

@Ricardo-M-L

@Ricardo-M-L Ricardo-M-L commented Oct 23, 2026 •

Copy link
Copy Markdown

Problem

Image inputs are classified as remote URLs with startsWith('http') in both resolveImageInput and image generate --subject-ref. As a result, ordinary relative paths such as http-assets/frame.png or https-images/reference.png are forwarded as URL strings instead of reading the local file.

This affects, for example:

mmx image generate --prompt "A cat" --subject-ref type=character,image=http-assets/frame.png --dry-run
mmx video generate --model MiniMax-H3 --prompt "A cinematic scene" --image http-assets/frame.png --dry-run

Given an existing PNG at that path, the first command currently emits an image_url pointing at a local relative path; the second places that relative path in its first-frame URL. Neither payload contains the image bytes.

Changes

  • Recognize remote image URLs only by the complete http:// or https:// prefix, consistent with the existing toDataUri and media helpers.
  • Let other http-prefixed inputs use the existing local-file conversion and validation.
  • Keep existing data: and mm_file:// handling in resolveImageInput unchanged.
  • Add command-level dry-run regression tests using real temporary PNG files for image subject references and H3 first frames, plus HTTP/HTTPS URL positive controls. The new tests do not make API requests.

Validation

  • With the new command tests applied to base 38aba5f: 3 failed, 25 passed; all three failures are the local-path regressions.
  • bun test test/commands/image/generate.test.ts test/commands/video/generate.test.ts test/utils/media.test.ts: 33 passed.
  • bun run typecheck: passed.
  • bun run build: passed.
  • git diff --check: passed.
  • bun run lint: no errors; one pre-existing no-explicit-any warning at test/sdk/speech.test.ts:117.
  • Full bun test: 618 passed, 1 failed. The same failure reproduces in an untouched worktree at 38aba5f (613 passed, 1 failed): Zed configuration > writes a fresh config with the selected model and honors XDG_CONFIG_HOME at test/agent/zed.test.ts:68 on macOS. It expects the XDG directory but receives $HOME/.config/zed/settings.json. No Zed code or test is changed here.

AI-assisted implementation and tests. Two independent agent reviewers reviewed the complete diff separately, reran the focused tests, and reported no blocking findings, following the repository's blind-review instructions.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant