Open agent sessions from Agents by provider in the side panel
What does this MR do and why?
Renames the Which AI agents developers are using dashboard card to Agents by provider. Behind the ai_governance_dashboard_side_panels flag, selecting a slice or a legend entry opens the side panel with Audit events filtered to that slice.
It uses the side panel from !269500 (merged).
Changes:
- Rename, not behind a flag: the card title, the Storybook titles, the two
session_distributionmetric descriptions, the docs, andlocale/gitlab.pot. The component, file, test IDs, and tracking labels keep their names, so the existing metrics keep counting. donut_chart.vue: a newclickableSlicesprop,falseby default. When it is set, each legend entry is a native button and clicking a slice or a legend entry emitsslice-clickwith{ name, label, value }. The folded Other slice and the empty state never emit. The Tool calls by action card does not set the prop, so it renders as before.session_distribution_card.vue: passesclickableSlicesonly whenopenGovernancePanelis provided, which happens only with the flag on. A click tracksclick_card_link_on_ai_governance_dashboardwith labelsession_distributionand propertyslice, then opens the panel with the slice label as its title.click_card_link_on_ai_governance_dashboard.yml: the descriptions now list the newsliceproperty value. The existingsession_distributionmetrics filter on the label only, so they count slice clicks too.
The filters depend on the Show control (agentClass). They use the raw slice name, such as claude-code, not the display label:
Show (agentClass) |
Slice name | Audit events filters |
|---|---|---|
ALL |
gitlab_duo |
{ agentClass: INTERNAL_DAP } |
ALL |
Any other, including unknown |
{ agentClass: EXTERNAL, agentType: name } |
EXTERNAL |
Any, including unknown |
{ agentClass: EXTERNAL, agentType: name } |
INTERNAL_DAP |
Any, including unknown |
{ agentClass: INTERNAL_DAP, flowType: name } |
Every row also gets startTimeAfter from the date range, through auditEventsFilters.
Not in this MR
These are known gaps. All of them are behind the default-off flag:
- The
agentTypefilter token is added in !261757 (merged). Until it merges, connected-agent slices open filtered only by date and theEXTERNALagent class. - Versioned flow types: https://gitlab.com/gitlab-org/gitlab/-/work_items/639545
unknownslices: https://gitlab.com/gitlab-org/gitlab/-/work_items/639546- The
agentTypeandflowTypetokens exist only with theai_governance_sessions_apiflag on. Without it, those slices open filtered only by date and agent class. - Click-to-panel is not documented yet. The docs will cover it when the flag rolls out.
References
Screenshots or screen recordings
How to set up and validate locally
-
In the Rails console, enable the feature flag:
Feature.enable(:ai_governance_dashboard_side_panels) -
Open a group's AI > Governance page and select the Dashboard tab.
-
Check that the card is titled Agents by provider.
-
With Show set to All agents, select the GitLab Duo slice. Check that the side panel title is GitLab Duo and that Audit events is filtered to the agent class and the date range.
-
Select a connected agent in the legend, such as Claude Code. Check the panel title and filters.
-
Switch Show to DAP and then to Connected, and repeat with a slice and a legend entry.
-
Press Tab to reach a legend entry and press Enter. Check that the panel opens.
-
If the chart has an Other slice, check that it does not open the panel.
-
Disable the flag with
Feature.disable(:ai_governance_dashboard_side_panels)and reload. Check that only the title changed and that nothing on the card opens the panel.
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.
