Make workspace agents generally available

What does this MR do and why?

Workspace agents become generally available and no longer need beta and experimental features turned on. The dap_workspace_agents feature flag stays as the kill switch.

Why: this is the first step to make workspace agents available without the beta setting, tracked in gitlab-org/modelops/applied-ml/code-suggestions/ai-assist#3639 (closed). Without the setting, every flow that runs in CI reads .agents/agents from Gitaly: one tree read for a project without agents, plus one batch blob read for a project with agents. This stops in 19.7, when the Duo Workflow Service pulls the agents only for flows that need them instead of Rails pushing them to every flow: gitlab-org/modelops/applied-ml/code-suggestions#103.

What changes

  • API::Helpers::DuoWorkflowHelpers#push_feature_flags sends dap_workspace_agents to the AI Gateway with push_feature_flag, like the other flags, instead of also checking duo_beta_flows_enabled?. The Duo Workflow Service still uses workspace agents only when the request carries the flag, so the flag keeps working as the kill switch for both GitLab Duo CLI and CI sessions.
  • Ai::DuoWorkflows::StartWorkflowService#workspace_agents_json reads the repository when the flag is on, without checking the setting.
  • The docs mark workspace subagents as generally available:
    • The workspace subagents page no longer lists the setting as a prerequisite or as a troubleshooting step. It drops Status: Experiment and adds a history entry.
    • The GitLab Duo Agent Platform page moves workspace subagents to the generally available features table.
    • The Developer Flow page no longer calls the feature an experiment.

The AI Gateway does not change. GitLab versions without this MR keep requiring the setting.

References

Screenshots or screen recordings

None. This MR doesn't change the UI.

How to set up and validate locally

  1. Turn off beta and experimental features in the Rails console:

    ApplicationSetting.current.update!(instance_level_ai_beta_features_enabled: false)
  2. In a project that meets the Developer Flow prerequisites, add .agents/agents/reviewer.md to the default branch:

    ---
    name: reviewer
    description: Reviews code changes and reports a short list of findings.
    tools: read_file, grep
    ---
    
    You review the code changes you are given. Report each problem with its file and line. Do not change any file.
  3. Start a Developer Flow session in GitLab and ask it to delegate a review to the reviewer subagent. The session shows Delegated to subagent. On master, with the setting off, the session has no subagents.

  4. Check what the reader returns in the Rails console:

    project = Project.find_by_full_path('<group>/<project>')
    Gitlab::DuoWorkflow::WorkspaceAgentsReader.new(project).agents.map { |agent| agent['name'] }
    # => ["reviewer"]
  5. Turn off the flag with Feature.disable(:dap_workspace_agents), and start a new session. The session has no subagents.

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.

🤖 Generated with Claude Code

Edited by Alexander Chueshev

Merge request reports

Loading
Loading