Skip to content

Commit 24f5df0

Browse files
chore: remove dead functions — 1 function removed (#34674)
1 parent 4ff6e06 commit 24f5df0

2 files changed

Lines changed: 0 additions & 107 deletions

File tree

pkg/workflow/claude_engine_tools_test.go

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -547,84 +547,6 @@ func TestClaudeEngineAddsTmpByDefault(t *testing.T) {
547547
}
548548
}
549549

550-
func TestHasBashWildcardInTools(t *testing.T) {
551-
tests := []struct {
552-
name string
553-
tools map[string]any
554-
expected bool
555-
}{
556-
{
557-
name: "nil tools",
558-
tools: nil,
559-
expected: false,
560-
},
561-
{
562-
name: "empty tools (no bash key)",
563-
tools: map[string]any{},
564-
expected: false,
565-
},
566-
{
567-
name: "bash with specific commands only",
568-
tools: map[string]any{
569-
"bash": []any{"git", "echo"},
570-
},
571-
expected: false,
572-
},
573-
{
574-
name: "bash with wildcard *",
575-
tools: map[string]any{
576-
"bash": []any{"*"},
577-
},
578-
expected: true,
579-
},
580-
{
581-
name: "bash with colon-wildcard :*",
582-
tools: map[string]any{
583-
"bash": []any{":*"},
584-
},
585-
expected: true,
586-
},
587-
{
588-
name: "bash with wildcard mixed with other commands",
589-
tools: map[string]any{
590-
"bash": []any{"git", "*", "echo"},
591-
},
592-
expected: true,
593-
},
594-
{
595-
name: "bash with nil value (non-list — unrestricted)",
596-
tools: map[string]any{
597-
"bash": nil,
598-
},
599-
expected: true,
600-
},
601-
{
602-
name: "bash with true value (non-list — unrestricted)",
603-
tools: map[string]any{
604-
"bash": true,
605-
},
606-
expected: true,
607-
},
608-
{
609-
name: "no bash key at all",
610-
tools: map[string]any{
611-
"edit": nil,
612-
"github": map[string]any{},
613-
},
614-
expected: false,
615-
},
616-
}
617-
618-
for _, tt := range tests {
619-
t.Run(tt.name, func(t *testing.T) {
620-
result := hasBashWildcardInTools(tt.tools)
621-
if result != tt.expected {
622-
t.Errorf("hasBashWildcardInTools(%v): expected %v, got %v", tt.tools, tt.expected, result)
623-
}
624-
})
625-
}
626-
}
627-
628550
func TestGenerateAllowedToolsComment(t *testing.T) {
629551
engine := NewClaudeEngine()
630552

pkg/workflow/claude_tools.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,6 @@ var claudeToolsLog = logger.New("workflow:claude_tools")
1515

1616
const defaultClaudeTmpWritePath = "/tmp"
1717

18-
// hasBashWildcardInTools returns true when the neutral tools map grants unrestricted
19-
// bash access — either because bash is not a list (e.g. bash: true) or because the
20-
// list contains a "*" or ":*" wildcard entry.
21-
//
22-
// When bash is unrestricted the agent can already reach any tool via the shell, so
23-
// --permission-mode bypassPermissions is safe and produces a smoother headless
24-
// experience than acceptEdits (which can stall on some non-file-edit permission
25-
// requests that do not match the acceptEdits auto-approval pattern).
26-
func hasBashWildcardInTools(tools map[string]any) bool {
27-
if tools == nil {
28-
return false
29-
}
30-
bashVal, hasBash := tools["bash"]
31-
if !hasBash {
32-
return false
33-
}
34-
// bash: true (non-list value) means unrestricted bash
35-
bashCommands, ok := bashVal.([]any)
36-
if !ok {
37-
return true
38-
}
39-
for _, cmd := range bashCommands {
40-
if cmdStr, ok := cmd.(string); ok && (cmdStr == "*" || cmdStr == ":*") {
41-
return true
42-
}
43-
}
44-
return false
45-
}
46-
4718
// expandNeutralToolsToClaudeTools converts neutral tool names to Claude-specific tool configurations
4819
func (e *ClaudeEngine) expandNeutralToolsToClaudeTools(tools map[string]any) map[string]any {
4920
claudeToolsLog.Printf("Starting neutral tools expansion: input_tools=%d", len(tools))

0 commit comments

Comments
 (0)