mirror of
https://github.com/openai/codex.git
synced 2026-11-30 00:10:49 +00:00
Restrict legacy incremental tools to Amazon Bedrock providers (#60040)
## What changed Gate `incremental_tools_legacy` on the `amazon-bedrock` and `amazon-bedrock-runtime` provider IDs instead of the OpenAI provider for regular Responses requests. Responses Lite continues to use `incremental_tools`. ## Testing Expand the tool catalog update scenarios to cover both Bedrock provider IDs with legacy incremental tools enabled and disabled. Update the regular Responses tool removal scenario to use the Bedrock provider. GitOrigin-RevId: ad0ff31975166a2a7fdcee6fefc272ecc79dd448
This commit is contained in:
@@ -5,6 +5,9 @@ use codex_core::ForkSnapshot;
|
||||
use codex_core::McpServersDisabled;
|
||||
use codex_core::compact::AutoCompactionDisabled;
|
||||
use codex_features::Feature;
|
||||
use codex_model_provider_info::AMAZON_BEDROCK_PROVIDER_ID;
|
||||
use codex_model_provider_info::AMAZON_BEDROCK_RUNTIME_PROVIDER_ID;
|
||||
use codex_model_provider_info::OPENAI_PROVIDER_ID;
|
||||
use codex_otel::MetricsClient;
|
||||
use codex_otel::MetricsConfig;
|
||||
use codex_otel::TOOL_INCREMENTAL_UPDATES_METRIC;
|
||||
@@ -148,15 +151,19 @@ async fn prediction_fork_keeps_inherited_tools() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test_case(true, None, true; "responses_lite")]
|
||||
#[test_case(true, Some(true), true; "announcements_suppressed")]
|
||||
#[test_case(false, None, false; "responses_api")]
|
||||
#[test_case(false, None, true; "responses_api_incremental")]
|
||||
#[test_case(true, None, true, OPENAI_PROVIDER_ID; "responses_lite")]
|
||||
#[test_case(true, Some(true), true, OPENAI_PROVIDER_ID; "announcements_suppressed")]
|
||||
#[test_case(false, None, false, OPENAI_PROVIDER_ID; "responses_api")]
|
||||
#[test_case(false, None, false, AMAZON_BEDROCK_PROVIDER_ID; "mantle_provider_id")]
|
||||
#[test_case(false, None, true, AMAZON_BEDROCK_PROVIDER_ID; "mantle_provider_id_incremental")]
|
||||
#[test_case(false, None, false, AMAZON_BEDROCK_RUNTIME_PROVIDER_ID; "runtime_provider_id")]
|
||||
#[test_case(false, None, true, AMAZON_BEDROCK_RUNTIME_PROVIDER_ID; "runtime_provider_id_incremental")]
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn incremental_tools_append_changed_catalog_without_rewriting_history(
|
||||
use_responses_lite: bool,
|
||||
suppress_model_change_announcements: Option<bool>,
|
||||
incremental_tools: bool,
|
||||
provider_id: &'static str,
|
||||
) -> Result<()> {
|
||||
skip_if_no_network!(Ok(()));
|
||||
let server = responses::start_mock_server().await;
|
||||
@@ -203,6 +210,7 @@ async fn incremental_tools_append_changed_catalog_without_rewriting_history(
|
||||
}
|
||||
})
|
||||
.with_config(move |config| {
|
||||
config.model_provider_id = provider_id.to_string();
|
||||
if !use_responses_lite && incremental_tools {
|
||||
config
|
||||
.features
|
||||
@@ -504,6 +512,9 @@ async fn tool_removal_appends_a_standalone_notice_without_rewriting_history(
|
||||
}
|
||||
})
|
||||
.with_config(move |config| {
|
||||
if !use_responses_lite {
|
||||
config.model_provider_id = AMAZON_BEDROCK_PROVIDER_ID.to_string();
|
||||
}
|
||||
config
|
||||
.features
|
||||
.enable(if use_responses_lite {
|
||||
|
||||
Reference in New Issue
Block a user