From bb414de33f3696f75fa0697fc7c9da46ea931fa4 Mon Sep 17 00:00:00 2001 From: Luis Pater Date: Sat, 20 Jun 2026 22:49:26 +0800 Subject: [PATCH] feat(api): add "max" reasoning depth and `service_tiers` to Codex client models - Introduced a new "max" level for reasoning depth in Codex client model configuration, providing maximum problem-solving capability. - Added `service_tiers` field to model responses for better tier categorization. - Updated unit tests to validate the inclusion and default behavior of `service_tiers` and the new "max" reasoning depth. --- internal/api/server_test.go | 4 ++++ sdk/api/handlers/openai/codex_client_models.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/internal/api/server_test.go b/internal/api/server_test.go index 320776bac..2bf2cd13a 100644 --- a/internal/api/server_test.go +++ b/internal/api/server_test.go @@ -531,6 +531,10 @@ func TestModelsWithClientVersionReturnsCodexCatalog(t *testing.T) { if got, _ := custom["prefer_websockets"].(bool); got { t.Fatalf("custom prefer_websockets = %v, want false", custom["prefer_websockets"]) } + customServiceTiers, ok := custom["service_tiers"].([]any) + if !ok || len(customServiceTiers) != 0 { + t.Fatalf("expected custom model service_tiers = [], got %#v", custom["service_tiers"]) + } if _, ok := custom["apply_patch_tool_type"]; ok { t.Fatal("expected custom model to omit apply_patch_tool_type") } diff --git a/sdk/api/handlers/openai/codex_client_models.go b/sdk/api/handlers/openai/codex_client_models.go index 7d05db22e..01c7eb5c9 100644 --- a/sdk/api/handlers/openai/codex_client_models.go +++ b/sdk/api/handlers/openai/codex_client_models.go @@ -26,6 +26,7 @@ var codexClientAllowedReasoningLevels = map[string]struct{}{ "medium": {}, "high": {}, "xhigh": {}, + "max": {}, } func (h *OpenAIAPIHandler) codexClientModelsResponse() map[string]any { @@ -132,6 +133,7 @@ func applyCodexClientModelMetadata(entry map[string]any, id string, model map[st entry["description"] = description entry["priority"] = 100 entry["prefer_websockets"] = false + entry["service_tiers"] = []any{} delete(entry, "apply_patch_tool_type") delete(entry, "upgrade") delete(entry, "availability_nux") @@ -249,6 +251,8 @@ func codexClientReasoningDescription(level string) string { return "Greater reasoning depth for complex problems" case "xhigh": return "Extra high reasoning depth for complex problems" + case "max": + return "Maximum available reasoning depth for complex problems" default: return level }