Add GPT-5.6 family support (#10349)

This commit is contained in:
Michael Neale
2026-07-09 11:35:46 -07:00
committed by GitHub
parent c5e1030c45
commit 0eabb6ecc1
2 changed files with 48 additions and 0 deletions
@@ -1535,6 +1535,8 @@ fn openai_reasoning_efforts_for_model(model_name: &str) -> &'static [&'static st
|| normalized.contains("gpt-5-4")
|| normalized.contains("gpt-5.5")
|| normalized.contains("gpt-5-5")
|| normalized.contains("gpt-5.6")
|| normalized.contains("gpt-5-6")
{
&["low", "medium", "high", "xhigh"]
} else {
@@ -2512,6 +2514,27 @@ mod tests {
Ok(())
}
#[test]
fn test_create_request_gpt56_max_effort_uses_xhigh() -> anyhow::Result<()> {
let model_config = test_model_config("gpt-5.6-luna")
.with_max_tokens(Some(1024))
.with_thinking_effort(ThinkingEffort::Max);
let request = create_request(
&model_config,
"system",
&[],
&[],
&ImageFormat::OpenAi,
false,
)?;
let obj = request.as_object().unwrap();
assert_eq!(obj.get("reasoning_effort"), Some(&json!("xhigh")));
assert!(obj.get("thinking_effort").is_none());
Ok(())
}
#[test]
fn test_create_request_gpt5_pro_max_effort_uses_supported_level() -> anyhow::Result<()> {
let model_config = test_model_config("gpt-5.2-pro-2025-12-11")
+25
View File
@@ -60,6 +60,11 @@ pub const OPEN_AI_KNOWN_MODELS: &[(&str, usize)] = &[
("gpt-5.4-mini", 400_000),
("gpt-5.4-nano", 400_000),
("gpt-5.4-pro", 1_050_000),
("gpt-5.5", 1_050_000),
("gpt-5.5-pro", 1_050_000),
("gpt-5.6-luna", 1_050_000),
("gpt-5.6-sol", 1_050_000),
("gpt-5.6-terra", 1_050_000),
];
pub const OPEN_AI_DOC_URL: &str = "https://platform.openai.com/docs/models";
@@ -839,6 +844,26 @@ mod tests {
use crate::api_client::AuthMethod;
use serde_json::json;
#[test]
fn gpt_5_5_and_5_6_models_have_expected_context_limits() {
for model in [
"gpt-5.5",
"gpt-5.5-pro",
"gpt-5.6-luna",
"gpt-5.6-sol",
"gpt-5.6-terra",
] {
assert_eq!(
OPEN_AI_KNOWN_MODELS
.iter()
.find(|(name, _)| *name == model)
.map(|(_, limit)| *limit),
Some(1_050_000),
"unexpected context limit for {model}"
);
}
}
fn make_provider(name: &str) -> OpenAiProvider {
OpenAiProvider {
api_client: ApiClient::new_with_tls(