delete unused bug and fix review issue

This commit is contained in:
lxowalle 2026-03-04 18:38:48 +08:00
parent 5b9e319360
commit 6c9589869e
3 changed files with 10 additions and 12 deletions

View file

@ -365,9 +365,6 @@
"edit_file": { "edit_file": {
"enabled": true "enabled": true
}, },
"exec_tool": {
"enabled": true
},
"find_skills": { "find_skills": {
"enabled": true "enabled": true
}, },

View file

@ -105,7 +105,7 @@ func registerSharedTools(
} }
// Web tools // Web tools
if cfg.Tools.IsToolEnabled("web_search") { if cfg.Tools.IsToolEnabled("web") {
searchTool, err := tools.NewWebSearchTool(tools.WebSearchToolOptions{ searchTool, err := tools.NewWebSearchTool(tools.WebSearchToolOptions{
BraveAPIKey: cfg.Tools.Web.Brave.APIKey, BraveAPIKey: cfg.Tools.Web.Brave.APIKey,
BraveMaxResults: cfg.Tools.Web.Brave.MaxResults, BraveMaxResults: cfg.Tools.Web.Brave.MaxResults,
@ -181,9 +181,10 @@ func registerSharedTools(
} }
// Spawn tool with allowlist checker // Spawn tool with allowlist checker
if cfg.Tools.IsToolEnabled("spawn") { if cfg.Tools.IsToolEnabled("subagent") {
subagentManager := tools.NewSubagentManager(provider, agent.Model, agent.Workspace, msgBus) subagentManager := tools.NewSubagentManager(provider, agent.Model, agent.Workspace, msgBus)
subagentManager.SetLLMOptions(agent.MaxTokens, agent.Temperature) subagentManager.SetLLMOptions(agent.MaxTokens, agent.Temperature)
if cfg.Tools.IsToolEnabled("spawn") {
spawnTool := tools.NewSpawnTool(subagentManager) spawnTool := tools.NewSpawnTool(subagentManager)
currentAgentID := agentID currentAgentID := agentID
spawnTool.SetAllowlistChecker(func(targetAgentID string) bool { spawnTool.SetAllowlistChecker(func(targetAgentID string) bool {
@ -192,6 +193,7 @@ func registerSharedTools(
agent.Tools.Register(spawnTool) agent.Tools.Register(spawnTool)
} }
} }
}
} }
func (al *AgentLoop) Run(ctx context.Context) error { func (al *AgentLoop) Run(ctx context.Context) error {

View file

@ -610,7 +610,6 @@ type ToolsConfig struct {
MCP MCPConfig `json:"mcp"` MCP MCPConfig `json:"mcp"`
AppendFile ToolConfig `json:"append_file"` AppendFile ToolConfig `json:"append_file"`
EditFile ToolConfig `json:"edit_file"` EditFile ToolConfig `json:"edit_file"`
ExecTool ToolConfig `json:"exec_tool"`
FindSkills ToolConfig `json:"find_skills"` FindSkills ToolConfig `json:"find_skills"`
I2C ToolConfig `json:"i2c"` I2C ToolConfig `json:"i2c"`
InstallSkill ToolConfig `json:"install_skill"` InstallSkill ToolConfig `json:"install_skill"`