FE: Add event tracking when Custom and Foundational Agents are chatted with

What does this MR do and why?

  • Adds tracking for the trigger_ai_catalog_item event when a chat is sent to a custom or foundational agent via Duo Chat's web UI
  • Adds foundational_item_ref as an additional property to the trigger_ai_catalog_item event
    • Foundational agents don't have a numerical part to their id that can be extracted the same way custom agents do.
    • foundational_item_ref identifies the specific foundational agent being tracked
    • Discussion about this in this thread
      • I previously added foundational as an additional property but decided it was redundant - relevant thread

References

Relevant documentation

Screenshots or screen recordings

No UI changes

How to set up and validate locally

  1. Prerequisite: Have GitLab Duo set up in your GDK
    • Have a Duo-enabled group and project in your GDK created by the Duo setup task above
    • If you don’t see “AI Catalog” under Explore in your GDK, check that the global_ai_catalog feature flag is enabled
    • General DAP documentation: https://docs.gitlab.com/development/duo_agent_platform/
  2. Enter a project in your Duo-enabled group and create a custom agent, if you don't have one already
  3. In a terminal, run the internal events monitor with rails runner scripts/internal_events/monitor.rb trigger_ai_catalog_item
  4. Start a new chat from the DAP sidebar by clicking the "pencil" icon and selecting a foundational agent (one with the tanuki icon)
    • Screenshot_2026-03-06_at_1.46.34_PM
  5. Send a message and check the internal events monitor that the event was tracked
  6. Start another new chat with a custom agent (one you created or one that doesn't have the tanuki icon)
  7. Send a message and check the internal events monitor again

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.

Edited by Allison Villa

Merge request reports

Loading