diff --git a/internal/config/load_test.go b/internal/config/load_test.go index e0ce94f3995fb64cc8f66348723a4e6c62a0ea2b..90276c96ad113f453ed699c8deeb30b4f5fef9d5 100644 --- a/internal/config/load_test.go +++ b/internal/config/load_test.go @@ -492,6 +492,29 @@ func TestConfig_setupAgentsWithDisabledTools(t *testing.T) { assert.Equal(t, []string{"glob", "ls", "sourcegraph", "view"}, taskAgent.AllowedTools) } +func TestConfig_setupAgentsWithEveryReadOnlyToolDisabled(t *testing.T) { + cfg := &Config{ + Options: &Options{ + DisabledTools: []string{ + "glob", + "grep", + "ls", + "sourcegraph", + "view", + }, + }, + } + + cfg.SetupAgents() + coderAgent, ok := cfg.Agents["coder"] + require.True(t, ok) + assert.Equal(t, []string{"bash", "download", "edit", "multiedit", "fetch", "write"}, coderAgent.AllowedTools) + + taskAgent, ok := cfg.Agents["task"] + require.True(t, ok) + assert.Equal(t, []string{}, taskAgent.AllowedTools) +} + func TestConfig_configureProvidersWithDisabledProvider(t *testing.T) { knownProviders := []catwalk.Provider{ {