feat(models): add hardcoded GPT-Image-2 model support in Codex

- Added `GPT-Image-2` as a built-in model to avoid dependency on remote updates for Codex.
- Updated model tier functions (`CodexFree`, `CodexTeam`, etc.) to include built-in models via `WithCodexBuiltins`.
- Introduced new handlers for image generation and edit operations under `OpenAIAPIHandler`.
- Extended tests to validate 503 response for unsupported image model requests.
This commit is contained in:
Luis Pater
2026-04-22 20:51:13 +08:00
parent 4fc2c619fb
commit e935196df4
6 changed files with 1006 additions and 5 deletions
+1 -1
View File
@@ -1410,7 +1410,7 @@ func buildCodexConfigModels(entry *config.CodexKey) []*ModelInfo {
if entry == nil {
return nil
}
return buildConfigModels(entry.Models, "openai", "openai")
return registry.WithCodexBuiltins(buildConfigModels(entry.Models, "openai", "openai"))
}
func rewriteModelInfoName(name, oldID, newID string) string {