fix: expose ultra reasoning effort to Codex clients

This commit is contained in:
kogekiplay
2026-07-10 02:29:25 +08:00
parent b4c594050e
commit ed2933443d
2 changed files with 33 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ var codexClientAllowedReasoningLevels = map[string]struct{}{
"high": {},
"xhigh": {},
"max": {},
"ultra": {},
}
func (h *OpenAIAPIHandler) codexClientModelsResponse() map[string]any {

View File

@@ -100,3 +100,35 @@ func TestCodexClientModelsResponse_InputModalitiesFromRegistry(t *testing.T) {
t.Fatalf("image endpoint model should not expose input_modalities from registry: %#v", imageEntry["input_modalities"])
}
}
func TestCodexClientModelsResponse_PreservesUltraReasoningEffort(t *testing.T) {
resp := CodexClientModelsResponse([]map[string]any{{"id": "gpt-5.6-sol"}})
models, ok := resp["models"].([]map[string]any)
if !ok {
t.Fatalf("models type = %T, want []map[string]any", resp["models"])
}
var sol map[string]any
for _, entry := range models {
if stringModelValue(entry, "slug") == "gpt-5.6-sol" {
sol = entry
break
}
}
if sol == nil {
t.Fatal("expected codex client entry for gpt-5.6-sol")
}
levels, ok := sol["supported_reasoning_levels"].([]any)
if !ok {
t.Fatalf("supported_reasoning_levels = %T, want []any", sol["supported_reasoning_levels"])
}
for _, rawLevel := range levels {
level, ok := rawLevel.(map[string]any)
if ok && stringModelValue(level, "effort") == "ultra" {
return
}
}
t.Fatalf("supported_reasoning_levels = %#v, want ultra", levels)
}