agent: Fix issue with duplicated tool names from MCP servers (#33811)

Closes #33792

Follow up to #33237 - Turns out my fix for this was not correct

Release Notes:

- agent: Fixed an issue where tools would not work when two MCP servers
provided a tool with the same name
This commit is contained in:
Bennet Bo Fenner 2025-07-02 22:32:07 +02:00 committed by GitHub
parent f27b508e4b
commit 0553dc0d49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 386 additions and 273 deletions

View file

@ -42,8 +42,8 @@ impl IncompatibleToolsState {
.profile()
.enabled_tools(cx)
.iter()
.filter(|tool| tool.input_schema(model.tool_input_format()).is_err())
.cloned()
.filter(|(_, tool)| tool.input_schema(model.tool_input_format()).is_err())
.map(|(_, tool)| tool.clone())
.collect()
})
}