codex: address PR review feedback (#15181)

This commit is contained in:
Eric Traut
2026-03-19 11:11:06 -06:00
parent bf849fb482
commit 9b6bc8f46a
2 changed files with 25 additions and 1 deletions
+15 -1
View File
@@ -6370,7 +6370,21 @@ pub(crate) async fn built_tools(
accessible_connectors.as_slice(),
)
.await
{
.map(|discoverable_tools| {
if turn_context.app_server_client_name.as_deref() != Some("codex-tui") {
return discoverable_tools;
}
discoverable_tools
.into_iter()
.filter(|tool| {
!matches!(
tool,
crate::tools::discoverable::DiscoverableTool::Plugin(_)
)
})
.collect()
}) {
Ok(discoverable_tools) if discoverable_tools.is_empty() => None,
Ok(discoverable_tools) => Some(discoverable_tools),
Err(err) => {
@@ -115,6 +115,16 @@ impl ToolHandler for ToolSuggestHandler {
&accessible_connectors,
)
.await
.map(|discoverable_tools| {
if turn.app_server_client_name.as_deref() != Some("codex-tui") {
return discoverable_tools;
}
discoverable_tools
.into_iter()
.filter(|tool| !matches!(tool, DiscoverableTool::Plugin(_)))
.collect()
})
.map_err(|err| {
FunctionCallError::RespondToModel(format!(
"tool suggestions are unavailable right now: {err}"