Loading
Update agent session commit badge
What does this MR do and why?
This is a follow-up to the blame gutter agent session icon. The linked issue asks for the agent session icon on the project commits list to match it.
- Replaces the blue
infobadge with a plain 16pxsession-aiicon in the subtle text colour. It gets darker on hover. - The icon now links to the agent session. A normal click opens the session in the GitLab Duo side panel. On pages without the Duo panel, the click follows the link instead.
- The link comes from the
Duo-Session:trailer that Duo adds to agent commits. The commits query already fetches the commitdescription, which contains the trailer, so there is no GraphQL change. - The trailer is user-editable text, so it is treated as untrusted. The icon only links to a same-origin
/-/automate/agent-sessions/:idURL. If the trailer is missing or doesn't pass, the plain icon is shown without a link. - The badge moved from CE to EE (
ee/app/assets/javascripts/commit/components/agent_session_badge.vue) and is loaded with theee_component/alias. Agent sessions only exist in EE (has_agent_session?always returns false in CE), so nothing changes in CE.
References
- Issue #631092
- Related: !256210 (merged) (blame gutter agent session icon)
Screenshots or screen recordings
| Before | After |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Use a GDK with an Ultimate license.
- Pick a project and enable agent session tracking in the Rails console:
Project.find_by_full_path('<path>').project_setting.update!(dap_session_tracking_enabled: true) - Create a commit whose message ends with a trailer pointing at an agent session on your GDK, for example
Duo-Session: http://gdk.test:3000/<project-path>/-/automate/agent-sessions/<id>. - Go to the project's Commits page (Code > Commits) for that branch.
- Check that the icon is the subtle session icon, gets darker on hover, and shows the tooltip.
- Click the icon. The session opens in the GitLab Duo side panel.
Edited by Jacques Erasmus


