Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
fixup! fix(providers): don't crash startup when a disabled provider's external config is unreadable
Sergey Kozyrenkoac32a8e9966a
diff --git a/backend/pkg/providers/build_configs_test.go b/backend/pkg/providers/build_configs_test.goindex 51226dd8..fcd6ac19 100644--- a/backend/pkg/providers/build_configs_test.go+++ b/backend/pkg/providers/build_configs_test.go@@ -11,12 +11,8 @@ import ("github.com/stretchr/testify/require")-// A disabled provider pointed at an unreadable external config must not abort-// startup. Only enabled providers gate construction on their config loading.func TestBuildDefaultConfigs_DisabledProviderBadPathIsNotFatal(t *testing.T) {cfg := &config.Config{- // External Bedrock config path that doesn't exist; no Bedrock auth set,- // so the provider is disabled.BedrockConfig: filepath.Join(t.TempDir(), "missing.yml"),}@@ -29,8 +25,6 @@ func TestBuildDefaultConfigs_DisabledProviderBadPathIsNotFatal(t *testing.T) {assert.True(t, hasOpenAI, "providers with a readable (embedded) default config still load")}-// An enabled provider pointed at an unreadable external config must still fail-// loudly — the operator explicitly configured a file that can't be read.func TestBuildDefaultConfigs_EnabledProviderBadPathIsFatal(t *testing.T) {cfg := &config.Config{BedrockConfig: filepath.Join(t.TempDir(), "missing.yml"),diff --git a/backend/pkg/providers/providers.go b/backend/pkg/providers/providers.goindex 546fc6a2..a25d0e43 100644--- a/backend/pkg/providers/providers.go+++ b/backend/pkg/providers/providers.go@@ -153,9 +153,7 @@ func buildDefaultConfigs(cfg *config.Config) (provider.ProvidersConfig, error) {for _, e := range providerRegistry {config, err := e.NewConfig(cfg)if err != nil {- // A disabled provider pointed at an unreadable external config path- // must not abort startup — fail loudly only for providers the- // operator actually enabled.+ // A returned error here aborts startup; tolerate it for disabled providers.if !e.Enabled(cfg) {logrus.WithError(err).Warnf("skipping config for disabled %s provider", e.Type)continue