Adds Agents Service to system notes
What does this MR do and why?
This MR partially addresses #570291 by adding agent session tracking to system notes for Duo Workflows.
Context:
This is the second of three MRs split from a larger change (see original MR). The split makes it easier to review and enables iterative delivery.
Problem:
Duo Workflows currently lack visibility into agent activity on work items (issues, merge requests). Users cannot track when agents start sessions, complete work, or encounter failures directly within the work item timeline.
Solution:
Introduce SystemNotes::AgentsService to create system notes for agent lifecycle events. This provides:
- Transparent agent activity tracking in work item timelines
- Clear audit trail of agent sessions with clickable links to session details
- Context about how sessions were triggered (user, pipeline, etc.)
- Foundation for future agent-related notifications and analytics
Example system notes generated:
- "Duo Developer started session 123 triggered by Issue to merge request"
- "Duo Developer completed session 123"
- "Duo Developer session 123 failed (dropped)"
MR Sequence:
-
MR 1: Adds
issue_idandmerge_request_idcolumns toduo_workflows_workflowstable - MR 2: Implement agent service for system notes <- you are here
- MR 3: Integrate agent service with work items UI (upcoming after merge of MR 1 & 2)
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
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.