refactor: removed redundant skill name validation from has_skill function

This commit is contained in:
2026-06-04 14:58:33 -06:00
parent feef3f67b5
commit b1696c3425
4 changed files with 15 additions and 14 deletions
+2 -1
View File
@@ -1231,7 +1231,8 @@ impl RequestContext {
if let Some(ref tool_names) = role_filter {
agent_functions.retain(|v| {
tool_names.contains(&v.name)
|| v.name.starts_with(SKILL_FUNCTION_PREFIX)
|| (!matches!(agent.skills_enabled(), Some(false))
&& v.name.starts_with(SKILL_FUNCTION_PREFIX))
|| v.name.starts_with(USER_FUNCTION_PREFIX)
});
}