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— validatesenabledbooleanUserPreference#orbit_enabled— empty hash defaults tofalse(opt-in semantics)User#orbit_enableddelegation — lets the existing preferences form bind to the setting normallyEE::Profiles::PreferencesController— permitsorbit_enabledthrough the standard preferences form flowee/app/views/profiles/preferences/_orbit_settings.html.haml— standardf.gitlab_ui_checkbox_componentin the Behavior sectionMcpConfigService#orbit_enabled_for_flow?— skips the saved preference when flag off, applies it uniformly to all workflows when onFoundationalChatAgentsResolver— hides the Orbit agent from the agent picker when the preference is offUserPreferencesType+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) | ![]() |
How to set up and validate locally
- Enable the feature flag in rails console:
Feature.enable(:orbit_user_preference) - Visit
/preferences→ Behavior section - Confirm "Orbit in GitLab Duo" appears after "Default GitLab Duo namespace" with a checkbox "Use Orbit in GitLab Duo"
- Verify the checkbox is unchecked by default (Orbit disabled for new users)
- Toggle the checkbox on and click Save changes
- Verify the preference persists on reload
- In rails console, confirm
current_user.user_preference.orbit_settingsreflects the change - With the preference on: confirm Agentic Chat receives Orbit tools, the Orbit agent appears in the agent picker, and foundational workflows get Orbit tools
- 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
- Disable the feature flag and confirm the setting no longer appears and
McpConfigServiceignores 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.
