feat: Add Codex OAuth FAST mode toggle (#2210)

* Add Codex OAuth FAST mode toggle

* fix(codex-oauth): default FAST mode to off to avoid surprise quota burn

service_tier="priority" consumes ChatGPT subscription quota at a higher
rate. Users must now opt in explicitly rather than inherit FAST mode
silently when this feature ships.

---------

Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
Jesus Díaz Rivas
2026-04-23 06:05:17 +02:00
committed by GitHub
parent 444c123ad0
commit 10e0772d8c
11 changed files with 181 additions and 40 deletions
+12 -2
View File
@@ -360,10 +360,20 @@ impl StreamCheckService {
.as_ref()
.and_then(|m| m.provider_type.as_deref())
== Some("codex_oauth");
let codex_fast_mode = provider
.meta
.as_ref()
.map(|m| m.codex_fast_mode_enabled())
.unwrap_or(false);
let body = if is_openai_responses {
anthropic_to_responses(anthropic_body, Some(&provider.id), is_codex_oauth)
.map_err(|e| AppError::Message(format!("Failed to build test request: {e}")))?
anthropic_to_responses(
anthropic_body,
Some(&provider.id),
is_codex_oauth,
codex_fast_mode,
)
.map_err(|e| AppError::Message(format!("Failed to build test request: {e}")))?
} else if is_gemini_native {
anthropic_to_gemini(anthropic_body)
.map_err(|e| AppError::Message(format!("Failed to build test request: {e}")))?