From c7b806c559c25daa7e172d1df5a19590c83429e9 Mon Sep 17 00:00:00 2001 From: bingqilinweimaotai <111987281+bingqilinweimaotai@users.noreply.github.com> Date: Sun, 27 Sep 2026 20:32:13 +0800 Subject: [PATCH] fix(providers): refresh Codex model catalog version --- nanobot/providers/openai_codex_provider.py | 4 ++-- tests/providers/test_oauth_model_catalog.py | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nanobot/providers/openai_codex_provider.py b/nanobot/providers/openai_codex_provider.py index 92864b112..a70fd2df3 100644 --- a/nanobot/providers/openai_codex_provider.py +++ b/nanobot/providers/openai_codex_provider.py @@ -51,8 +51,8 @@ from nanobot.utils.helpers import estimate_prompt_tokens DEFAULT_CODEX_URL = "https://chatgpt.com/backend-api/codex/responses" DEFAULT_OPENAI_CODEX_MODELS_URL = "https://chatgpt.com/backend-api/codex/models" -# The server gates model visibility by client version; older catalogs omit Astra. -OPENAI_CODEX_CATALOG_CLIENT_VERSION = "0.153.4" +# The server gates model visibility by client version; older catalogs omit GPT-6 Sol/Luna. +OPENAI_CODEX_CATALOG_CLIENT_VERSION = "0.158.0" DEFAULT_ORIGINATOR = "nanobot" _COMPACTION_RETAINED_CHAR_BUDGET = 256_000 diff --git a/tests/providers/test_oauth_model_catalog.py b/tests/providers/test_oauth_model_catalog.py index 3420c0673..063b316c6 100644 --- a/tests/providers/test_oauth_model_catalog.py +++ b/tests/providers/test_oauth_model_catalog.py @@ -142,7 +142,12 @@ def test_xai_catalog_fetches_remote_models_and_reuses_capability_metadata( @pytest.mark.parametrize( ("model_id", "label"), - [("gpt-new", "GPT New"), ("gpt-6-astra", "GPT-6-Astra")], + [ + ("gpt-new", "GPT New"), + ("gpt-6-astra", "GPT-6-Astra"), + ("gpt-6-sol", "GPT-6-Sol"), + ("gpt-6-luna", "GPT-6-Luna"), + ], ) def test_openai_codex_catalog_uses_account_catalog_and_filters_hidden_models( monkeypatch: pytest.MonkeyPatch, @@ -226,7 +231,7 @@ def test_openai_codex_catalog_uses_account_catalog_and_filters_hidden_models( assert isinstance(request, httpx.Request) assert request.url.copy_with(query=None) == httpx.URL(DEFAULT_OPENAI_CODEX_MODELS_URL) # Assert the validated wire version, not the same constant used by the request. - assert request.url.params["client_version"] == "0.153.4" + assert request.url.params["client_version"] == "0.158.0" assert request.headers["Authorization"] == "Bearer secret" assert request.headers["chatgpt-account-id"] == "account-42"