mirror of
https://github.com/openai/codex.git
synced 2026-10-20 00:18:49 +00:00
Advertise Ultrafast for GPT-6.1 Sol on Amazon Bedrock (#51794)
## What changed
Add the `ultrafast` service tier to bundled catalogs for `openai.gpt-6.1-sol` on Bedrock Mantle and `global.openai.gpt-6.1-sol` and `us.openai.gpt-6.1-sol` on Bedrock Runtime. This exposes `/ultrafast` for these models while keeping tier selection opt-in.
## Testing
Extend catalog, app-server, core request, and TUI tests to cover GPT-6.1 Sol tier discovery and selection across all three model IDs, including toggling back to the default tier and honoring custom catalog commands.
GitOrigin-RevId: b5bbde8615b73a1d73eb16db7952b10d044b9fa6
(cherry picked from commit 87be737b66)
This commit is contained in:
@@ -8,8 +8,8 @@ use codex_app_server_protocol::ModelServiceTier;
|
||||
use pretty_assertions::assert_eq;
|
||||
use tempfile::TempDir;
|
||||
|
||||
#[test_case::test_case("amazon-bedrock", vec!["openai.gpt-6-astra"]; "mantle")]
|
||||
#[test_case::test_case("amazon-bedrock-runtime", vec!["global.openai.gpt-6-astra", "us.openai.gpt-6-astra"]; "runtime")]
|
||||
#[test_case::test_case("amazon-bedrock", vec!["openai.gpt-6.1-sol", "openai.gpt-6-astra"]; "mantle")]
|
||||
#[test_case::test_case("amazon-bedrock-runtime", vec!["global.openai.gpt-6.1-sol", "global.openai.gpt-6-astra", "us.openai.gpt-6.1-sol", "us.openai.gpt-6-astra"]; "runtime")]
|
||||
#[tokio::test]
|
||||
async fn bedrock_model_list_advertises_ultrafast_without_changing_default(
|
||||
provider_id: &str,
|
||||
|
||||
@@ -14,6 +14,9 @@ use pretty_assertions::assert_eq;
|
||||
#[test_case::test_case(AMAZON_BEDROCK_PROVIDER_ID, "openai.gpt-6-astra"; "mantle")]
|
||||
#[test_case::test_case(AMAZON_BEDROCK_RUNTIME_PROVIDER_ID, "global.openai.gpt-6-astra"; "runtime global")]
|
||||
#[test_case::test_case(AMAZON_BEDROCK_RUNTIME_PROVIDER_ID, "us.openai.gpt-6-astra"; "runtime us")]
|
||||
#[test_case::test_case(AMAZON_BEDROCK_PROVIDER_ID, "openai.gpt-6.1-sol"; "mantle sol61")]
|
||||
#[test_case::test_case(AMAZON_BEDROCK_RUNTIME_PROVIDER_ID, "global.openai.gpt-6.1-sol"; "runtime global sol61")]
|
||||
#[test_case::test_case(AMAZON_BEDROCK_RUNTIME_PROVIDER_ID, "us.openai.gpt-6.1-sol"; "runtime us sol61")]
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn bedrock_ultrafast_can_be_configured_and_toggled(
|
||||
provider_id: &'static str,
|
||||
|
||||
@@ -102,11 +102,16 @@ pub(super) fn normalize_bundled_bedrock_catalog(
|
||||
model.service_tiers.clear();
|
||||
if matches!(
|
||||
(endpoint, model.slug.as_str()),
|
||||
(BedrockEndpoint::Mantle, AMAZON_BEDROCK_GPT_6_ASTRA_MODEL_ID)
|
||||
| (
|
||||
BedrockEndpoint::Runtime,
|
||||
"global.openai.gpt-6-astra" | "us.openai.gpt-6-astra"
|
||||
)
|
||||
(
|
||||
BedrockEndpoint::Mantle,
|
||||
AMAZON_BEDROCK_GPT_6_ASTRA_MODEL_ID | AMAZON_BEDROCK_GPT_6_1_SOL_MODEL_ID
|
||||
) | (
|
||||
BedrockEndpoint::Runtime,
|
||||
"global.openai.gpt-6-astra"
|
||||
| "us.openai.gpt-6-astra"
|
||||
| "global.openai.gpt-6.1-sol"
|
||||
| "us.openai.gpt-6.1-sol"
|
||||
)
|
||||
) {
|
||||
model.service_tiers.push(ModelServiceTier {
|
||||
id: "ultrafast".to_string(),
|
||||
@@ -373,7 +378,10 @@ mod tests {
|
||||
expected.use_responses_lite = false;
|
||||
expected.tool_mode = None;
|
||||
expected.additional_speed_tiers.clear();
|
||||
expected.service_tiers = if slug == AMAZON_BEDROCK_GPT_6_ASTRA_MODEL_ID {
|
||||
expected.service_tiers = if matches!(
|
||||
slug,
|
||||
AMAZON_BEDROCK_GPT_6_ASTRA_MODEL_ID | AMAZON_BEDROCK_GPT_6_1_SOL_MODEL_ID
|
||||
) {
|
||||
vec![ModelServiceTier {
|
||||
id: "ultrafast".to_string(),
|
||||
name: "Ultrafast".to_string(),
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/bedrock_catalog_tests.rs
|
||||
expression: "format!(\"Bundled catalog:\\n{bundled_view}\\n\\nCustom catalog:\\n{custom_view}\")"
|
||||
---
|
||||
Bundled catalog:
|
||||
› /ultrafast The fastest available responses for latency-sensitive work.
|
||||
|
||||
› /ultrafast
|
||||
|
||||
GPT-6.1 Sol default · /tmp/project
|
||||
|
||||
Custom catalog:
|
||||
› /express My custom Bedrock tier.
|
||||
|
||||
› /express
|
||||
|
||||
GPT-6.1-Sol default · /tmp/project
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/bedrock_catalog_tests.rs
|
||||
expression: "format!(\"Bundled catalog:\\n{bundled_view}\\n\\nCustom catalog:\\n{custom_view}\")"
|
||||
---
|
||||
Bundled catalog:
|
||||
› /ultrafast The fastest available responses for latency-sensitive work.
|
||||
|
||||
› /ultrafast
|
||||
|
||||
GPT-6.1 Sol (Global) default · /tmp/project
|
||||
|
||||
Custom catalog:
|
||||
› /express My custom Bedrock tier.
|
||||
|
||||
› /express
|
||||
|
||||
GPT-6.1-Sol default · /tmp/project
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests/bedrock_catalog_tests.rs
|
||||
expression: "format!(\"Bundled catalog:\\n{bundled_view}\\n\\nCustom catalog:\\n{custom_view}\")"
|
||||
---
|
||||
Bundled catalog:
|
||||
› /ultrafast The fastest available responses for latency-sensitive work.
|
||||
|
||||
› /ultrafast
|
||||
|
||||
GPT-6.1 Sol (US cross-region) default · /tmp/project
|
||||
|
||||
Custom catalog:
|
||||
› /express My custom Bedrock tier.
|
||||
|
||||
› /express
|
||||
|
||||
GPT-6.1-Sol default · /tmp/project
|
||||
@@ -139,6 +139,24 @@ async fn bedrock_ultrafast_slash_command_selects_and_clears_tier() {
|
||||
"us.openai.gpt-6-astra",
|
||||
"us.openai.gpt-6-sol",
|
||||
),
|
||||
(
|
||||
"mantle_sol61",
|
||||
ModelProviderInfo::create_amazon_bedrock_provider(/*aws*/ None),
|
||||
"openai.gpt-6.1-sol",
|
||||
"openai.gpt-6-sol",
|
||||
),
|
||||
(
|
||||
"runtime_global_sol61",
|
||||
ModelProviderInfo::create_amazon_bedrock_runtime_provider(/*aws*/ None),
|
||||
"global.openai.gpt-6.1-sol",
|
||||
"global.openai.gpt-6-sol",
|
||||
),
|
||||
(
|
||||
"runtime_us_sol61",
|
||||
ModelProviderInfo::create_amazon_bedrock_runtime_provider(/*aws*/ None),
|
||||
"us.openai.gpt-6.1-sol",
|
||||
"us.openai.gpt-6-sol",
|
||||
),
|
||||
] {
|
||||
let presets = create_model_provider(provider_info.clone(), /*auth_manager*/ None)
|
||||
.models_manager_without_cache(/*config_model_catalog*/ None)
|
||||
@@ -175,8 +193,10 @@ async fn bedrock_ultrafast_slash_command_selects_and_clears_tier() {
|
||||
.expect("bundled catalog")
|
||||
.models
|
||||
.into_iter()
|
||||
.find(|model| model.slug == "gpt-6-astra")
|
||||
.expect("bundled Astra model");
|
||||
.find(|info| {
|
||||
Some(info.slug.as_str()) == model.split_once("openai.").map(|(_, slug)| slug)
|
||||
})
|
||||
.expect("bundled OpenAI model");
|
||||
custom_model.slug = model.to_string();
|
||||
custom_model.service_tiers = vec![codex_protocol::openai_models::ModelServiceTier {
|
||||
id: "ultrafast".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user