diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 404aee862..870e560e9 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -168,13 +168,15 @@ func registerSharedTools( } // Send file tool (outbound media via MediaStore — store injected later by SetMediaStore) - sendFileTool := tools.NewSendFileTool( - agent.Workspace, - cfg.Agents.Defaults.RestrictToWorkspace, - cfg.Agents.Defaults.GetMaxMediaSize(), - nil, - ) - agent.Tools.Register(sendFileTool) + if cfg.Tools.IsToolEnabled("send_file") { + sendFileTool := tools.NewSendFileTool( + agent.Workspace, + cfg.Agents.Defaults.RestrictToWorkspace, + cfg.Agents.Defaults.GetMaxMediaSize(), + nil, + ) + agent.Tools.Register(sendFileTool) + } // Skill discovery and installation tools find_skills_enable := cfg.Tools.IsToolEnabled("find_skills") diff --git a/pkg/config/config.go b/pkg/config/config.go index 0ee3acfe0..d6de5c738 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -619,6 +619,7 @@ type ToolsConfig struct { ListDir ToolConfig `json:"list_dir" envPrefix:"PICOCLAW_TOOLS_LIST_DIR_"` Message ToolConfig `json:"message" envPrefix:"PICOCLAW_TOOLS_MESSAGE_"` ReadFile ToolConfig `json:"read_file" envPrefix:"PICOCLAW_TOOLS_READ_FILE_"` + SendFile ToolConfig `json:"send_file" envPrefix:"PICOCLAW_TOOLS_SEND_FILE_"` Spawn ToolConfig `json:"spawn" envPrefix:"PICOCLAW_TOOLS_SPAWN_"` SPI ToolConfig `json:"spi" envPrefix:"PICOCLAW_TOOLS_SPI_"` Subagent ToolConfig `json:"subagent" envPrefix:"PICOCLAW_TOOLS_SUBAGENT_"` @@ -892,6 +893,8 @@ func (t *ToolsConfig) IsToolEnabled(name string) bool { return t.Subagent.Enabled case "web_fetch": return t.WebFetch.Enabled + case "send_file": + return t.SendFile.Enabled case "write_file": return t.WriteFile.Enabled case "mcp": diff --git a/pkg/config/defaults.go b/pkg/config/defaults.go index 488590e28..a236c5dde 100644 --- a/pkg/config/defaults.go +++ b/pkg/config/defaults.go @@ -398,6 +398,9 @@ func DefaultConfig() *Config { TTLSeconds: 300, }, }, + SendFile: ToolConfig{ + Enabled: true, + }, MCP: MCPConfig{ ToolConfig: ToolConfig{ Enabled: false,