feat: add Bedrock Mantle client agent header (#21840)

## Why

Amazon Bedrock Mantle needs a stable client-agent header so requests
from the built-in Bedrock provider can be identified as coming from
Codex for safety stack.

## What changed

- Added `x-amzn-mantle-client-agent: codex` to the built-in Amazon
Bedrock provider default HTTP headers.
This commit is contained in:
Celia Chen authored and GitHub committed 2026-05-08 23:58:41 +00:00
1 parent 0c8d42525e
commit bd42660cb4
2 files changed
+25 -2

No files matched your search

+6 -1
View File
@@ -39,6 +39,8 @@ const AMAZON_BEDROCK_PROVIDER_NAME: &str = "Amazon Bedrock";
pub const AMAZON_BEDROCK_PROVIDER_ID: &str = "amazon-bedrock";
pub const AMAZON_BEDROCK_DEFAULT_BASE_URL: &str =
"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_VALUE: &str = "codex";
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";
pub const LEGACY_OLLAMA_CHAT_PROVIDER_ID: &str = "ollama-chat";
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";
@@ -365,7 +367,10 @@ impl ModelProviderInfo {
})),
wire_api: WireApi::Responses,
query_params: None,
http_headers: None,
http_headers: Some(HashMap::from([(
AMAZON_BEDROCK_MANTLE_CLIENT_AGENT_HEADER.to_string(),
AMAZON_BEDROCK_MANTLE_CLIENT_AGENT_VALUE.to_string(),
)])),
env_http_headers: None,
request_max_retries: None,
stream_max_retries: None,