feat: Prioritize foundational chat agents over external agents

What does this MR do and why?

Foundational chat agents should appear at the top of the AI Catalog before foundational external agents. This change updates the priority ordering logic to ensure foundational chat agents are always ranked first in the catalog listing. See discussion #587379 (comment 3118284413)

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Feature.enable(:ai_catalog_items_priority_order)
  2. Verify on http://gdk.test:3000/explore/ai-catalog/agents/ foundational chat agents should be visible on top and then foundational external agents.
Click to expand

image

  1. Verify on http://gdk.test:3000/[PROJECT_PATH]/-/automate/agents foundational chat agent's consumers should be visible on top and then foundational external agents consumers
Click to expand

image

Database queries

  1. Query plan for Item - https://console.postgres.ai/gitlab/gitlab-production-main/sessions/49269/commands/147034
  2. Query plan for ItemConsumer - https://console.postgres.ai/gitlab/gitlab-production-main/sessions/49269/commands/147040

Discussion about different approach - !222430 (comment 3063951768)

Related to #587379 (closed)

Edited by Jaydip Pansuriya

Merge request reports

Loading