feat: dynamic loading/unloading of skill tools and MCP servers whenever load_skill/unload_skill are invoked

This commit is contained in:
2026-06-01 13:22:44 -06:00
parent cdc4bd154a
commit de42cae87f
4 changed files with 113 additions and 25 deletions
+7 -5
View File
@@ -1048,11 +1048,13 @@ impl ToolCall {
})
}
_ if cmd_name.starts_with(SKILL_FUNCTION_PREFIX) => {
skill::handle_skill_tool(ctx, &cmd_name, &json_data).unwrap_or_else(|e| {
let error_msg = format!("Skill tool failed: {e}");
eprintln!("{}", warning_text(&format!("⚠️ {error_msg} ⚠️")));
json!({"tool_call_error": error_msg})
})
skill::handle_skill_tool(ctx, &cmd_name, &json_data)
.await
.unwrap_or_else(|e| {
let error_msg = format!("Skill tool failed: {e}");
eprintln!("{}", warning_text(&format!("⚠️ {error_msg} ⚠️")));
json!({"tool_call_error": error_msg})
})
}
_ if cmd_name.starts_with(SUPERVISOR_FUNCTION_PREFIX) => {
supervisor::handle_supervisor_tool(ctx, &cmd_name, &json_data)