fix: reduce code duplication by reusing the new concrete_tool_names function in .list tools
CI / All (ubuntu-latest) (push) Failing after 25s
CI / All (macos-latest) (push) Has been cancelled
CI / All (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-07-17 15:51:01 -06:00
parent a606ea552d
commit c979041161
+12 -11
View File
@@ -2362,20 +2362,21 @@ impl RequestContext {
Ok(())
}
"tools" => {
let mut names: Vec<String> = self
.tool_scope
.functions
.declarations()
let mut names = self.concrete_tool_names();
let aliases: Vec<String> = self
.app
.config
.mapping_tools
.iter()
.filter(|v| {
!v.name.starts_with("user__")
&& !v.name.starts_with("mcp_")
&& !v.name.starts_with("todo__")
&& !v.name.starts_with("agent__")
.filter(|(_, expansion)| {
expansion
.split(',')
.map(str::trim)
.any(|v| names.iter().any(|p| p.as_str() == v))
})
.map(|v| v.name.clone())
.map(|(k, _)| k.clone())
.collect();
names.extend(self.app.config.mapping_tools.keys().map(|v| v.to_string()));
names.extend(aliases);
names.sort_unstable();
names.dedup();