Loading
Add Gemini Tier 3 feature search caller and funnel wiring
What does this MR do and why?
Adds the Rails side that sends a no-match feature-library query plus a feature catalogue to the AI Gateway (Gemini) and returns ordered feature IDs.
The caller subclasses the AI Gateway completion base and overrides execute to return IDs synchronously, so it fits the synchronous search request. Access is restricted to trial namespaces, the catalogue is built server-side from Sidebars::MenuItem so there is no duplicate feature list to maintain. The whole path is behind the default-off feature_discovery_gemini_search flag.
References
How to set up and validate locally
- In the Rails console enable the feature flag:
Feature.enable(:feature_library_modal)
Feature.enable(:feature_discovery_gemini_search)- Simulate a SaaS instance and restart GDK.
- Sign in. Create group.
- In the Rails console make it trial:
Group.find_by(id: <Group ID>).gitlab_subscription.update(trial: true, trial_starts_on: 20.days.ago, trial_ends_on: 10.days.from_now)- Visit
/-/onboarding/feature_library/search?query=custom_query&panel=group&resource_id=<Group ID>. - In
log/llm.logverify there is a Gateway request withcustom_queryand features array:
{
"severity": "INFO",
"time": "2026-07-02T12:37:17.256Z",
...
"meta.user": "root",
"meta.gl_user_id": 1,
"meta.client_id": "user/1",
"url": "https://cloud.staging.gitlab.com/ai/v2/prompts/feature_discovery_search",
"body":
{
"inputs":
{
"query": "custom_query",
"features":
[
{
"id": "activity",
"name": "Activity",
"description": "Track what your team is working on and stay informed of changes"
},
{
"id": "members",
"name": "Members",
"description": "Control who has access to your group and what they can do"
},
...
}MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #603091
Edited by Serhii Yarynovskyi
