Wire Gemini model pin, timeout, and FF push for feature search

What does this MR do and why?

Feature Discovery Search's Tier 3 (Gemini) call resolved model routing through Ai::ModelSelection::NamespaceFeatureSetting, but that model's feature enum didn't recognize feature_discovery_search yet, so resolution always raised ArgumentError. The completion base already rescues that error, so on SaaS the AI Gateway was silently never reached at all -- Tier 3 quietly no-opped in production.

This MR:

  • Registers feature_discovery_search in the model-selection FEATURES vocabulary so resolution succeeds. A blank offered_model_ref already defers to the Gemini default AI Gateway has configured for this unit primitive, so no explicit ref needs pinning in Rails. Visibility on the Model Selection settings page is gated behind the existing feature flag via FEATURES_UNDER_FLAGS, since the feature is still internal/experimental.
  • Adds a short (3s) AI Gateway timeout so a slow or unavailable Gemini degrades to the rules-only tiers instead of blocking the synchronous search request.
  • Pushes the feature flag state to AI Gateway per the AI feature playbook.
  • Exposes an ai_search_available signal on the search response so a future frontend change can distinguish "no AI results" from "AI search unavailable" without another backend round trip.

Note: this MR is stacked on !242696 (merged) (#603091) since that hasn't merged yet -- the diff here is only the commit on top of it.

References

How to set up and validate locally

Same setup as !242696 (merged) (enable feature_library_modal and feature_discovery_gemini_search, simulate SaaS, create a trial group), plus:

  • Confirm model-selection resolution no longer raises: in the Rails console, Ai::FeatureSettingSelectionService.new(user, 'feature_discovery_search', namespace).execute should return success with a NamespaceFeatureSetting payload instead of raising ArgumentError.
  • Confirm a slow/unreachable AI Gateway degrades to [] within ~3s instead of hanging.

Merge request reports

Loading
Loading