Show the source referrer in the Duo session actor line
What does this MR do and why?
DuoWorkflow.sourceType and sourceLink have been exposed in GraphQL since !253033 (merged), but nothing in the frontend reads them. This MR fetches both fields in the shared FlowFragment and folds the referrer into the existing "triggered by" actor line through AgentFlowTriggeredUser, the one component every actor line already goes through. On the session page it reads both fields itself with a cache-only query keyed on the workflow id from the route, so no parent component passes them down.
On the session page the details-panel row and the header line become @user via Slack, with Slack linking to the Slack message. In the Duo side panel the username text is dropped when a source is present (avatar and its user popover stay), so the row reads avatar + via Slack. A known source type renders its label (SLACK, MCP for now); an unknown type with a link falls back to the bare URL; only http(s) links render as an href, anything else is plain text. When sourceType is absent the rendering is unchanged, byte for byte.
This ships without a feature flag: the change is a read-only rendering of two fields that are already exposed, and sessions without a source render exactly as before.
Related to #627636 (closed)
References
- #627636 (closed)
- !253033 (merged) (exposes
sourceType/sourceLink)
Screenshots or screen recordings
Session A was created with source_type: slack and a source_link; session B has neither.
| Before (no source) | After (Slack source) |
|---|---|
![]() |
![]() |
Duo side panel, session A: the username is dropped in favor of the avatar and "via Slack"; the user popover still opens on hover.
How to set up and validate locally
- Give a session a source, either by triggering one from Slack or directly, in a Rails console:
Ai::DuoWorkflows::Workflow.last.update!(source_type: 'slack', source_link: 'https://gitlab.slack.com/archives/C0123/p1234567890') - Open that session's page under the project's Automate section. The header reads
Started … by @user via Slack, and theTriggered byrow in the details panel reads@user via SlackwithSlacklinked. - Open the same session in the Duo side panel: the row shows the avatar and
via Slackwithout the@usernametext; hovering the avatar still opens the user popover. - Set
source_type: 'something_else'with a longsource_linkto check the bare-URL fallback and that it truncates before the project label does at the panel's minimum width. - Clear
source_typeand confirm both lines render as before.
Specs:
yarn jest ee/spec/frontend/ai/duo_agents_platform/components/common/agent_flow_triggered_user_spec.js ee/spec/frontend/ai/duo_agents_platform/pages/show/components/agent_flow_header_spec.js ee/spec/frontend/ai/duo_agents_platform/pages/show/components/agent_flow_details_spec.js
VUE_VERSION=3 yarn jest ee/spec/frontend/ai/duo_agents_platform/components/common/agent_flow_triggered_user_spec.js ee/spec/frontend/ai/duo_agents_platform/pages/show/components/agent_flow_header_spec.js ee/spec/frontend/ai/duo_agents_platform/pages/show/components/agent_flow_details_spec.jsMR 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.


