| 8022 | static pid_t agent_tool_pid(const agent_tool_call *call) { |
| 8023 | return (pid_t)agent_parse_int_default(agent_tool_arg_value(call, "pid"), 0, 0, INT_MAX); |
| 8024 | } |
| 8025 | |
| 8026 | /* ============================================================================ |
| 8027 | * Tool Dispatch |
| 8028 | * ============================================================================ |
| 8029 | */ |
| 8030 | |
| 8031 | /* Execute one parsed DSML tool call and return the text that will be appended as |
| 8032 | * the tool-role result. UI visualization already happened while streaming; this |
| 8033 | * function is only about side effects and the model-visible observation. */ |
| 8034 | static char *agent_execute_tool_call(agent_worker *w, const agent_tool_call *call) { |
| 8035 | agent_buf result = {0}; |
| 8036 | if (!call->name) return xstrdup("Tool error: missing tool name\n"); |
| 8037 | |
| 8038 | if (!strcmp(call->name, "read")) return agent_tool_read(w, call); |
no test coverage detected