Repository navigation
feat(images): add MiniMax image generation - #456
octo-patch wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Review mode: initial
Findings
-
[Minor]
outputFormatis ignored for MiniMax but its control stays enabled —apps/desktop/src/renderer/src/components/settings/ImageGenerationTab.tsx:251disables only the quality select forprovider === 'minimax', whilegenerateMiniMaxImage(packages/providers/src/images.ts:118) never readsoptions.outputFormat; the new test even passesoutputFormat: 'webp'and still expectsmimeType: 'image/png'. A user can therefore select a format that silently has no effect.
Suggested fix: disable the Output format control whensettings.provider === 'minimax'(same treatment as quality), or label that MiniMax controls the returned encoding. -
[Minor] Switching away from MiniMax leaves
credentialModestuck atcustom—apps/desktop/src/main/image-generation-settings.ts:367forcescustomonly when moving to minimax and never restores the previous mode. The renderer then re-sendssettings.credentialMode(nowcustom) for the next provider, so a user who previously relied on an inherited OpenAI/OpenRouter image key ends up in custom mode after a minimax round-trip.
Suggested fix: restore the prior mode when leaving minimax, e.g.providerChanged && provider === 'minimax' ? 'custom' : providerChanged ? 'inherit' : current.credentialMode.
Questions
- Does the MiniMax
image_generationendpoint acceptwidth/height?generateMiniMaxImagesendswidth/height(derived fromsize) wheneveraspectRatiois absent, but only mocked responses were exercised ("no paid image generation request was made"). If MiniMax only acceptsaspect_ratio, the size path is effectively dead — worth confirming the real request/response shape once. - Is the custom image key stored once per install or per provider? The settings view exposes a single
hasCustomKey/maskedKey; if it is shared, a MiniMax custom key may be reused for OpenAI/OpenRouter requests after the switch above.
Summary
- Review mode: initial
- The MiniMax adapter (
packages/providers/src/images.ts), regional base URLs and Bearer auth (packages/shared/src/config.ts), response/error validation, and the endpoint isolation from inherited text config look consistent with the existing OpenAI/OpenRouter adapters. Added Vitest cases cover the mocked paths, a changeset is present, and no new dependencies or direct SDK imports are introduced. - No blockers found. Residual risks are the unverified live request/response shape (especially
width/height) and the credential-mode stickiness noted above.
Testing
- Not run (automation). Suggested follow-ups: a Vitest case asserting
outputFormat/qualityare ignored for minimax at the option/UI layer, and one live (or recorded-fixture) MiniMax request to confirmwidth/heightvsaspect_ratio.
Open-CoDesign Bot
Reason: Enable MiniMax image generation in the existing generate_image_asset pipeline.
Validation:
API behavior is covered with mocked responses; no paid image generation request was made.