Skip to content

Commit 80fb070

Browse files
authored
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"' ```
1 parent 8c47e36 commit 80fb070

6 files changed

Lines changed: 9 additions & 8 deletions

File tree

codex-rs/model-provider-info/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ const OPENAI_PROVIDER_NAME: &str = "OpenAI";
3636
pub const OPENAI_PROVIDER_ID: &str = "openai";
3737
const AMAZON_BEDROCK_PROVIDER_NAME: &str = "Amazon Bedrock";
3838
pub const AMAZON_BEDROCK_PROVIDER_ID: &str = "amazon-bedrock";
39-
pub const AMAZON_BEDROCK_DEFAULT_BASE_URL: &str = "https://bedrock-mantle.us-east-1.api.aws/v1";
39+
pub const AMAZON_BEDROCK_DEFAULT_BASE_URL: &str =
40+
"https://bedrock-mantle.us-east-1.api.aws/openai/v1";
4041
const CHAT_WIRE_API_REMOVED_ERROR: &str = "`wire_api = \"chat\"` is no longer supported.\nHow to fix: set `wire_api = \"responses\"` in your provider config.\nMore info: https://github.com/openai/codex/discussions/7782";
4142
pub const LEGACY_OLLAMA_CHAT_PROVIDER_ID: &str = "ollama-chat";
4243
pub const OLLAMA_CHAT_PROVIDER_REMOVED_ERROR: &str = "`ollama-chat` is no longer supported.\nHow to fix: replace `ollama-chat` with `ollama` in `model_provider`, `oss_provider`, or `--local-provider`.\nMore info: https://github.com/openai/codex/discussions/7782";

codex-rs/model-provider-info/src/model_provider_info_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ fn test_create_amazon_bedrock_provider() {
245245
ModelProviderInfo::create_amazon_bedrock_provider(/*aws*/ None),
246246
ModelProviderInfo {
247247
name: "Amazon Bedrock".to_string(),
248-
base_url: Some("https://bedrock-mantle.us-east-1.api.aws/v1".to_string()),
248+
base_url: Some("https://bedrock-mantle.us-east-1.api.aws/openai/v1".to_string()),
249249
env_key: None,
250250
env_key_instructions: None,
251251
experimental_bearer_token: None,

codex-rs/model-provider/src/amazon_bedrock/catalog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use codex_protocol::openai_models::WebSearchToolType;
1515
const GPT_OSS_CONTEXT_WINDOW: i64 = 128_000;
1616
const GPT_5_4_CONTEXT_WINDOW: i64 = 272_000;
1717
const GPT_5_4_MAX_CONTEXT_WINDOW: i64 = 1_000_000;
18-
const GPT_5_4_CMB_MODEL_ID: &str = "openai.gpt-5.4-cmb";
18+
const GPT_5_4_CMB_MODEL_ID: &str = "openai.gpt-5.4";
1919

2020
pub(crate) fn static_model_catalog() -> ModelsResponse {
2121
ModelsResponse {

codex-rs/model-provider/src/amazon_bedrock/mantle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub(super) fn region_from_config(aws: &ModelProviderAwsAuthInfo) -> Option<Strin
3737

3838
pub(super) fn base_url(region: &str) -> Result<String> {
3939
if BEDROCK_MANTLE_SUPPORTED_REGIONS.contains(&region) {
40-
Ok(format!("https://bedrock-mantle.{region}.api.aws/v1"))
40+
Ok(format!("https://bedrock-mantle.{region}.api.aws/openai/v1"))
4141
} else {
4242
Err(CodexErr::Fatal(format!(
4343
"Amazon Bedrock Mantle does not support region `{region}`"
@@ -55,7 +55,7 @@ mod tests {
5555
fn base_url_uses_region_endpoint() {
5656
assert_eq!(
5757
base_url("ap-northeast-1").expect("supported region"),
58-
"https://bedrock-mantle.ap-northeast-1.api.aws/v1"
58+
"https://bedrock-mantle.ap-northeast-1.api.aws/openai/v1"
5959
);
6060
}
6161

codex-rs/model-provider/src/amazon_bedrock/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ mod tests {
122122

123123
assert_eq!(
124124
api_provider.base_url,
125-
"https://bedrock-mantle.eu-central-1.api.aws/v1"
125+
"https://bedrock-mantle.eu-central-1.api.aws/openai/v1"
126126
);
127127
}
128128

codex-rs/model-provider/src/provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ mod tests {
461461
assert_eq!(
462462
model_ids,
463463
vec![
464-
"openai.gpt-5.4-cmb",
464+
"openai.gpt-5.4",
465465
"openai.gpt-oss-120b",
466466
"openai.gpt-oss-20b"
467467
]
@@ -474,7 +474,7 @@ mod tests {
474474
.find(|preset| preset.is_default)
475475
.expect("Bedrock catalog should have a default model");
476476

477-
assert_eq!(default_model.model, "openai.gpt-5.4-cmb");
477+
assert_eq!(default_model.model, "openai.gpt-5.4");
478478
}
479479

480480
#[tokio::test]

0 commit comments

Comments
 (0)