Add pinned active session pills above Duo chat input
What does this MR do and why?
Closes #600965
Adds a row of pinned pills above the Duo Agentic Chat input area showing currently active flow sessions started from the current chat. Pills are derived from the intersection of start_flow tool messages in the thread and a single polled GraphQL query (statusGroup: ACTIVE), so:
- Only one polling subscription regardless of pill count
- Pills disappear automatically when their sessions reach a terminal status (
FINISHED/FAILED/STOPPED) - Only flows that originated from the current chat thread are shown
The disclaimer "Responses may be inaccurate. Verify before use." moves below the input form when the feature is enabled, to make room for the pill bar. Overflow collapses into a ••• disclosure dropdown when the row exceeds available width (measured via GlResizeObserverDirective).
All behavior is gated by the ai_session_pills feature flag (type: wip, default off).
Clicking a pill emits SHOW_SESSION via the AI panel eventHub, routing the panel to /agent-sessions/:id without leaving the chat.
This MR also includes a small UX follow-up: the AI panel's back button in the session view now returns to the previous panel route (e.g. the chat where the workflow was initiated) instead of always dropping the user on the sessions index. Falls back to the sessions index when no previous route exists.
Screenshots / Screen recordings
How to set up and validate locally
- Enable the flag:
Feature.enable(:ai_session_pills)from Rails console - Open the Duo Agentic Chat panel in a project
- Trigger a flow that emits a
start_flowtool call (e.g./fix_pipeline) - A pill appears above the input with a colored status dot + title
- Click the pill: the panel routes to the session show page
- Use the back button: returns to the chat (not the sessions index)
- Disable the flag: layout returns to disclaimer-above-input, no pill bar
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- I have evaluated the MR acceptance checklist for this MR.