mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
chore: enable namespace tools for Bedrock (#24713)
Client-side namespace tools are now supported by bedrock. Enable `namespace_tools` for the Amazon Bedrock provider while continuing to disable unsupported hosted tools such as image generation and web search.
This commit is contained in:
1 parent
6b4b15a1ed
commit
07a930138f
3 files changed
+13
-13
No files matched your search
@@ -60,7 +60,7 @@ async fn read_amazon_bedrock_provider_capabilities() -> Result<()> {
|
|||||||
let received: ModelProviderCapabilitiesReadResponse = to_response(response)?;
|
let received: ModelProviderCapabilitiesReadResponse = to_response(response)?;
|
||||||
|
|
||||||
let expected = ModelProviderCapabilitiesReadResponse {
|
let expected = ModelProviderCapabilitiesReadResponse {
|
||||||
namespace_tools: false,
|
namespace_tools: true,
|
||||||
image_generation: false,
|
image_generation: false,
|
||||||
web_search: false,
|
web_search: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -526,7 +526,7 @@ async fn mcp_and_tool_search_follow_direct_and_deferred_tool_exposure() {
|
|||||||
"read_mcp_resource",
|
"read_mcp_resource",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let missing_namespace_capability = probe_with(
|
let bedrock_namespace_capability = probe_with(
|
||||||
|turn| {
|
|turn| {
|
||||||
turn.model_info.supports_search_tool = true;
|
turn.model_info.supports_search_tool = true;
|
||||||
use_bedrock_provider(turn);
|
use_bedrock_provider(turn);
|
||||||
@@ -537,7 +537,7 @@ async fn mcp_and_tool_search_follow_direct_and_deferred_tool_exposure() {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
missing_namespace_capability.assert_visible_lacks(&["tool_search"]);
|
bedrock_namespace_capability.assert_visible_contains(&["tool_search"]);
|
||||||
|
|
||||||
let enabled = probe_with(
|
let enabled = probe_with(
|
||||||
|turn| {
|
|turn| {
|
||||||
@@ -890,7 +890,7 @@ async fn multi_agent_v2_can_use_configured_tool_namespace() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn multi_agent_v2_namespace_is_ignored_without_provider_namespace_support() {
|
async fn multi_agent_v2_namespace_is_supported_by_bedrock_provider() {
|
||||||
let plan = probe(|turn| {
|
let plan = probe(|turn| {
|
||||||
set_feature(turn, Feature::MultiAgentV2, /*enabled*/ true);
|
set_feature(turn, Feature::MultiAgentV2, /*enabled*/ true);
|
||||||
update_config(turn, |config| {
|
update_config(turn, |config| {
|
||||||
@@ -900,15 +900,15 @@ async fn multi_agent_v2_namespace_is_ignored_without_provider_namespace_support(
|
|||||||
})
|
})
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
plan.assert_visible_contains(&["spawn_agent", "send_message", "list_agents"]);
|
plan.assert_visible_contains(&["agents"]);
|
||||||
plan.assert_visible_lacks(&["agents"]);
|
plan.assert_visible_lacks(&["spawn_agent", "send_message", "list_agents"]);
|
||||||
assert!(
|
|
||||||
plan.registered_names
|
|
||||||
.contains(&ToolName::plain("spawn_agent").to_string())
|
|
||||||
);
|
|
||||||
assert!(
|
assert!(
|
||||||
!plan
|
!plan
|
||||||
.registered_names
|
.registered_names
|
||||||
|
.contains(&ToolName::plain("spawn_agent").to_string())
|
||||||
|
);
|
||||||
|
assert!(
|
||||||
|
plan.registered_names
|
||||||
.contains(&ToolName::namespaced("agents", "spawn_agent").to_string())
|
.contains(&ToolName::namespaced("agents", "spawn_agent").to_string())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ impl ModelProvider for AmazonBedrockModelProvider {
|
|||||||
|
|
||||||
fn capabilities(&self) -> ProviderCapabilities {
|
fn capabilities(&self) -> ProviderCapabilities {
|
||||||
ProviderCapabilities {
|
ProviderCapabilities {
|
||||||
namespace_tools: false,
|
namespace_tools: true,
|
||||||
image_generation: false,
|
image_generation: false,
|
||||||
web_search: false,
|
web_search: false,
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn capabilities_disable_unsupported_launch_features() {
|
fn capabilities_disable_unsupported_hosted_tools() {
|
||||||
let provider = AmazonBedrockModelProvider::new(
|
let provider = AmazonBedrockModelProvider::new(
|
||||||
ModelProviderInfo::create_amazon_bedrock_provider(/*aws*/ None),
|
ModelProviderInfo::create_amazon_bedrock_provider(/*aws*/ None),
|
||||||
);
|
);
|
||||||
@@ -139,7 +139,7 @@ mod tests {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
provider.capabilities(),
|
provider.capabilities(),
|
||||||
ProviderCapabilities {
|
ProviderCapabilities {
|
||||||
namespace_tools: false,
|
namespace_tools: true,
|
||||||
image_generation: false,
|
image_generation: false,
|
||||||
web_search: false,
|
web_search: false,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user