Show a View retry link on retried sessions in the Sessions widget

What does this MR do and why?

Follows the design feedback on what happens after a retry: a retried session should point to its retry.

  • Replace Retry with a View retry link to the newest retry on a retried session
  • Request restartedAs in the shared session fragment, used by the work item and merge request session queries and the work item sessions subscription

The View retry link is behind the dap_session_restarts feature flag. The queries request restartedAs either way, and the field is batch loaded.

Plan

# MR What it adds
1 Add Retry to failed and cancelled sessions in t... (!263742 - merged) • Allison Villa • 19.6 Retry button on failed and cancelled sessions, at the end of the row and borderless
2 Expose restartedAs on the DuoWorkflow GraphQL type (!268886 - merged) • Allison Villa • 19.6 restartedAs field, so the widget can tell a session was retried
3 Show a View retry link on retried sessions in t... (!268887 - merged) • Allison Villa • 19.6 Retried failed and cancelled sessions get a View retry link

We split it this way so the Retry button (1) can merge without waiting on the backend field (2). Only the design feedback on what happens after a retry needs the new field, so that part (3) depended on 2, which has merged.

See design and UX discussion - !263742 (comment 4059242321)

References

Screenshots or screen recordings

Session row that's been retried Recording of behaviour
Screenshot_2026-11-10_at_2.11.59_PM

How to set up and validate locally

  1. Prerequisite: Have GitLab Duo set up in your GDK or Caproni
    • Have a Duo-enabled group and project created by the Duo setup above
  2. Prerequisite: Have GitLab Runner working in your GDK or Caproni
  3. Enable the dap_session_restarts feature flag.
  4. Start a session from an issue in the Duo-enabled project. For example, select Implement on the issue.
  5. Open the session at /<project full path>/-/automate/agent-sessions/<session ID>.
  6. Select Cancel session.
  7. In the confirmation dialog, select Cancel session.
  8. Go back to the issue and expand the Sessions widget. The cancelled session shows under Cancelled, with a Retry session icon button.
  9. Select Retry session on the cancelled session. A new session starts.
  10. The new session shows under Created, and the cancelled session shows under Cancelled with a View retry link instead of Retry session.
  11. Select View retry. The new session opens.
  12. Disable the dap_session_restarts feature flag and reload the issue. The cancelled session has no Retry session button or View retry link.
Edited by Allison Villa

Merge request reports

Loading
Loading