Skip to content

fix: avoid reporting unsaved empty image responses - #301

Open
Ricardo-M-L wants to merge 1 commit into
MiniMax-AI:mainfrom
Ricardo-M-L:fix/image-save-empty-batch11-20261022
Open

Ricardo-M-L wants to merge 1 commit into
MiniMax-AI:mainfrom
Ricardo-M-L:fix/image-save-empty-batch11-20261022

Conversation

@Ricardo-M-L

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

Copy link
Copy Markdown

Summary

ImageSDK.save(response, { out }) currently appends the destination to its returned list even when the selected image array is missing, empty, or contains an empty string. This reports a file that was never written and creates unnecessary directories. Whitespace-only base64 can also truncate an existing file to zero bytes.

Return no saved paths before touching the filesystem when there is no nonblank single-image payload. Keep the existing multi-image error and valid URL/base64 save behavior.

Validation

  • Regression tests fail against the unchanged base, then pass with the fix.
  • Focused image SDK tests: 16 passed, 0 failed (6 unrelated generation tests filtered out).
  • Two independent review rounds; final offline reviews include URL/base64 bytes, existing files, Unicode whitespace, multi-image errors, and download failures.
  • bun run typecheck, bun run lint, bun run build, and git diff --check pass. Lint retains an existing warning in test/sdk/speech.test.ts.
  • Full suite on the final patch: 620 passed / 5 failed. A separate clean checkout of the same base had 603 passed / 11 failed, including the detect-region and macOS Zed failures seen on the patch. The final patch run also had a FileSDK base-URL expectation failure; running FileSDK together with all 11 new image-save tests passed (13/13). Full-suite status is not claimed green; the unrelated order/environment-sensitive failures are left out of this focused fix.

Agent-assisted contribution; tests and filesystem assertions use synthetic data and no paid API calls.


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