[BUG] chatgpt-image-2 is not routed as an image generation model
System details / 系统信息
DeepChat dev branch at c60a38f8611f92776eec6e0823ffa3df8bdc99c8. Source-level routing issue; platform independent.
What's wrong? / 出了什么问题?
chatgpt-image-2 is recognized inconsistently by the OpenAI image-generation settings and the actual model-routing logic.
Steps to reproduce from the current source:
- Configure an OpenAI/OpenAI-compatible/New API model with ID
chatgpt-image-2, without manually forcing the model type or API endpoint to image generation. src/shared/imageGenerationSettings.tstreats it as an OpenAI image-generation route because the fallback isgpt-image-2and the check usesmodelId.includes(...). Thereforechatgpt-image-2matches.src/main/provider/providers/aiSdkProvider.tsonly detects image models whose IDs start withdall-e-orgpt-image-, sochatgpt-image-2does not match.src/shared/model.tsuses the samestartsWith('gpt-image-')rule for New API image-model inference and Responses incompatibility detection, so it also does not inferchatgpt-image-2as image generation from the model ID.
Expected: chatgpt-image-2 should be classified and routed consistently as an image-generation model, the same way the image-generation settings logic already treats it.
Actual: the image settings logic can recognize the model while runtime/New API routing still treats it as a chat model unless metadata or a manual Image Generation / image endpoint override is provided.
Relevant code:
src/shared/imageGenerationSettings.ts:OPENAI_IMAGE_GENERATION_MODEL_ID_FALLBACK = 'gpt-image-2'+modelId.includes(...)src/main/provider/providers/aiSdkProvider.ts:OPENAI_IMAGE_GENERATION_MODEL_PREFIXES = ['dall-e-', 'gpt-image-']src/shared/model.ts: image inference and Responses incompatibility checks only use thegpt-image-prefix
There is currently no exact chatgpt-image-2 handling in the repository.
A possible fix would be to centralize the OpenAI image-model ID check in one shared helper (including chatgpt-image- aliases) and reuse it for settings, runtime routing, and New API inference, so these paths cannot diverge.
Closing this issue because I misidentified the model name. OpenAI image model IDs use the gpt-image-* naming pattern, which DeepChat already handles with the gpt-image- prefix. Sorry for the noise.