chore: remove deprecated GetAvailableModels and ModelInfo

- Remove deprecated config.ModelInfo type (use providers.ModelInfo)
- Remove deprecated GetAvailableModels function (always returned nil)
- Remove associated test
- Update AISettingsResponse to use providers.ModelInfo
This commit is contained in:
rcourtman
2026-01-24 23:00:16 +00:00
parent 0e602518c8
commit de2cb7a29b
3 changed files with 7 additions and 30 deletions
+7 -7
View File
@@ -789,13 +789,13 @@ type AISettingsResponse struct {
AuthMethod string `json:"auth_method"` // "api_key" or "oauth"
OAuthConnected bool `json:"oauth_connected"` // true if OAuth tokens are configured
// Patrol settings for token efficiency
PatrolSchedulePreset string `json:"patrol_schedule_preset"` // DEPRECATED: legacy preset
PatrolIntervalMinutes int `json:"patrol_interval_minutes"` // Patrol interval in minutes (0 = disabled)
PatrolEnabled bool `json:"patrol_enabled"` // true if patrol is enabled
PatrolAutoFix bool `json:"patrol_auto_fix"` // true if patrol can auto-fix issues
AlertTriggeredAnalysis bool `json:"alert_triggered_analysis"` // true if AI analyzes when alerts fire
UseProactiveThresholds bool `json:"use_proactive_thresholds"` // true if patrol warns before thresholds (false = use exact thresholds)
AvailableModels []config.ModelInfo `json:"available_models"` // List of models for current provider
PatrolSchedulePreset string `json:"patrol_schedule_preset"` // DEPRECATED: legacy preset
PatrolIntervalMinutes int `json:"patrol_interval_minutes"` // Patrol interval in minutes (0 = disabled)
PatrolEnabled bool `json:"patrol_enabled"` // true if patrol is enabled
PatrolAutoFix bool `json:"patrol_auto_fix"` // true if patrol can auto-fix issues
AlertTriggeredAnalysis bool `json:"alert_triggered_analysis"` // true if AI analyzes when alerts fire
UseProactiveThresholds bool `json:"use_proactive_thresholds"` // true if patrol warns before thresholds (false = use exact thresholds)
AvailableModels []providers.ModelInfo `json:"available_models"` // List of models for current provider
// Multi-provider credentials - shows which providers are configured
AnthropicConfigured bool `json:"anthropic_configured"` // true if Anthropic API key or OAuth is set
OpenAIConfigured bool `json:"openai_configured"` // true if OpenAI API key is set
-15
View File
@@ -124,21 +124,6 @@ const (
DefaultGeminiBaseURL = "https://generativelanguage.googleapis.com/v1beta"
)
// ModelInfo represents information about an available model
// Deprecated: Use providers.ModelInfo instead - models are now fetched dynamically from APIs
type ModelInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
}
// GetAvailableModels is deprecated - models are now fetched dynamically from provider APIs
// This returns nil; use the /api/ai/models endpoint instead which queries the actual API
func GetAvailableModels(provider string) []ModelInfo {
return nil
}
// NewDefaultAIConfig returns an AIConfig with sensible defaults
func NewDefaultAIConfig() *AIConfig {
return &AIConfig{
-8
View File
@@ -837,14 +837,6 @@ func TestAIConfig_IsAlertTriggeredAnalysisEnabled(t *testing.T) {
})
}
func TestGetAvailableModels(t *testing.T) {
// This function is deprecated and should return nil
result := GetAvailableModels(AIProviderAnthropic)
if result != nil {
t.Error("GetAvailableModels should return nil (deprecated)")
}
}
func TestNewDefaultAIConfig(t *testing.T) {
config := NewDefaultAIConfig()