mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 12:22:14 +03:00
* fix(providers): add MiniMax image-generation provider (port from 9router#2482) MiniMax already had entries in the music/audio/video registries, but no entry at all in imageRegistry.ts and no dedicated provider handler under open-sse/handlers/imageGeneration/providers/. A MiniMax image-model request therefore fell through the format dispatch in imageGeneration.ts to a 404/unmatched-format response instead of reaching MiniMax's synchronous image_generation endpoint. Registers a minimax image provider (format: minimax-image, models image-01/image-01-live) and a new handleMinimaxImageGeneration handler that POSTs to https://api.minimax.io/v1/image_generation and normalizes data.image_urls into the OpenAI-compatible images payload. Reported-by: felipeleite (https://github.com/decolua/9router/issues/2482) * refactor(providers): split KIE image catalog out of imageRegistry to respect file-size cap imageRegistry.ts hit 805 lines after adding the MiniMax image provider (cap is 800). Extract the KIE image-model catalog (largest single provider entry, ~35 models) into its own semantic-family module, providers/registry/kie/imageModels.ts, following the same pattern already used for LMARENA_DIRECT_IMAGE_MODELS. imageRegistry.ts now imports KIE_IMAGE_MODELS instead of inlining the list. Also update minimax-media-servicekinds.test.ts: getRegistryMediaKinds derives membership by design from every registry in MEDIA_KIND_REGISTRIES, including IMAGE_PROVIDERS. Now that minimax is a key in IMAGE_PROVIDERS, it correctly gains the "image" kind alongside tts/video/music — the same behavior already asserted for openai in this file. The exact-match assertion is updated to ["image","music","tts","video"]; the other assertions (which only check .includes for tts/video/music/llm) were already correct and untouched. * fix(providers): extract minimax image-gen helpers to fix complexity ratchet check:complexity-ratchets regressed 2056 -> 2058 (handleMinimaxImageGeneration: complexity 25, max-lines-per-function 97). Split logging, upstream-error, no-images, success and fetch-error branches into small named helpers so the handler stays within the cyclomatic-complexity (15) and max-lines-per-function (80) ratchets. No behavior change; existing minimax-image-provider-2482 and minimax-media-servicekinds unit tests still pass.