Skip to content

Ensure graceful fallback behavior when no provider is configured #30

@jeffpaul

Description

@jeffpaul

Description

Establish a consistent and user-friendly fallback experience for all AI Experiments plugin features when no AI provider is detected or configured. This will ensure users can explore the plugin safely without encountering errors or confusing states, and will provide clear guidance on what to do next.

Goals

  • Implement a centralized fallback handler (for example, AI_Fallback_Manager) that determines when no provider is available and returns standard responses to feature modules.
  • Ensure the admin UI clearly communicates the missing provider state with actionable guidance (for example, “No AI provider is currently connected. Configure one in Settings > AI Experiments.”).
  • Each feature module should gracefully degrade by disabling related UI controls or showing contextual messages instead of error notices.
  • Integrate with pre-configured provider detection so fallback only triggers when no available providers exist.
  • Document fallback expectations for both developers (API responses, error objects) and users (UI messaging).

Design Considerations

  • Maintain alignment with the “progressive provider selection” model. Fallbacks should feel intentional, not like an error condition.
  • Use a shared interface so features can easily check availability (AI_Connection_Manager::is_provider_available() or similar).
  • Avoid repeated user prompts. The plugin should surface provider configuration only in the appropriate settings location.

Acceptance Criteria

  • If no provider is configured, all features display consistent and non-blocking messaging.
  • No PHP or JavaScript errors occur when invoking AI functionality without a provider.
  • A test helper or mock provider exists to validate fallback behavior.
  • Developer and user documentation clearly outline the fallback behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions