diff --git a/docs/src/content/docs/providers/codex.md b/docs/src/content/docs/providers/codex.md index cca0fc42..23acad88 100644 --- a/docs/src/content/docs/providers/codex.md +++ b/docs/src/content/docs/providers/codex.md @@ -26,7 +26,7 @@ The proxy owns its tokens and does not read native Codex CLI credentials. It ref ## Models and fast mode -Use `claude-code-proxy models` as the current catalog. Model access depends on your ChatGPT account. A model rejected by the subscription produces the upstream error verbatim. +Select GPT-6.2 with `ANTHROPIC_MODEL=gpt-6.2-sol` or `ANTHROPIC_MODEL=gpt-6.2-astra`. Use `claude-code-proxy models` as the current catalog. Model access depends on your ChatGPT account. A model rejected by the subscription produces the upstream error verbatim. The proxy also reads the Codex CLI's optional `$CODEX_HOME/models_cache.json` (default `~/.codex/models_cache.json`) to recognize additional models. Listed @@ -78,8 +78,9 @@ The gpt-5.6 and gpt-6 families use Responses Lite by default. Lite requires `parallel_tool_calls: false`, so function tools run serially. Set `codex.fullLane: true` or `CCP_CODEX_FULL_LANE=1` to use the full Responses lane for `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-6-astra`, `gpt-6-sol`, `gpt-6.1-sol`, -and `gpt-6.1-terra`. This permits parallel calls; the model still decides whether to batch tools, and explicit -client restrictions on parallel tools remain effective. +`gpt-6.1-terra`, `gpt-6.2-astra`, and `gpt-6.2-sol`. This permits parallel calls. +The model decides whether to batch tools and respects explicit client +restrictions on parallel calls. This is not a universal lane override: catalog-only models keep the lane specified in the local Codex model cache. Luna models stay on Lite. diff --git a/src/providers/codex/mod.rs b/src/providers/codex/mod.rs index 4e0f9d12..0695706f 100644 --- a/src/providers/codex/mod.rs +++ b/src/providers/codex/mod.rs @@ -2504,8 +2504,27 @@ mod tests { } #[test] - fn terra_translation_preserves_model_and_tier_across_lanes() { - for requested in ["gpt-6.1-terra", "gpt-6.1-terra-fast"] { + fn translation_preserves_model_and_tier_across_lanes() { + for (requested, model, tier) in [ + ("gpt-6.1-terra", "gpt-6.1-terra", None), + ( + "gpt-6.1-terra-fast", + "gpt-6.1-terra", + Some(ServiceTier::Priority), + ), + ( + "gpt-6.2-astra-fast", + "gpt-6.2-astra", + Some(ServiceTier::Priority), + ), + ( + "gpt-6.2-sol-fast", + "gpt-6.2-sol", + Some(ServiceTier::Priority), + ), + ("gpt-6.2-astra", "gpt-6.2-astra", None), + ("gpt-6.2-sol", "gpt-6.2-sol", None), + ] { for hosted_search in [false, true] { let tools = if hosted_search { serde_json::json!([{"type":"web_search_20250305", "name":"web_search"}]) @@ -2526,14 +2545,9 @@ mod tests { }, ) .unwrap(); - assert_eq!(translated.model, "gpt-6.1-terra"); + assert_eq!(translated.model, model, "{requested}"); assert_eq!(translated.client_metadata.is_some(), !hosted_search); - assert_eq!( - translated.service_tier, - requested - .ends_with("-fast") - .then_some(ServiceTier::Priority) - ); + assert_eq!(translated.service_tier, tier, "{requested}"); } } } diff --git a/src/providers/codex/translate/model_allowlist.rs b/src/providers/codex/translate/model_allowlist.rs index 63075fc4..c3b05ef4 100644 --- a/src/providers/codex/translate/model_allowlist.rs +++ b/src/providers/codex/translate/model_allowlist.rs @@ -23,6 +23,8 @@ pub const ALLOWED_MODELS: &[&str] = &[ "gpt-6-sol", "gpt-6.1-sol", "gpt-6.1-terra", + "gpt-6.2-astra", + "gpt-6.2-sol", ]; pub const MODEL_ALIASES: &[(&str, &str)] = &[ @@ -81,7 +83,7 @@ pub fn allowed_models_display() -> String { allowed_models().join(", ") } -/// Models whose Codex catalog entry offers the `ultrafast` service tier. +/// Models that offer the `ultrafast` service tier in Codex. /// Every other model offers `priority` at most, so it gets no `-ultrafast` form. pub const ULTRAFAST_MODELS: &[&str] = &["gpt-6-astra", "gpt-6.1-sol"]; @@ -207,6 +209,8 @@ pub fn uses_responses_lite(model: &str) -> bool { | "gpt-6-sol" | "gpt-6.1-sol" | "gpt-6.1-terra" + | "gpt-6.2-astra" + | "gpt-6.2-sol" ) || (!ALLOWED_MODELS.contains(&model) && catalog_model(model) .is_some_and(|entry| entry.supported_in_api && entry.use_responses_lite)) @@ -224,6 +228,8 @@ pub fn uses_responses_lite_with_full_lane(model: &str, full_lane: bool) -> bool | "gpt-6-sol" | "gpt-6.1-sol" | "gpt-6.1-terra" + | "gpt-6.2-astra" + | "gpt-6.2-sol" ) { return false; @@ -272,6 +278,8 @@ mod tests { "gpt-6-sol", "gpt-6.1-sol", "gpt-6.1-terra", + "gpt-6.2-astra", + "gpt-6.2-sol", ] { assert!(uses_responses_lite_with_full_lane(model, false), "{model}"); assert!(!uses_responses_lite_with_full_lane(model, true), "{model}"); diff --git a/src/registry.rs b/src/registry.rs index 2dad8e5c..b2368814 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -2,7 +2,9 @@ use crate::{ anthropic::{json_error, schema::MessagesRequest}, config::AliasProvider, provider::{CliHandlers, Provider, RequestContext}, - providers::codex::translate::model_allowlist::tier_model_variants, + providers::codex::translate::model_allowlist::{ + ALLOWED_MODELS, listed_catalog_models, tier_model_variants, + }, }; use anyhow::{Result, anyhow}; use async_trait::async_trait; @@ -39,23 +41,6 @@ const CURSOR_LEGACY_MODELS: &[&str] = &[ "composer-2.5-fast", ]; -pub(crate) const CODEX_MODELS: &[&str] = &[ - "gpt-5.2", - "gpt-5.3-codex", - "gpt-5.3-codex-spark", - "gpt-5.4", - "gpt-5.4-mini", - "gpt-5.5", - "gpt-5.6-luna", - "gpt-5.6-sol", - "gpt-5.6-terra", - "gpt-6-astra", - "gpt-6-luna", - "gpt-6-sol", - "gpt-6.1-sol", - "gpt-6.1-terra", -]; - pub(crate) const KIMI_MODELS: &[&str] = &["kimi-for-coding", "kimi-k2.6", "kimi-k3", "k2.6", "k3"]; pub(crate) const GROK_MODELS: &[&str] = &["grok-composer-2.5-fast", "grok-4.5", "grok-4.6", "grok-4.7"]; @@ -342,8 +327,8 @@ pub(crate) fn expand_codex_models() -> Vec { let mut out = Vec::new(); // Baseline ∪ models the Codex CLI advertises in its own model cache, so a // model OpenAI ships to Codex routes here before a proxy release lists it. - let catalog = crate::providers::codex::translate::model_allowlist::listed_catalog_models(); - for model in CODEX_MODELS + let catalog = listed_catalog_models(); + for model in ALLOWED_MODELS .iter() .map(|model| (*model).to_string()) .chain(catalog) @@ -486,6 +471,10 @@ mod tests { "gpt-6.1-sol-fast", "gpt-6.1-terra", "gpt-6.1-terra-fast", + "gpt-6.2-astra", + "gpt-6.2-astra-fast", + "gpt-6.2-sol", + "gpt-6.2-sol-fast", ] { assert_eq!( registry.provider_for_model(model, None).unwrap().name(), diff --git a/tests/codex_model_catalog.rs b/tests/codex_model_catalog.rs index 109f7734..b895227b 100644 --- a/tests/codex_model_catalog.rs +++ b/tests/codex_model_catalog.rs @@ -167,6 +167,8 @@ async fn catalog_drives_discovery_routing_tiers_and_lanes_in_actual_process() { true, Some("ultrafast"), ), + ("gpt-6.2-astra", "gpt-6.2-astra", true, None), + ("gpt-6.2-sol-fast", "gpt-6.2-sol", true, Some("priority")), ] { let response = client .post(format!("{url}/v1/responses")) diff --git a/tests/server.rs b/tests/server.rs index 7fb5e6f8..a050cf3a 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -1756,6 +1756,16 @@ async fn models_endpoint_lists_supported_models() { assert!(ids.contains(&"gpt-6.1-terra-fast")); assert!(ids.contains(&"gpt-6-astra-ultrafast")); assert!(ids.contains(&"gpt-6.1-sol-ultrafast")); + for id in [ + "gpt-6.2-astra", + "gpt-6.2-astra-fast", + "gpt-6.2-sol", + "gpt-6.2-sol-fast", + ] { + assert!(ids.contains(&id), "{id}"); + } + assert!(!ids.contains(&"gpt-6.2-astra-ultrafast")); + assert!(!ids.contains(&"gpt-6.2-sol-ultrafast")); assert!(!ids.contains(&"gpt-6-sol-ultrafast")); assert!(ids.contains(&"grok-4.6")); for entry in data {