mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
update
This commit is contained in:
@@ -5984,7 +5984,9 @@ fn filter_connectors_for_input(
|
||||
) -> Vec<connectors::AppInfo> {
|
||||
let connectors: Vec<connectors::AppInfo> = connectors
|
||||
.iter()
|
||||
.filter(|connector| connector.is_enabled)
|
||||
.filter(|connector| {
|
||||
connector.is_enabled || explicitly_enabled_connectors.contains(&connector.id)
|
||||
})
|
||||
.cloned()
|
||||
.collect::<Vec<_>>();
|
||||
if connectors.is_empty() {
|
||||
@@ -6056,6 +6058,7 @@ fn filter_codex_apps_mcp_tools(
|
||||
mcp_tools: &HashMap<String, crate::mcp_connection_manager::ToolInfo>,
|
||||
connectors: &[connectors::AppInfo],
|
||||
config: &Config,
|
||||
enabled_connector_overrides: &HashSet<String>,
|
||||
) -> HashMap<String, crate::mcp_connection_manager::ToolInfo> {
|
||||
let allowed: HashSet<&str> = connectors
|
||||
.iter()
|
||||
@@ -6071,7 +6074,12 @@ fn filter_codex_apps_mcp_tools(
|
||||
let Some(connector_id) = codex_apps_connector_id(tool) else {
|
||||
return false;
|
||||
};
|
||||
allowed.contains(connector_id) && connectors::codex_app_tool_is_enabled(config, tool)
|
||||
allowed.contains(connector_id)
|
||||
&& connectors::codex_app_tool_is_enabled_with_enabled_connector_overrides(
|
||||
config,
|
||||
tool,
|
||||
enabled_connector_overrides,
|
||||
)
|
||||
})
|
||||
.map(|(name, tool)| (name.clone(), tool.clone()))
|
||||
.collect()
|
||||
@@ -6266,7 +6274,12 @@ async fn built_tools(
|
||||
// Keep the connector-grouped app view around for the router even though
|
||||
// app tools only become prompt-visible after explicit selection/discovery.
|
||||
let app_tools = connectors.as_ref().map(|connectors| {
|
||||
filter_codex_apps_mcp_tools(&mcp_tools, connectors, &turn_context.config)
|
||||
filter_codex_apps_mcp_tools(
|
||||
&mcp_tools,
|
||||
connectors,
|
||||
&turn_context.config,
|
||||
&effective_explicitly_enabled_connectors,
|
||||
)
|
||||
});
|
||||
|
||||
if let Some(connectors) = connectors.as_ref() {
|
||||
@@ -6292,8 +6305,11 @@ async fn built_tools(
|
||||
explicitly_enabled.as_ref(),
|
||||
));
|
||||
|
||||
mcp_tools =
|
||||
connectors::filter_codex_apps_tools_by_policy(selected_mcp_tools, &turn_context.config);
|
||||
mcp_tools = connectors::filter_codex_apps_tools_by_policy_with_enabled_connector_overrides(
|
||||
selected_mcp_tools,
|
||||
&turn_context.config,
|
||||
&effective_explicitly_enabled_connectors,
|
||||
);
|
||||
}
|
||||
|
||||
Ok(Arc::new(ToolRouter::from_config(
|
||||
|
||||
Reference in New Issue
Block a user