Feat: Resolve "Ability to cancel a flow session" frontend changes

What does this MR do and why?

This MR adds the ability to cancel a session via the session details tab view.

References

GitLab Issue: #562406 (closed)

Screenshots or screen recordings

Before After
Screenshot_2025-12-05_at_2.20.58_PM Screenshot_2025-12-05_at_1.42.42_PM
Screen Recording
Screen_Recording_2025-12-05_at_1.41.06_PM

How to set up and validate locally

For DAP/General Setup

To Test in Duo Side Rail (only test if regression testing this mode)

  1. Turn on the following feature flags: duo_workflow, duo_workflow_in_ci, ai_flow_triggers and duo_side_rail.
  2. Make sure you are NOT in the new UI
  3. Open Duo Chat and open the Sessions tab (the two overlapping squares icon).
  4. Test search queries (see below for test cases)
  5. A: If you see no Sessions, you can trigger one that displays a Pipeline/Job by going to an Issue within your Duo enabled project and clicking the Generate MR with Duo button. It should trigger a new session that you can open up.
  6. B: You can also run the following query bundle exec rake "gitlab:duo_workflow:populate[50,20,1,<<YOUR_TEST_GROUP_PATH_HERE>>]" to create new agent sessions. Refresh the page. Make sure the group you are testing in has Duo assigned (see DAP setup above).
  7. Test details view (see below for test cases)

To Test in Agent Sessions page

  1. Navigate to a project with that has AI features enabled.
  2. In the left side panel, you will see Automate with a tanuki icon. Select Sessions from the dropdown.
  3. Test details view (see below for test cases)

To Test in new UI Side Panel

  1. To test this locally, make sure you have the following FFs enabled: paneled_view, global_topbar, tailwind_container_queriesAfter you can toggle New UI on in user's setting under the user's profile dropdown
  2. Open the side panel and open Sessions.
  3. Test details view (see below for test cases)

Test Details View (The Actual Testing)

  1. Go to the UI Side Panel, and select/click a Session item that has not failed or been cancelled or stopped (i.e.; created, running, awaiting input, etc.).
  2. In the Session activity/details view, click the Details tab.
  3. At the bottom you should see a Cancel button.
  4. Click it and a modal will appear to confirm your cancellation. Validate modal cancels out and open modal again.
  5. Click Cancel. Validate session status changes to Stopped in the details view and that icons match a stopped/cancelled state.

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 #562406 (closed)

Edited by Lindsey Shelton

Merge request reports

Loading