Show a disabled Retry button when the user cannot retry
What does this MR do and why?
Currently, only the user who starts a session is able to retry it (similar to the Cancel button behaviour). The Retry button is hidden based on this permission, which leads to users sometimes expecting to see the Retry button but not seeing it, causing confusion.
- Show Retry on failed and cancelled sessions, even when the user can't retry them, for example because they didn't start the session
- Disable it for those users, with the tooltip "You do not have permission to retry this session.", the same way Cancel works
- Do the same for the Retry icon in the Sessions widget on work items and merge requests
- Group-level sessions still don't show Retry, since they can't be retried
To address in a followup: Foundational agent sessions (Duo Chat and other foundational agents) can't be retried by anyone, but the frontend has no way to tell them apart from other sessions. This means the owner of a failed or cancelled foundational agent session with a project would also see the disabled Retry button with the permission tooltip, and so would compliance reviewers who can view these sessions. Addressing this needs backend scoping.
References
- Related to Feedback: Retry for failed and cancelled DAP se... (#640436) • Allison Villa • 19.7
- Context: comment on the feedback issue
- FF rollout: [FF] `dap_session_restarts` -- Session Restart ... (#630993) • Roman Eisner, Allison Villa • 19.8
Screenshots or screen recordings
Before: Retry button would be absent if user doesn't have permission to retry the session
After:
| Session details full page view | Session details side panel | Sessions widget in MRs/work items |
|---|---|---|
![]() |
![]() |
![]() |
How to set up and validate locally
- Prerequisite: Have GitLab Duo set up in your GDK or Caproni
- Have a Duo-enabled group and project created by the Duo setup above
- Prerequisite: Have GitLab Runner working in your GDK or Caproni
- Enable the
dap_session_restartsfeature flag. - Add a second user to the project with the Developer role.
- As your first user, start a session that runs in CI in the project. For example, mention a flow's service account in an issue comment.
- Open the session at
/<project full path>/-/automate/agent-sessions/<session id>. - While the session is still running, select Cancel session and wait for the session to show as cancelled.
- Check that Retry session is shown and enabled.
- Sign in as the second user and open the same session URL.
- Check that Retry session is shown but disabled.
- Hover over the button, or Tab to it. The tooltip reads "You do not have permission to retry this session."
- As the second user, open the issue you used to start the session. In the Sessions widget, check that the session's Retry icon is shown but disabled, with the same tooltip.
- Disable the
dap_session_restartsfeature flag and reload. Retry session is no longer shown.
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.


