feat: add orbit_settings user preference with killswitch and preferences UI

What does this MR do and why?

Adds orbit_settings JSONB to user_preferences as a per-user toggle for Orbit across all GitLab Duo workflows. When enabled: false (the default for all users), no workflow receives Orbit MCP config. When enabled: true, all workflows — including Agentic Chat, the Orbit agent, and other foundational agents — receive Orbit tools. JSON keys use snake_case following the ai_setting_feature_settings / duo_agent_platform_enabled precedent.

Implementation uses the existing /preferences form flow rather than a standalone Vue/Apollo settings app. The setting is rendered in the Behavior section as a standard form checkbox, submitted through the normal preferences update path, and persisted via UserPreference#orbit_default_enabled.

Components:

  • db/migrate/…_add_orbit_settings_to_user_preferences.rb — JSONB column, DEFAULT '{}'
  • app/validators/json_schemas/user_preference_orbit_settings.json — validates enabled boolean
  • UserPreference#orbit_enabled — empty hash defaults to false (opt-in semantics)
  • User#orbit_enabled delegation — lets the existing preferences form bind to the setting normally
  • EE::Profiles::PreferencesController — permits orbit_enabled through the standard preferences form flow
  • ee/app/views/profiles/preferences/_orbit_settings.html.haml — standard f.gitlab_ui_checkbox_component in the Behavior section
  • McpConfigService#orbit_enabled_for_flow? — skips the saved preference when flag off, applies it uniformly to all workflows when on
  • FoundationalChatAgentsResolver — hides the Orbit agent from the agent picker when the preference is off
  • UserPreferencesType + UserPreferencesUpdate — GraphQL schema support remains available for the preference

Database:

Column Type Default Null
orbit_settings jsonb '{}' NOT NULL

Empty {} = Orbit disabled. Existing users are unaffected.

Feature flag: orbit_user_preference (beta, default off)

Gates the per-user Orbit preference in McpConfigService, FoundationalChatAgentsResolver, and the preferences UI. Note: this MR also removes the (agentic_chat? || orbit_agent?) guard from the Orbit MCP client check, so the flag-off behavior is not a no-op:

Workflow orbit_user_preference off (default, also pre-MR baseline → after) orbit_user_preference on, preference off orbit_user_preference on, preference on
Agentic Chat Got Orbit tools → still gets Orbit tools No Orbit tools Gets Orbit tools
Orbit Agent Visible, got Orbit tools → still visible, gets Orbit tools Hidden from agent picker, no tools Visible, gets Orbit tools
Other foundational agents No Orbit tools → now gets Orbit tools (scope expansion) No Orbit tools Gets Orbit tools

Still gated by knowledge_graph and orbit_foundational_agent (platform availability).

References

Related to #598704 Context: gitlab-org#21075

Screenshots or screen recordings

Rendered in /preferences → Behavior section, after "Default GitLab Duo namespace":

Before After
(new setting) CleanShot_2026-05-04_at_15.53.04

How to set up and validate locally

  1. Enable the feature flag in rails console:
    Feature.enable(:orbit_user_preference)
  2. Visit /preferencesBehavior section
  3. Confirm "Orbit in GitLab Duo" appears after "Default GitLab Duo namespace" with a checkbox "Use Orbit in GitLab Duo"
  4. Verify the checkbox is unchecked by default (Orbit disabled for new users)
  5. Toggle the checkbox on and click Save changes
  6. Verify the preference persists on reload
  7. In rails console, confirm current_user.user_preference.orbit_settings reflects the change
  8. With the preference on: confirm Agentic Chat receives Orbit tools, the Orbit agent appears in the agent picker, and foundational workflows get Orbit tools
  9. With the preference off: confirm Agentic Chat does not receive Orbit tools, the Orbit agent is hidden from the agent picker, and foundational workflows do not get Orbit tools
  10. Disable the feature flag and confirm the setting no longer appears and McpConfigService ignores the preference (all workflows get Orbit tools as before)

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.

Edited by Dmitry Gruzd

Merge request reports

Loading