Summarize work item actions use Planner agent

What does this MR do and why?

This MR replaces the existing AI summarize notes component with a new reusable Duo Chat quick action button component. This provides a more consistent and flexible way to trigger Duo Chat actions across the application. This is behind a disabled feature flag duo_quick_action with a user gate actor.

This change is part of a larger initiative to integrate Planner Agent CTAs directly into Plan UI surfaces (#589884). By creating a reusable component, we can drive immediate adoption of Planner Agent and increase LLM requests with a relatively low lift, making it easier for users to access AI capabilities without manually opening the side panel and selecting an agent.

Changes:

  • New component: Introduces DuoChatQuickAction component that handles Duo Chat availability checks and command queueing
  • Replaces: AiSummarizeNotes component in notes activity headers and work item activity headers
  • Event handling: Adds new event hub events SHOW_NEW_CHAT and QUEUE_CHAT_COMMAND for better chat panel control
  • Agent selection: Adds ability to select foundational agents by name (e.g., "Planner") in addition to GraphQL ID
  • Tracking: Implements proper event tracking for quick action clicks

The new component is more flexible and can be reused for other Duo Chat quick actions beyond just summarization.

Important Testing this locally, I can only confirm that the button works, the Planner agent is picked and then it runs correctly, but my local GDK does not have the latest Planner agent setup/tools. So it doesn't read the work item comments. I am adding this new feature nehind a disabled FF, so we can test the prompt on production internally before releasing.

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Enable AI features and make sure you have access to both classic and agentic chat
  2. Create or navigate to an issue with comments. You will need to have the work_item_planning_view FF set to false
  3. Visit the issue page (e.g., http://gdk.test:3000/gitlab-org/gitlab-test/-/issues/1). You know this works when you see "Issues" under the Plan menu and not "Work Item"
  4. Verify the "View summary" button appears in the Activity section header with the tanuki-ai icon
  5. Click the "View summary" button and verify:
    • The Duo Chat panel opens
    • A new chat session starts
    • The Planner agent is selected
    • The summarization command is queued and executed
  6. Repeat steps 3-5 for a work item to verify the component works in both contexts. Turn on the FF work_item_planning_view
  7. Verify tracking events are fired when clicking the button (check browser console or monitoring)

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.

Related to #589884

Edited by Frédéric Caplette

Merge request reports

Loading