feat(config): add allowed_tools/disallowed_tools support for claude backend

- Add AllowedTools/DisallowedTools fields to AgentModelConfig and Config
- Update ResolveAgentConfig to return new fields
- Pass --allowedTools/--disallowedTools to claude CLI in buildClaudeArgs
- Add fields to TaskSpec and propagate through executor
- Fix backend selection when taskSpec.Backend is specified but backend=nil

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
cexll
2026-02-03 16:11:25 +08:00
parent c0f61d5cc2
commit 04fa1626ae
9 changed files with 67 additions and 33 deletions

View File

@@ -96,7 +96,7 @@ func ParseParallelConfig(data []byte) (*ParallelConfig, error) {
if err := config.ValidateAgentName(task.Agent); err != nil {
return nil, fmt.Errorf("task block #%d invalid agent name: %w", taskIndex, err)
}
backend, model, promptFile, reasoning, _, _, _, err := config.ResolveAgentConfig(task.Agent)
backend, model, promptFile, reasoning, _, _, _, allowedTools, disallowedTools, err := config.ResolveAgentConfig(task.Agent)
if err != nil {
return nil, fmt.Errorf("task block #%d failed to resolve agent %q: %w", taskIndex, task.Agent, err)
}
@@ -110,6 +110,8 @@ func ParseParallelConfig(data []byte) (*ParallelConfig, error) {
task.ReasoningEffort = reasoning
}
task.PromptFile = promptFile
task.AllowedTools = allowedTools
task.DisallowedTools = disallowedTools
}
if task.ID == "" {