Add "Add to AI Catalog" button in Duo admin settings to seed GitLab-managed external agents

Follow-up to #586347 to implement the UI enhancement described in this comment and the design in this comment.

Summary

Add an instance-level Duo admin settings control that allows a self-managed or Dedicated instance admin to seed the GitLab-managed external agents (Claude Agent by GitLab and Codex Agent by GitLab) into the instance's AI Catalog by calling the new backend API endpoint that replicates the existing rake task behavior.

This is a light-weight, bridge solution for self-managed and Dedicated. GitLab.com is out of scope.

Goals

  • Provide a one-time, instance-level way for admins to add the GitLab-managed external agents to the AI Catalog without running a rake task.
  • Reuse the new API endpoint that seeds the agents, so that:
    • The endpoint can be called directly by an instance admin with appropriate API access.
    • The Duo admin settings UI calls the same endpoint on behalf of the admin.
  • Avoid long-term UX / architecture decisions about external agents; this is an interim solution.

In scope

  • Add a control to instance-level Duo admin settings (same area where foundational agents are managed) that:
    • Is visible to instance admins on self-managed and Dedicated.
    • Shows a button labeled "Add to AI Catalog" (per product/UX guidance).
    • When clicked, calls the new API endpoint that seeds the GitLab-managed external agents.
    • Handles at least these states:
      • Initial / default: button enabled when agents have not been added yet.
      • Loading: visual feedback while the API call is in progress.
      • Success: confirmation that the agents have been added.
      • Already added: button disabled or accompanied by text indicating that the agents already exist.
      • Error: meaningful error message if the API call fails.
  • Ensure UX aligns with the design provided by @abacon-gitlab in #586347, with the button copy updated to "Add to AI Catalog" as requested by @amandarueda in this comment.

Out of scope

  • Removing or deleting the seeded external agents from the instance.
  • Any broader redesign of Duo admin settings or long-term external agent management architecture.
  • GitLab.com support (this control is only for self-managed and Dedicated instances).

Functional requirements

  1. Eligibility & visibility

    • The control appears on the instance-level Duo admin settings page.
    • It is only available where the underlying seeding API is available (self-managed and Dedicated; not GitLab.com).
    • Only instance admins can use this control.
  2. Behavior when agents have not yet been added

    • The page shows the "Add to AI Catalog" button in an enabled state.
    • Clicking the button:
      • Triggers a call to the seeding API endpoint that replicates the rake task behavior from #586347.
      • Displays a loading state while the request is in progress.
      • On success:
        • Shows a success confirmation (per design).
        • Updates the UI so the button is no longer available to add the agents again (disabled or hidden, depending on UX guidance), and/or displays text indicating that the agents have already been added.
  3. Behavior when agents are already present

    • On page load, the UI should determine whether the GitLab-managed external agents have already been seeded.
    • If they already exist, the button should be disabled or replaced with explanatory messaging, e.g., "Claude and Codex agents have already been added to your AI Catalog."
    • Clicking the button when agents already exist should not attempt to reseed them; if an attempt is made, handle the API response gracefully and surface a clear, non-technical message.
  4. Error handling

    • If the API call fails for any reason (permissions, network, internal error):
      • Show an error state/message with a generic description and encourage retry if appropriate.
      • Do not leave the UI stuck in a loading state.

UX & design

  • Base implementation on the design shared by @abacon-gitlab in #586347 and the FigJam link in that comment.
  • Use the button label "Add to AI Catalog" (without "all") as requested in #586347.
  • Align visual treatment and messaging with existing Duo admin settings patterns (e.g., standard GitLab button styles, alerts/toasts as appropriate).
  • Full flow and all states in linked FigJam

Screenshot_2026-02-03_at_4.15.12_p.m.

Edited by 🤖 GitLab Bot 🤖