Loading
Show the source session of a restarted session in Linked Items
What does this MR do and why?
When a session is restarted, the backend links the new session to the one it was restarted from. This MR shows that link on the session details page.
- Fetch the session's workflow links in the linked items query
- Add the session a restarted session came from to the "Source" row of "Linked items", linking to it
- Raise the
get_agent_flow_linked_items.query.graphqlcomplexity override inall_queries_spec.rb
Why raise the `get_agent_flow_linked_items.query.graphql` complexity override
workflowLinksraised the query's static score from 264 to 320, so the override goes from 265 to 321, the smallest value that passes (score < limit).- At runtime it scores about 190, under the 250 limit for signed-in users. The static check ignores
first, so it overcounts. - Trimming fields doesn't get it under the limit (308 with only
linkedWorkflow { id }), andget_agent_flow.query.graphqlhas no room for the connection either. - The alternative was a separate query, which means another request on every page load, or every 10 seconds if it polls, all counting against per-user rate limits. Keeping it in the existing query adds no requests.
References
- Related to FE: Add Source Workflow to linked items section... (#629610 - closed) • Allison Villa • 19.6 • On track
- Backend link: When restarting sessions, link new session to o... (#628974 - closed) • Roman Eisner • 19.5
Screenshots or screen recordings
| First session, that was retried | Session created after retry |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Have GitLab Duo set up in your GDK, with a Duo-enabled project.
- Have GitLab Runner working.
- Enable the
dap_session_restartsfeature flag. - Start a flow in your Duo-enabled project.
- On the session details page, select Cancel session, then Cancel session in the confirmation dialog. The session status changes to Stopped.
- Select Retry session. You land on a new session with a new ID.
- In Linked items, check that the Source row shows a badge with the original session's title and ID.
- Select the badge. Check that it opens the original session.
Edited by Allison Villa

