feat: add GPT-5.6 variants to Bedrock catalog (#30285)

## Summary

- add Sol (`openai.gpt-5.6-sol`), Terra (`openai.gpt-5.6-terra`), and
Luna (`openai.gpt-5.6-luna`) to the Amazon Bedrock static model catalog
- derive all three entries from the bundled GPT-5.5 metadata and add the
Bedrock-only `max` reasoning effort
- keep the new entries below the current GPT-5.5 and GPT-5.4 models at
priorities 2, 3, and 4, preserving GPT-5.5 as the default
- add deep-equality coverage for inherited model configuration, catalog
ordering, context windows, and service-tier behavior
This commit is contained in:
Celia Chen authored and GitHub committed 2026-06-26 20:32:49 +00:00
1 parent ac85409b7b
commit 69596f0e42
3 files changed
+95 -23

No files matched your search

+3
View File
@@ -40,6 +40,9 @@ const AMAZON_BEDROCK_PROVIDER_NAME: &str = "Amazon Bedrock";
pub const AMAZON_BEDROCK_PROVIDER_ID: &str = "amazon-bedrock"; pub const AMAZON_BEDROCK_PROVIDER_ID: &str = "amazon-bedrock";
pub const AMAZON_BEDROCK_GPT_5_5_MODEL_ID: &str = "openai.gpt-5.5"; pub const AMAZON_BEDROCK_GPT_5_5_MODEL_ID: &str = "openai.gpt-5.5";
pub const AMAZON_BEDROCK_GPT_5_4_MODEL_ID: &str = "openai.gpt-5.4"; pub const AMAZON_BEDROCK_GPT_5_4_MODEL_ID: &str = "openai.gpt-5.4";
pub const AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID: &str = "openai.gpt-5.6-sol";
pub const AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID: &str = "openai.gpt-5.6-terra";
pub const AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID: &str = "openai.gpt-5.6-luna";
pub const AMAZON_BEDROCK_DEFAULT_BASE_URL: &str = pub const AMAZON_BEDROCK_DEFAULT_BASE_URL: &str =
"https://bedrock-mantle.us-east-1.api.aws/openai/v1"; "https://bedrock-mantle.us-east-1.api.aws/openai/v1";
const AMAZON_BEDROCK_MANTLE_CLIENT_AGENT_HEADER: &str = "x-amzn-mantle-client-agent"; const AMAZON_BEDROCK_MANTLE_CLIENT_AGENT_HEADER: &str = "x-amzn-mantle-client-agent";
@@ -1,8 +1,13 @@
use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_4_MODEL_ID; use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_4_MODEL_ID;
use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_5_MODEL_ID; use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_5_MODEL_ID;
use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID;
use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID;
use codex_model_provider_info::AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID;
use codex_models_manager::bundled_models_response; use codex_models_manager::bundled_models_response;
use codex_protocol::openai_models::ModelInfo; use codex_protocol::openai_models::ModelInfo;
use codex_protocol::openai_models::ModelsResponse; use codex_protocol::openai_models::ModelsResponse;
use codex_protocol::openai_models::ReasoningEffort;
use codex_protocol::openai_models::ReasoningEffortPreset;
const GPT_5_BEDROCK_CONTEXT_WINDOW: i64 = 272_000; const GPT_5_BEDROCK_CONTEXT_WINDOW: i64 = 272_000;
const GPT_5_5_OPENAI_MODEL_ID: &str = "gpt-5.5"; const GPT_5_5_OPENAI_MODEL_ID: &str = "gpt-5.5";
@@ -21,6 +26,21 @@ pub(crate) fn static_model_catalog() -> ModelsResponse {
AMAZON_BEDROCK_GPT_5_4_MODEL_ID, AMAZON_BEDROCK_GPT_5_4_MODEL_ID,
/*priority*/ 1, /*priority*/ 1,
), ),
gpt_5_6_bedrock_model(
AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID,
"Sol",
/*priority*/ 2,
),
gpt_5_6_bedrock_model(
AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID,
"Terra",
/*priority*/ 3,
),
gpt_5_6_bedrock_model(
AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID,
"Luna",
/*priority*/ 4,
),
], ],
}) })
} }
@@ -44,6 +64,18 @@ fn gpt_5_bedrock_model(openai_slug: &str, bedrock_slug: &str, priority: i32) ->
model model
} }
fn gpt_5_6_bedrock_model(bedrock_slug: &str, display_name: &str, priority: i32) -> ModelInfo {
let mut model = gpt_5_bedrock_model(GPT_5_5_OPENAI_MODEL_ID, bedrock_slug, priority);
model.display_name = display_name.to_string();
model
.supported_reasoning_levels
.push(ReasoningEffortPreset {
effort: ReasoningEffort::Custom("max".to_string()),
description: "Maximum reasoning depth for the hardest problems".to_string(),
});
model
}
fn bundled_openai_model(slug: &str) -> ModelInfo { fn bundled_openai_model(slug: &str) -> ModelInfo {
bundled_models_response() bundled_models_response()
.unwrap_or_else(|err| panic!("bundled models.json should parse: {err}")) .unwrap_or_else(|err| panic!("bundled models.json should parse: {err}"))
@@ -64,39 +96,67 @@ mod tests {
fn catalog_uses_mantle_model_ids_as_slugs() { fn catalog_uses_mantle_model_ids_as_slugs() {
let catalog = static_model_catalog(); let catalog = static_model_catalog();
assert_eq!(catalog.models.len(), 2); assert_eq!(
assert_eq!(catalog.models[0].slug, AMAZON_BEDROCK_GPT_5_5_MODEL_ID); catalog
assert_eq!(catalog.models[1].slug, AMAZON_BEDROCK_GPT_5_4_MODEL_ID); .models
.iter()
.map(|model| model.slug.as_str())
.collect::<Vec<_>>(),
vec![
AMAZON_BEDROCK_GPT_5_5_MODEL_ID,
AMAZON_BEDROCK_GPT_5_4_MODEL_ID,
AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID,
AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID,
AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID,
]
);
} }
#[test] #[test]
fn gpt_5_bedrock_models_use_bedrock_context_window() { fn gpt_5_bedrock_models_use_bedrock_context_window() {
let catalog = static_model_catalog(); let catalog = static_model_catalog();
for model in catalog.models {
assert_eq!(
(model.context_window, model.max_context_window),
(
Some(GPT_5_BEDROCK_CONTEXT_WINDOW),
Some(GPT_5_BEDROCK_CONTEXT_WINDOW)
)
);
}
}
#[test]
fn gpt_5_6_bedrock_models_clone_gpt_5_5_config_with_max_reasoning_effort() {
let catalog = static_model_catalog();
let gpt_5_5 = catalog let gpt_5_5 = catalog
.models .models
.iter() .iter()
.find(|model| model.slug == AMAZON_BEDROCK_GPT_5_5_MODEL_ID) .find(|model| model.slug == AMAZON_BEDROCK_GPT_5_5_MODEL_ID)
.expect("Bedrock catalog should include GPT-5.5"); .expect("Bedrock catalog should include GPT-5.5");
let gpt_5_4 = catalog
.models
.iter()
.find(|model| model.slug == AMAZON_BEDROCK_GPT_5_4_MODEL_ID)
.expect("Bedrock catalog should include GPT-5.4");
assert_eq!( for (slug, display_name, priority) in [
(gpt_5_5.context_window, gpt_5_5.max_context_window), (AMAZON_BEDROCK_GPT_5_6_SOL_MODEL_ID, "Sol", 2),
( (AMAZON_BEDROCK_GPT_5_6_TERRA_MODEL_ID, "Terra", 3),
Some(GPT_5_BEDROCK_CONTEXT_WINDOW), (AMAZON_BEDROCK_GPT_5_6_LUNA_MODEL_ID, "Luna", 4),
Some(GPT_5_BEDROCK_CONTEXT_WINDOW) ] {
) let mut expected = gpt_5_5.clone();
); expected.slug = slug.to_string();
assert_eq!( expected.display_name = display_name.to_string();
(gpt_5_4.context_window, gpt_5_4.max_context_window), expected.priority = priority;
( expected
Some(GPT_5_BEDROCK_CONTEXT_WINDOW), .supported_reasoning_levels
Some(GPT_5_BEDROCK_CONTEXT_WINDOW) .push(ReasoningEffortPreset {
) effort: ReasoningEffort::Custom("max".to_string()),
); description: "Maximum reasoning depth for the hardest problems".to_string(),
});
assert_eq!(
catalog.models.iter().find(|model| model.slug == slug),
Some(&expected)
);
}
} }
#[test] #[test]
+10 -1
View File
@@ -659,7 +659,16 @@ mod tests {
.map(|model| model.slug.as_str()) .map(|model| model.slug.as_str())
.collect::<Vec<_>>(); .collect::<Vec<_>>();
assert_eq!(model_ids, vec!["openai.gpt-5.5", "openai.gpt-5.4"]); assert_eq!(
model_ids,
vec![
"openai.gpt-5.5",
"openai.gpt-5.4",
"openai.gpt-5.6-sol",
"openai.gpt-5.6-terra",
"openai.gpt-5.6-luna",
]
);
let default_model = manager let default_model = manager
.list_models(RefreshStrategy::Online) .list_models(RefreshStrategy::Online)