feat(codex): extend the model allowlist from the Codex CLI's model cache - #130
Open
GiulianoCosta71 wants to merge 1 commit into
Open
feat(codex): extend the model allowlist from the Codex CLI's model cache#130GiulianoCosta71 wants to merge 1 commit into
GiulianoCosta71 wants to merge 1 commit into
Conversation
The Codex CLI keeps `~/.codex/models_cache.json` fresh from the server, so new models (gpt-6-astra on 2026-09-04, for example) appear there the moment OpenAI ships them — but the proxy only accepted models compiled into `ALLOWED_MODELS`/`CODEX_MODELS`, and every new model needed a code change plus a release (raine#129 for gpt-6-astra). Read the cache at runtime (`$CODEX_HOME/models_cache.json`, default `~/.codex/`) and treat it as an extension of the static allowlist: - `is_allowed_model`/`assert_allowed_model` accept catalog models with `supported_in_api`. - `uses_responses_lite` honours the catalog's `use_responses_lite` flag, so a new Lite-lane model is not sent down the full Responses API. - `-fast` aliases, `models --full`, the unknown-model hint and the registry routing (`expand_codex_models`) include catalog models with `visibility == "list"`. The static lists stay as the baseline for machines without a cache. The file is parsed leniently per model entry and cached by (mtime, len); an unreadable file keeps the last good parse. Verified locally: with a cache entry `gpt-7-test` the binary lists `gpt-7-test` and `gpt-7-test-fast` without any code change.
GiulianoCosta71
pushed a commit
to RankM8/WhisperM8
that referenced
this pull request
Sep 6, 2026
…etriebener Allowlist Der claude-code-proxy führt seine Modell-Allowlist einkompiliert; jedes neue Codex-Modell brauchte upstream einen Code-Merge plus ein Release, das erfahrungsgemäß Wochen nach dem Merge kommt (gpt-6-astra: Merge am 2026-09-04, kein Release). Damit hätte die katalog-getriebene WhisperM8-Seite neue Modelle angeboten, die der Proxy ablehnt. Der Fork GiulianoCosta71/claude-code-proxy liest den Codex-Modellcache (~/.codex/models_cache.json) zur Laufzeit und akzeptiert jedes dort API-fähige Modell zusätzlich zur statischen Liste — derselbe Patch ist upstream als raine/claude-code-proxy#130 eingereicht. Release v0.1.36-whisperm8.1 = Upstream 0.1.35 + main@55bf0b58 + Patch. - Installer zeigt auf den Fork; known-good 0.1.36-whisperm8.1 mit SHA-256-Pins aus den Release-Sidecars (arm64 lokal gegengeprüft). - Versionsvergleich verträgt das Prerelease-Suffix (numerische Teile zählen), abgesichert per Test. Rückweg: sobald #130 upstream gemerged und released ist, `repository` wieder auf raine/claude-code-proxy und die Pins auf das Upstream-Release.
|
Good that this patch exists. Just bought OpenAI Pro subscription to use astra with claude code proxy and was a bit confused that i didnt got it! :D haha Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Every new Codex model currently needs a code change plus a release before the proxy accepts it (#129 for
gpt-6-astra, #113/#114 forgpt-daybreak-blue). Meanwhile the Codex CLI already knows the model: it keeps~/.codex/models_cache.jsonfresh from the server, includingsupported_in_api,use_responses_liteandvisibilityper model.What
Read that cache at runtime (
$CODEX_HOME/models_cache.json, default~/.codex/) and treat it as an extension of the static allowlist:is_allowed_model/assert_allowed_modelaccept catalog models withsupported_in_api.uses_responses_litehonours the catalog'suse_responses_lite, so a new Lite-lane model is not sent down the full Responses API.-fastaliases,models --full, the unknown-model hint and registry routing (expand_codex_models) include catalog models withvisibility == "list".The static lists remain the baseline for machines without a cache. The file is parsed leniently per model entry and cached by
(mtime, len); an unreadable file keeps the last good parse.Verification
cargo test(864 + integration suites) green,cargo fmt --checkandcargo clippy --all-targets -- -D warningsclean.gpt-7-test(supported_in_api: true) the binary listsgpt-7-testandgpt-7-test-fastand routes requests to Codex without any code change; an entry withsupported_in_api: falsestays rejected.gpt-6-astrarequests through the patched binary against the Codex backend (Subscription/OAuth) succeed, including a 905k-token input.