Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/src/content/docs/providers/codex.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ The proxy owns its tokens and does not read native Codex CLI credentials. It ref

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.

`gpt-6.2-sol` and `gpt-6.2-astra` are built-in models, including their `-fast`
variants. They use Responses Lite; the `fullLane` setting does not switch them
to the full lane.

The proxy also reads the Codex CLI's optional `$CODEX_HOME/models_cache.json`
(default `~/.codex/models_cache.json`) to recognize additional models. Listed
entries marked `supported_in_api: true` appear in discovery; hidden entries
Expand Down
27 changes: 23 additions & 4 deletions src/providers/codex/translate/model_allowlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)] = &[
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -264,7 +268,7 @@ mod tests {
}

#[test]
fn full_lane_covers_all_lite_models_except_luna() {
fn full_lane_covers_known_full_lane_models() {
for model in [
"gpt-5.6-sol",
"gpt-5.6-terra",
Expand All @@ -276,7 +280,12 @@ mod tests {
assert!(uses_responses_lite_with_full_lane(model, false), "{model}");
assert!(!uses_responses_lite_with_full_lane(model, true), "{model}");
}
for model in ["gpt-5.6-luna", "gpt-6-luna"] {
for model in [
"gpt-5.6-luna",
"gpt-6-luna",
"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}");
}
Expand Down Expand Up @@ -331,8 +340,14 @@ mod tests {
}

#[test]
fn gpt_6_sol_fast_adds_priority() {
for model in ["gpt-6-sol", "gpt-6.1-sol", "gpt-6.1-terra"] {
fn gpt_6_fast_adds_priority() {
for model in [
"gpt-6-sol",
"gpt-6.1-sol",
"gpt-6.1-terra",
"gpt-6.2-astra",
"gpt-6.2-sol",
] {
let r = resolve_model_request(&format!("{model}-fast"));
assert_eq!(r.model, model);
assert_eq!(r.service_tier, Some(ServiceTier::Priority));
Expand All @@ -345,6 +360,8 @@ mod tests {
assert!(uses_responses_lite("gpt-6-luna"));
assert!(uses_responses_lite("gpt-6.1-sol"));
assert!(uses_responses_lite("gpt-6.1-terra"));
assert!(uses_responses_lite("gpt-6.2-astra"));
assert!(uses_responses_lite("gpt-6.2-sol"));
}

#[test]
Expand Down Expand Up @@ -508,6 +525,8 @@ mod tests {
assert!(assert_allowed_model("gpt-5.6-luna").is_ok());
assert!(assert_allowed_model("gpt-6.1-sol").is_ok());
assert!(assert_allowed_model("gpt-6.1-terra").is_ok());
assert!(assert_allowed_model("gpt-6.2-astra").is_ok());
assert!(assert_allowed_model("gpt-6.2-sol").is_ok());
}

#[test]
Expand Down
8 changes: 8 additions & 0 deletions src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ pub(crate) const CODEX_MODELS: &[&str] = &[
"gpt-6-sol",
"gpt-6.1-sol",
"gpt-6.1-terra",
"gpt-6.2-astra",
"gpt-6.2-sol",
];

pub(crate) const KIMI_MODELS: &[&str] = &["kimi-for-coding", "kimi-k2.6", "kimi-k3", "k2.6", "k3"];
Expand Down Expand Up @@ -486,6 +488,12 @@ 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-astra-fast[1m]",
"gpt-6.2-sol",
"gpt-6.2-sol-fast",
"gpt-6.2-sol[1m]",
] {
assert_eq!(
registry.provider_for_model(model, None).unwrap().name(),
Expand Down
4 changes: 4 additions & 0 deletions tests/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1754,6 +1754,10 @@ async fn models_endpoint_lists_supported_models() {
assert!(ids.contains(&"gpt-6.1-sol-fast"));
assert!(ids.contains(&"gpt-6.1-terra"));
assert!(ids.contains(&"gpt-6.1-terra-fast"));
assert!(ids.contains(&"gpt-6.2-astra"));
assert!(ids.contains(&"gpt-6.2-astra-fast"));
assert!(ids.contains(&"gpt-6.2-sol"));
assert!(ids.contains(&"gpt-6.2-sol-fast"));
assert!(ids.contains(&"gpt-6-astra-ultrafast"));
assert!(ids.contains(&"gpt-6.1-sol-ultrafast"));
assert!(!ids.contains(&"gpt-6-sol-ultrafast"));
Expand Down