mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
feat: update Bedrock Mantle endpoint and GPT-5.4 model ID (#20109)
## Summary Amazon Bedrock Mantle's OpenAI-compatible endpoint now lives under `/openai/v1`, and the GPT-5.4 Mantle model ID no longer uses the `-cmb` suffix. This updates Codex's built-in Bedrock provider configuration so generated providers and the static Bedrock catalog use the current endpoint and model ID. ## Changes - Update the Bedrock Mantle base URL from `https://bedrock-mantle.{region}.api.aws/v1` to `https://bedrock-mantle.{region}.api.aws/openai/v1`. - Update the Amazon Bedrock default base URL in `codex-model-provider-info`. - Change the Bedrock GPT-5.4 catalog slug from `openai.gpt-5.4-cmb` to `openai.gpt-5.4`. - Align provider and catalog tests with the new URL and model ID. ## Test Plan - Manual smoke test: ```shell target/debug/codex \ -m openai.gpt-5.4 \ -c 'model_provider="amazon-bedrock"' \ -c 'model_providers.amazon-bedrock.aws.region="us-west-2"' ```
This commit is contained in:
@@ -15,7 +15,7 @@ use codex_protocol::openai_models::WebSearchToolType;
|
||||
const GPT_OSS_CONTEXT_WINDOW: i64 = 128_000;
|
||||
const GPT_5_4_CONTEXT_WINDOW: i64 = 272_000;
|
||||
const GPT_5_4_MAX_CONTEXT_WINDOW: i64 = 1_000_000;
|
||||
const GPT_5_4_CMB_MODEL_ID: &str = "openai.gpt-5.4-cmb";
|
||||
const GPT_5_4_CMB_MODEL_ID: &str = "openai.gpt-5.4";
|
||||
|
||||
pub(crate) fn static_model_catalog() -> ModelsResponse {
|
||||
ModelsResponse {
|
||||
|
||||
@@ -37,7 +37,7 @@ pub(super) fn region_from_config(aws: &ModelProviderAwsAuthInfo) -> Option<Strin
|
||||
|
||||
pub(super) fn base_url(region: &str) -> Result<String> {
|
||||
if BEDROCK_MANTLE_SUPPORTED_REGIONS.contains(®ion) {
|
||||
Ok(format!("https://bedrock-mantle.{region}.api.aws/v1"))
|
||||
Ok(format!("https://bedrock-mantle.{region}.api.aws/openai/v1"))
|
||||
} else {
|
||||
Err(CodexErr::Fatal(format!(
|
||||
"Amazon Bedrock Mantle does not support region `{region}`"
|
||||
@@ -55,7 +55,7 @@ mod tests {
|
||||
fn base_url_uses_region_endpoint() {
|
||||
assert_eq!(
|
||||
base_url("ap-northeast-1").expect("supported region"),
|
||||
"https://bedrock-mantle.ap-northeast-1.api.aws/v1"
|
||||
"https://bedrock-mantle.ap-northeast-1.api.aws/openai/v1"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ mod tests {
|
||||
|
||||
assert_eq!(
|
||||
api_provider.base_url,
|
||||
"https://bedrock-mantle.eu-central-1.api.aws/v1"
|
||||
"https://bedrock-mantle.eu-central-1.api.aws/openai/v1"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ mod tests {
|
||||
assert_eq!(
|
||||
model_ids,
|
||||
vec![
|
||||
"openai.gpt-5.4-cmb",
|
||||
"openai.gpt-5.4",
|
||||
"openai.gpt-oss-120b",
|
||||
"openai.gpt-oss-20b"
|
||||
]
|
||||
@@ -474,7 +474,7 @@ mod tests {
|
||||
.find(|preset| preset.is_default)
|
||||
.expect("Bedrock catalog should have a default model");
|
||||
|
||||
assert_eq!(default_model.model, "openai.gpt-5.4-cmb");
|
||||
assert_eq!(default_model.model, "openai.gpt-5.4");
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user