Skip to content

Use Claude Code with your ChatGPT, Kimi, Cursor or Grok subscription via a local Anthropic-compatible proxy

Rust

codex: preserve max reasoning effort

Layth557e5a4097cb
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f0bc47d..8d895d5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog
+- Forward Claude Code's `max` effort as Codex `reasoning.effort: "max"` so
+ GPT-5.6 can use its highest supported reasoning level instead of silently
+ receiving `xhigh`.
+
## v0.1.10 (2026-07-10)
- Claude Code requests using Opus 4.8, Sonnet 5, and Fable 5 model names can
diff --git a/README.md b/README.md
index b472046..d327c2c 100644
--- a/README.md
+++ b/README.md
@@ -266,9 +266,8 @@ model `gpt-5.6-sol` with `service_tier: "priority"`. An explicit
Reasoning effort: Claude Code's `output_config.effort` value (the one you see in
the UI as `◐ medium · /effort`) is forwarded as Codex `reasoning.effort` (`low`
-/ `medium` / `high` / `xhigh`). Claude Code's `max` value is sent upstream as
-`xhigh`. An explicit `codex.effort` / `CCP_CODEX_EFFORT` override still takes
-precedence and can also force `none`.
+/ `medium` / `high` / `xhigh` / `max`). An explicit `codex.effort` /
+`CCP_CODEX_EFFORT` override still takes precedence and can also force `none`.
Reasoning summaries: when a Codex request has reasoning effort, the proxy asks
Codex for `reasoning.summary: "auto"` and translates returned summary deltas
@@ -654,7 +653,7 @@ Windows, and at
| `CCP_KIMI_OAUTH_HOST` | `kimi.oauthHost` | `https://auth.kimi.com` | Override Kimi's OAuth host (debugging only) |
| `CCP_KIMI_BASE_URL` | `kimi.baseUrl` | `https://api.kimi.com/coding/v1` | Override Kimi's API base URL |
| `CCP_CODEX_MODEL` | `codex.model` | unset | Force all Codex requests to this model (`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-iterra`) |
-| `CCP_CODEX_EFFORT` | `codex.effort` | unset | Force all Codex requests to this reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`) |
+| `CCP_CODEX_EFFORT` | `codex.effort` | unset | Force all Codex requests to this reasoning effort (`none`, `low`, `medium`, `high`, `xhigh`, `max`) |
| `CCP_CODEX_REASONING_SUMMARY` | `codex.reasoningSummary` | unset | Request Codex reasoning summaries when reasoning effort is enabled; `off` and `none` suppress summaries |
| `CCP_CODEX_SERVICE_TIER` | `codex.serviceTier` | unset | Force all Codex requests to this service tier (`fast`/`priority`, `flex`; `fast` is sent upstream as `priority`) |
| `CCP_CODEX_BASE_URL` | `codex.baseUrl` | `https://chatgpt.com/backend-api/codex/responses` | Override the Codex Responses endpoint |
diff --git a/src/providers/codex/translate/request.rs b/src/providers/codex/translate/request.rs
index 173f43b..001ce36 100644
--- a/src/providers/codex/translate/request.rs
+++ b/src/providers/codex/translate/request.rs
@@ -23,6 +23,7 @@ pub enum Effort {
Medium,
High,
Xhigh,
+ Max,
}
impl std::fmt::Display for Effort {
@@ -33,6 +34,7 @@ impl std::fmt::Display for Effort {
Effort::Medium => write!(f, "medium"),
Effort::High => write!(f, "high"),
Effort::Xhigh => write!(f, "xhigh"),
+ Effort::Max => write!(f, "max"),
}
}
}
@@ -205,7 +207,7 @@ pub struct TranslateOptions {
fn to_codex_effort(effort: Option<&str>) -> Option<Effort> {
match effort {
- Some("max") => Some(Effort::Xhigh),
+ Some("max") => Some(Effort::Max),
Some("xhigh") => Some(Effort::Xhigh),
Some("low") => Some(Effort::Low),
Some("medium") => Some(Effort::Medium),
@@ -217,13 +219,14 @@ fn to_codex_effort(effort: Option<&str>) -> Option<Effort> {
fn resolve_effort(effort: Option<Effort>) -> Result<Option<Effort>, anyhow::Error> {
let override_effort = config::codex_effort();
if let Some(ref val) = override_effort {
- let valid = ["none", "low", "medium", "high", "xhigh"];
+ let valid = ["none", "low", "medium", "high", "xhigh", "max"];
if !valid.contains(&val.as_str()) {
anyhow::bail!(
- "Invalid effort override: \"{val}\". Must be one of: none, low, medium, high, xhigh"
+ "Invalid effort override: \"{val}\". Must be one of: none, low, medium, high, xhigh, max"
);
}
return Ok(Some(match val.as_str() {
+ "max" => Effort::Max,
"xhigh" => Effort::Xhigh,
"high" => Effort::High,
"medium" => Effort::Medium,
@@ -995,7 +998,7 @@ mod tests {
}
#[test]
- fn translate_effort_max_maps_to_xhigh() {
+ fn translate_effort_max_maps_to_max() {
let req: MessagesRequest = serde_json::from_value(json!({
"model": "gpt-5.5",
"messages": [{"role":"user", "content":"hello"}],
@@ -1003,7 +1006,7 @@ mod tests {
}))
.unwrap();
let out = translate_request(&req, opts()).unwrap();
- assert!(matches!(out.reasoning.unwrap().effort, Some(Effort::Xhigh)));
+ assert!(matches!(out.reasoning.unwrap().effort, Some(Effort::Max)));
}
#[test]