mirror of
https://github.com/openai/codex.git
synced 2026-11-02 19:43:24 +00:00
chore: introduce ModelFamily.requires_chatgpt_auth
This commit is contained in:
@@ -127,12 +127,13 @@ impl ModelClient {
|
||||
|
||||
let auth_mode = auth.as_ref().map(|a| a.mode);
|
||||
|
||||
if self.config.model_family.family == "2025-08-06-model"
|
||||
&& auth_mode != Some(AuthMode::ChatGPT)
|
||||
{
|
||||
if self.config.model_family.requires_chatgpt_auth && auth_mode != Some(AuthMode::ChatGPT) {
|
||||
return Err(CodexErr::UnexpectedStatus(
|
||||
StatusCode::BAD_REQUEST,
|
||||
"2025-08-06-model is only supported with ChatGPT auth, run `codex login status` to check your auth status and `codex login` to login with ChatGPT".to_string(),
|
||||
format!(
|
||||
"{slug} is only supported with ChatGPT auth, run `codex login status` to check your auth status and `codex login` to login with ChatGPT",
|
||||
slug = self.config.model_family.slug
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ pub struct ModelFamily {
|
||||
// the model such that its description can be omitted.
|
||||
// See https://platform.openai.com/docs/guides/tools-local-shell
|
||||
pub uses_local_shell_tool: bool,
|
||||
|
||||
pub requires_chatgpt_auth: bool,
|
||||
}
|
||||
|
||||
macro_rules! model_family {
|
||||
@@ -36,6 +38,7 @@ macro_rules! model_family {
|
||||
needs_special_apply_patch_instructions: false,
|
||||
supports_reasoning_summaries: false,
|
||||
uses_local_shell_tool: false,
|
||||
requires_chatgpt_auth: false,
|
||||
};
|
||||
// apply overrides
|
||||
$(
|
||||
@@ -55,6 +58,7 @@ macro_rules! simple_model_family {
|
||||
needs_special_apply_patch_instructions: false,
|
||||
supports_reasoning_summaries: false,
|
||||
uses_local_shell_tool: false,
|
||||
requires_chatgpt_auth: false,
|
||||
})
|
||||
}};
|
||||
}
|
||||
@@ -93,6 +97,7 @@ pub fn find_family_for_model(slug: &str) -> Option<ModelFamily> {
|
||||
model_family!(
|
||||
slug, "2025-08-06-model",
|
||||
supports_reasoning_summaries: true,
|
||||
requires_chatgpt_auth: true,
|
||||
)
|
||||
} else {
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user