From 24467a93245ee68b3f5351b46ae234496bedd697 Mon Sep 17 00:00:00 2001 From: Manoj M J Date: Wed, 15 Oct 2025 14:21:18 +0200 Subject: [PATCH 1/3] Enable DAP as an option for model switching in self-managed instances Changelog: added --- .../configure_duo_features.md | 1 + doc/user/duo_agent_platform/_index.md | 1 + .../flows/software_development.md | 1 + doc/user/gitlab_duo_chat/agentic_chat.md | 1 + ee/app/policies/ee/global_policy.rb | 12 ----- .../self_hosted_agent_platform.yml | 2 +- ee/spec/policies/global_policy_spec.rb | 50 ------------------- 7 files changed, 5 insertions(+), 63 deletions(-) diff --git a/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md b/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md index 4d80e1735e90b2..865598de0dbea1 100644 --- a/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md +++ b/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md @@ -63,6 +63,7 @@ If your AI gateway URL points to a local network or private IP address (for exam {{< history >}} - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. +- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. {{< /history >}} diff --git a/doc/user/duo_agent_platform/_index.md b/doc/user/duo_agent_platform/_index.md index 8f780f58d77cea..a72e2befbfcb96 100644 --- a/doc/user/duo_agent_platform/_index.md +++ b/doc/user/duo_agent_platform/_index.md @@ -25,6 +25,7 @@ title: GitLab Duo Agent Platform - Introduced as [a beta](../../policy/development_stages_support.md) in GitLab 18.2. - For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../../administration/feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. +- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. {{< /history >}} diff --git a/doc/user/duo_agent_platform/flows/software_development.md b/doc/user/duo_agent_platform/flows/software_development.md index 00ca699bdac14e..e834b242fccb55 100644 --- a/doc/user/duo_agent_platform/flows/software_development.md +++ b/doc/user/duo_agent_platform/flows/software_development.md @@ -26,6 +26,7 @@ title: Software Development Flow - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/14153) in GitLab 17.4 [with a flag](../../../administration/feature_flags/_index.md) named `duo_workflow`. Enabled for GitLab team members only. This feature is a [private beta](../../../policy/development_stages_support.md). - [Changed name](https://gitlab.com/gitlab-org/gitlab/-/issues/551382), `duo_workflow` [flag enabled](../../../administration/feature_flags/_index.md), and status changed to beta in GitLab 18.2. - For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../../policy/development_stages_support.md#experiment) with a [feature flag](../../../administration/feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. +- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. {{< /history >}} diff --git a/doc/user/gitlab_duo_chat/agentic_chat.md b/doc/user/gitlab_duo_chat/agentic_chat.md index 45a30390d27dae..0976a84c4e38bd 100644 --- a/doc/user/gitlab_duo_chat/agentic_chat.md +++ b/doc/user/gitlab_duo_chat/agentic_chat.md @@ -33,6 +33,7 @@ title: GitLab Duo Chat (Agentic) - [Added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/201721) to GitLab Duo Core in GitLab 18.3. - Feature flags `duo_workflow_workhorse` and `duo_workflow_web_chat_mutation_tools` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/198487) in GitLab 18.4. - For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../../administration/feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. +- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. {{< /history >}} diff --git a/ee/app/policies/ee/global_policy.rb b/ee/app/policies/ee/global_policy.rb index 0f384bd682754a..a1e982e9e51808 100644 --- a/ee/app/policies/ee/global_policy.rb +++ b/ee/app/policies/ee/global_policy.rb @@ -81,18 +81,6 @@ module GlobalPolicy ::Feature.enabled?(:duo_agentic_chat, @user) end - condition(:instance_with_self_hosted_duo) do - ::Ai::Setting.self_hosted? - end - - condition(:agentic_chat_on_self_hosted_duo_not_configured_via_feature_setting) do - Ai::FeatureSetting.duo_agent_platform.self_hosted.empty? - end - - condition(:agentic_chat_on_self_hosted_duo_feature_flag_disabled) do - ::Feature.disabled?(:self_hosted_agent_platform, :instance) - end - condition(:user_belongs_to_paid_namespace) do next false unless @user diff --git a/ee/config/feature_flags/development/self_hosted_agent_platform.yml b/ee/config/feature_flags/development/self_hosted_agent_platform.yml index 86a70557b92479..5c083abcc055e7 100644 --- a/ee/config/feature_flags/development/self_hosted_agent_platform.yml +++ b/ee/config/feature_flags/development/self_hosted_agent_platform.yml @@ -6,4 +6,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/556185 milestone: '18.3' group: group::custom models type: development -default_enabled: false +default_enabled: true diff --git a/ee/spec/policies/global_policy_spec.rb b/ee/spec/policies/global_policy_spec.rb index 573cdade93c013..e39a15c026172a 100644 --- a/ee/spec/policies/global_policy_spec.rb +++ b/ee/spec/policies/global_policy_spec.rb @@ -701,56 +701,6 @@ it { is_expected.to duo_agentic_chat_enabled_for_user } end end - - context 'when the instance can use Duo with self-hosted models' do - where(:instance_with_self_hosted_duo, - :agentic_duo_chat_feature_flag_disabled_on_the_instance, - :duo_agentic_chat_is_available_otherwise, - :duo_agent_platform_feature_setting_set_to_self_hosted, - :policy_result) do - true | true | true | true | be_allowed(policy) - true | true | true | false | be_allowed(policy) - true | true | false | true | be_disallowed(policy) - true | true | false | false | be_disallowed(policy) - true | false | true | true | be_allowed(policy) - true | false | true | false | be_allowed(policy) - true | false | false | true | be_disallowed(policy) - true | false | false | false | be_disallowed(policy) - false | true | true | true | be_allowed(policy) - false | true | true | false | be_allowed(policy) - false | true | false | true | be_disallowed(policy) - false | true | false | false | be_disallowed(policy) - false | false | true | true | be_allowed(policy) - false | false | true | false | be_allowed(policy) - false | false | false | true | be_disallowed(policy) - false | false | false | false | be_disallowed(policy) - end - - with_them do - before do - allow(::Ai::Setting).to receive(:self_hosted?).and_return(instance_with_self_hosted_duo) - stub_feature_flags( - self_hosted_agent_platform: !agentic_duo_chat_feature_flag_disabled_on_the_instance - ) - # setup agentic chat to be available otherwise - stub_feature_flags(duo_agentic_chat: duo_agentic_chat_is_available_otherwise) - allow(current_user).to receive(:allowed_to_use?) - .with(:duo_chat) - .and_return(duo_agentic_chat_is_available_otherwise) - - if duo_agent_platform_feature_setting_set_to_self_hosted - create(:ai_feature_setting, - :duo_agent_platform, - self_hosted_model: create(:ai_self_hosted_model, - model: :claude_3 - ) - ) - end - end - - it { is_expected.to policy_result } - end - end end describe 'access_x_ray_on_instance' do -- GitLab From 8585ae3166db066c2856259eadbcdd6e32f080a6 Mon Sep 17 00:00:00 2001 From: Manoj M J Date: Tue, 21 Oct 2025 12:08:41 +0200 Subject: [PATCH 2/3] Apply 5 suggestion(s) to 4 file(s) Co-authored-by: Fiona Neill --- .../gitlab_duo_self_hosted/configure_duo_features.md | 7 +------ doc/user/duo_agent_platform/_index.md | 2 +- doc/user/duo_agent_platform/flows/software_development.md | 2 +- doc/user/gitlab_duo_chat/agentic_chat.md | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md b/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md index 865598de0dbea1..90014436c1dc1c 100644 --- a/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md +++ b/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md @@ -54,16 +54,11 @@ If your AI gateway URL points to a local network or private IP address (for exam ## Configure access to the GitLab Duo Agent Platform -{{< details >}} - -- Status: Experiment - -{{< /details >}} {{< history >}} - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. -- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. +- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6. {{< /history >}} diff --git a/doc/user/duo_agent_platform/_index.md b/doc/user/duo_agent_platform/_index.md index a72e2befbfcb96..627515068eb538 100644 --- a/doc/user/duo_agent_platform/_index.md +++ b/doc/user/duo_agent_platform/_index.md @@ -25,7 +25,7 @@ title: GitLab Duo Agent Platform - Introduced as [a beta](../../policy/development_stages_support.md) in GitLab 18.2. - For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../../administration/feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. -- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. +- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6. {{< /history >}} diff --git a/doc/user/duo_agent_platform/flows/software_development.md b/doc/user/duo_agent_platform/flows/software_development.md index e834b242fccb55..e221e3bcacd481 100644 --- a/doc/user/duo_agent_platform/flows/software_development.md +++ b/doc/user/duo_agent_platform/flows/software_development.md @@ -26,7 +26,7 @@ title: Software Development Flow - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/14153) in GitLab 17.4 [with a flag](../../../administration/feature_flags/_index.md) named `duo_workflow`. Enabled for GitLab team members only. This feature is a [private beta](../../../policy/development_stages_support.md). - [Changed name](https://gitlab.com/gitlab-org/gitlab/-/issues/551382), `duo_workflow` [flag enabled](../../../administration/feature_flags/_index.md), and status changed to beta in GitLab 18.2. - For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../../policy/development_stages_support.md#experiment) with a [feature flag](../../../administration/feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. -- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. +- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6. {{< /history >}} diff --git a/doc/user/gitlab_duo_chat/agentic_chat.md b/doc/user/gitlab_duo_chat/agentic_chat.md index 0976a84c4e38bd..6a1c1ed8131499 100644 --- a/doc/user/gitlab_duo_chat/agentic_chat.md +++ b/doc/user/gitlab_duo_chat/agentic_chat.md @@ -33,7 +33,7 @@ title: GitLab Duo Chat (Agentic) - [Added](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/201721) to GitLab Duo Core in GitLab 18.3. - Feature flags `duo_workflow_workhorse` and `duo_workflow_web_chat_mutation_tools` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/198487) in GitLab 18.4. - For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../../administration/feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. -- For GitLab Duo Agent Platform on self-managed instances (both with [self-hosted models](../../administration/gitlab_duo_self_hosted/_index.md) and cloud-connected GitLab models), [enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6 by default. +- [Enabled](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/208951) in GitLab 18.6. {{< /history >}} -- GitLab From f174f34702b3657219d756d25b43061eec83ec4d Mon Sep 17 00:00:00 2001 From: Manoj M J Date: Wed, 22 Oct 2025 09:17:34 +0200 Subject: [PATCH 3/3] Edit configure_duo_features.md --- .../gitlab_duo_self_hosted/configure_duo_features.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md b/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md index 90014436c1dc1c..0c9698a0c9f1d3 100644 --- a/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md +++ b/doc/administration/gitlab_duo_self_hosted/configure_duo_features.md @@ -54,7 +54,6 @@ If your AI gateway URL points to a local network or private IP address (for exam ## Configure access to the GitLab Duo Agent Platform - {{< history >}} - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/19213) in GitLab 18.4, as an [experiment](../../policy/development_stages_support.md#experiment) with a [feature flag](../feature_flags/_index.md) named `self_hosted_agent_platform`. Disabled by default. -- GitLab