Expose visibility field on foundational chat agent GraphQL type

What does this MR do and why?

The aiFoundationalChatAgent and aiFoundationalChatAgents GraphQL queries return the AiFoundationalChatAgent type, which had no visibility field, while regular catalog items (AiCatalogItem) do have one. The AI Catalog frontend reads visibility for every item, so for foundational agents it got nothing, threw a console error, and had to hard-code a PUBLIC fallback. This was raised in this discussion: !250374 (comment 3702699143). This MR exposes visibility on the AiFoundationalChatAgent GraphQL type, reusing the existing AiCatalogItemVisibility enum, so the frontend no longer needs to special-case foundational agents.

References

closes #617777 (closed)

How to set up and validate locally

Validation steps
  1. In GDK, open the GraphQL explorer at http://gdk.test:3000/-/graphql-explorer and run:

    {
      aiFoundationalChatAgents {
        nodes {
          reference
          visibility
        }
      }
    }

    Every node should return a visibility value instead of the field not existing.

  2. Or check from the Rails console:

    Ai::FoundationalChatAgent.find_by_reference('chat').visibility
    # => "public"

No setup or feature flags are needed; foundational agents come from fixed in-code definitions.

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.

Merge request reports

Loading
Loading