Tool 'image_generation' not supported when using non-OpenAI providers (e.g. MiMo)
Problem
When using a non-OpenAI provider that supports the OpenAI Responses API format (e.g. MiMo API at \https://token-plan-cn.xiaomimimo.com/v1\), Codex automatically injects the \image_generation\ tool into the request payload. However, these providers do not support this tool type, causing the request to fail with:
\\\
tool type 'image_generation' is not supported by this gateway phase
\\\
Root Cause
In \packages/opencode/src/provider/sdk/copilot/responses/openai-responses-prepare-tools.ts\, the \openai.image_generation\ provider tool is unconditionally converted to \{ type: 'image_generation' }\ and sent to the API, regardless of whether the target API supports it.
Expected Behavior
Codex should check if the target API supports \image_generation\ before including it in the request. For non-OpenAI providers, the tool should be excluded or the feature should be disableable via config.
Environment
- Codex CLI version: 0.142.0
- Model: mimo-v2.5-pro
- Provider: MiMo Token Plan
- wire_api: responses
Config Attempted
\\\ oml
[features]
image_generation = false
\\\
This does not prevent the tool from being injected into the API request.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗