From 9bdcdeef02ba3fe3b2788fb20bfca05947b2ffa4 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Mon, 8 Dec 2025 15:21:12 +0000 Subject: [PATCH] fix: reflect actual configured list of banned tools in tool description --- crush.json | 40 ------------------------------------ internal/agent/tools/bash.go | 7 ++++--- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 crush.json diff --git a/crush.json b/crush.json deleted file mode 100644 index 5f2ed2f0295b558a998c805524d632650b30f585..0000000000000000000000000000000000000000 --- a/crush.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "https://charm.land/crush.json", - "lsp": { - "gopls": { - "options": { - "gofumpt": true, - "codelenses": { - "gc_details": true, - "generate": true, - "run_govulncheck": true, - "test": true, - "tidy": true, - "upgrade_dependency": true - }, - "hints": { - "assignVariableTypes": true, - "compositeLiteralFields": true, - "compositeLiteralTypes": true, - "constantValues": true, - "functionTypeParameters": true, - "parameterNames": true, - "rangeVariableTypes": true - }, - "analyses": { - "nilness": true, - "unusedparams": true, - "unusedvariable": true, - "unusedwrite": true, - "useany": true - }, - "staticcheck": true, - "directoryFilters": [ - "-.git", - "-node_modules" - ], - "semanticTokens": true - } - } - } -} diff --git a/internal/agent/tools/bash.go b/internal/agent/tools/bash.go index 9f9acc54e257878f266c104f185feeef74e34c97..716ba24f750457329bef63bd785f5eac6813d1da 100644 --- a/internal/agent/tools/bash.go +++ b/internal/agent/tools/bash.go @@ -139,8 +139,9 @@ var defaultBannedCommands = []string{ "ufw", } -func bashDescription(attribution *config.Attribution, modelName string) string { - bannedCommandsStr := strings.Join(defaultBannedCommands, ", ") +func bashDescription(attribution *config.Attribution, modelName string, bashConfig config.ToolBash) string { + bannedCommandsList := resolveBannedCommandsList(bashConfig) + bannedCommandsStr := strings.Join(bannedCommandsList, ", ") var out bytes.Buffer if err := bashDescriptionTpl.Execute(&out, bashDescriptionData{ BannedCommands: bannedCommandsStr, @@ -219,7 +220,7 @@ func NewBashTool( ) fantasy.AgentTool { return fantasy.NewAgentTool( BashToolName, - string(bashDescription(attribution, modelName)), + string(bashDescription(attribution, modelName, bashConfig)), func(ctx context.Context, params BashParams, call fantasy.ToolCall) (fantasy.ToolResponse, error) { if params.Command == "" { return fantasy.NewTextErrorResponse("missing command"), nil