Allow AgenticChatModelMetadataService to use developer selectable models
What does this MR do and why?
This merge request (MR) updates AgenticChatModelMetadataService to use FeatureSetting.decorate instead of ModelDefinitionResponseParser when validating user-selected models. This MR is needed because the current implementation does not take into account developer selectable models introduced in !210909 (merged) when checking if a model is valid.
References
- Feature enabling developer selectable models: !210909 (merged)
- Parent issue: #581701
Screenshots or screen recordings
| Before | After |
|---|---|
|
|
How to set up and validate locally
The following steps require a working GitLab Development Kit (GDK) available locally:
-
Set up AI Gateway in your GDK. In addition, make sure to have this in your
env.runitfile:export FETCH_MODEL_SELECTION_DATA_FROM_LOCAL=1 -
Configure AI Gateway to return some developer-only models:
Edit
<gdk_dir>/gitlab-ai-gateway/ai_gateway/model_selection/unit_primitives.ymland add developer models forduo_agent_platform:- feature_setting: "duo_agent_platform" unit_primitives: - "duo_agent_platform" default_model: "claude_sonnet_4_20250514_vertex" selectable_models: - "claude_sonnet_3_7_20250219" - "claude_sonnet_4_20250514" - "claude_sonnet_4_20250514_vertex" dev: selectable_models: - "claude_haiku_4_5_20251001" # Dev-only model - "gpt_5_codex" # Dev-only model group_ids: - 1000000 # GitLab Duo group ID (or use your test group ID) -
Bypass the team member check:
Edit
ee/lib/gitlab/graphql/representation/model_selection/feature_setting.rb:def use_dev_overrides? return false unless Gitlab::Saas.feature_available?(:gitlab_com_subscriptions) return false unless true # current_user&.gitlab_team_member? # <-- Change this line -
Ensure you're on GitLab.com.
-
Check that developer-only models are accessible for Agentic Chat:
-
Go to GitLab Duo group (group ID: 1000000c): http://gdk.test:3000/gitlab-duo
-
Open GitLab Duo Chat and enable Agentic mode.
-
Verify developer-only models are accessible in the UI:
If this MR works as intended, you should see the developer models you listed in
unit_primitives.ymlalong with the regular models in the model selection dropdown menu:
-
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 #581701


