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
fix(providers): surface bedrock models error, make provider type list exhaustive, trim comments (refs #288, #328)
Sergey Kozyrenko86b1329c434f
diff --git a/backend/pkg/database/converter/converter.go b/backend/pkg/database/converter/converter.goindex bea920ab..4c1eecfc 100644--- a/backend/pkg/database/converter/converter.go+++ b/backend/pkg/database/converter/converter.go@@ -580,8 +580,8 @@ func ConvertModels(models pconfig.ModelsConfig) []*model.ModelConfig {return gmodels}-// convertModelReasoningMode maps a pconfig model reasoning capability to its GraphQL-// enum value (only adaptive-only differs in spelling: hyphen vs underscore).+// Bridges the one spelling difference between the pconfig and GraphQL reasoning+// enums: adaptive-only (hyphen) vs adaptive_only (underscore).func convertModelReasoningMode(m pconfig.ModelReasoningMode) model.ModelReasoningMode {switch m {case pconfig.ModelReasoningAdaptiveOnly:diff --git a/backend/pkg/graph/schema.resolvers.go b/backend/pkg/graph/schema.resolvers.goindex d8d1cc35..dbe1c3d2 100644--- a/backend/pkg/graph/schema.resolvers.go+++ b/backend/pkg/graph/schema.resolvers.go@@ -2077,6 +2077,9 @@ func (r *queryResolver) SettingsProviders(ctx context.Context) (*model.Providersconfig.Default.Bedrock = mpcfgif models, err := bedrock.DefaultModels(r.Config); err == nil {config.Models.Bedrock = converter.ConvertModels(models)+ } else {+ // A bad BEDROCK_MODELS_PATH otherwise yields an empty model list with no signal.+ r.Logger.WithError(err).Warn("failed to load bedrock models")}case provider.ProviderOllama:config.Default.Ollama = mpcfgdiff --git a/frontend/src/pages/settings/settings-provider.tsx b/frontend/src/pages/settings/settings-provider.tsxindex 3109af83..1971d125 100644--- a/frontend/src/pages/settings/settings-provider.tsx+++ b/frontend/src/pages/settings/settings-provider.tsx@@ -637,9 +637,8 @@ const reasoningEffortLabel: Record<ReasoningEffort, string> = {const defaultReasoningEfforts: ReasoningEffort[] = [ReasoningEffort.Low, ReasoningEffort.Medium, ReasoningEffort.High];-// ReasoningFields renders the per-agent reasoning controls, gated by the selected-// model's declared capability (models.yml) instead of a model-name allowlist:-// adaptive-only models lock to adaptive, and the effort options follow the model.+// Gated by the selected model's declared capability (models.yml), not a model-name+// allowlist: adaptive-only models lock to adaptive, and effort options follow the model.function ReasoningFields({agentKey,control,diff --git a/frontend/src/pages/settings/settings-providers.tsx b/frontend/src/pages/settings/settings-providers.tsxindex 4fd3fa5f..a666ad9a 100644--- a/frontend/src/pages/settings/settings-providers.tsx+++ b/frontend/src/pages/settings/settings-providers.tsx@@ -52,19 +52,26 @@ const providerIcons: Record<ProviderType, React.ComponentType<React.SVGProps<SVG[ProviderType.Qwen]: Qwen,};-const providerTypes = [- { label: 'Anthropic', type: ProviderType.Anthropic },- { label: 'Bedrock', type: ProviderType.Bedrock },- { label: 'Custom', type: ProviderType.Custom },- { label: 'DeepSeek', type: ProviderType.Deepseek },- { label: 'Gemini', type: ProviderType.Gemini },- { label: 'GLM', type: ProviderType.Glm },- { label: 'Kimi', type: ProviderType.Kimi },- { label: 'MiniMax', type: ProviderType.Minimax },- { label: 'Ollama', type: ProviderType.Ollama },- { label: 'OpenAI', type: ProviderType.Openai },- { label: 'Qwen', type: ProviderType.Qwen },-];+// Exhaustive Record so a newly-added ProviderType is a compile error here, not a+// provider silently missing from the create-provider menu.+const providerLabels: Record<ProviderType, string> = {+ [ProviderType.Anthropic]: 'Anthropic',+ [ProviderType.Bedrock]: 'Bedrock',+ [ProviderType.Custom]: 'Custom',+ [ProviderType.Deepseek]: 'DeepSeek',+ [ProviderType.Gemini]: 'Gemini',+ [ProviderType.Glm]: 'GLM',+ [ProviderType.Kimi]: 'Kimi',+ [ProviderType.Minimax]: 'MiniMax',+ [ProviderType.Ollama]: 'Ollama',+ [ProviderType.Openai]: 'OpenAI',+ [ProviderType.Qwen]: 'Qwen',+};++const providerTypes = (Object.keys(providerLabels) as ProviderType[]).map((type) => ({+ label: providerLabels[type],+ type,+}));function SettingsProviders() {const { data, error, loading: isLoading } = useQuery(SettingsProvidersDocument);