Enrich Duo Developer goal templates with trigger context
What does this MR do and why?
Enriches the GoalTemplates::Developer templates (in ee/app/models/ai/catalog/goal_templates/developer.rb) with two important pieces of context that were previously missing:
- Who triggered the flow — each template now includes a
%{triggered_by_username}interpolation so the agent knows who to address and @mention in its response. - Notification instructions — each template now instructs the agent to @mention the triggering user when it completes the task, so users are notified when the agent finishes (sessions can take 3–15 minutes).
Changes
ee/app/models/ai/catalog/goal_templates/developer.rb
- Added
%{triggered_by_username}interpolation to all four templates (MENTION_TEMPLATE,ASSIGN_MERGE_REQUEST_REVIEW_TEMPLATE,ASSIGN_MERGE_REQUEST_TEMPLATE,ASSIGN_ISSUE_TEMPLATE) - Updated
resolveto extract and passtriggered_by_usernamefromparams
ee/app/services/ee/notes/post_process_service.rb
- Passes
triggered_by_username: note.author.usernametoRunService#executefor mention triggers
ee/app/services/ee/issuable_base_service.rb
- Passes
triggered_by_username: current_user.usernametoRunService#executefor assign/assign_reviewer triggers
References
- Closes #598248 (closed)
- Goal construction moved to Rails: !231681 (merged)
Screenshots or screen recordings
N/A — backend-only change to goal template strings.
| Before | After |
|---|---|
| Agent does not know who triggered the flow; cannot reliably @mention or assign the user | Agent is told who triggered the flow and instructed to notify them when done |
How to set up and validate locally
-
Set up a Duo Developer flow with a foundational flow reference of
developer/v1 -
Mention the service account in an issue note
-
Check the session logs: Observe that the generated goal now includes the note author's username and notification instructions
It should mention you in the respond comment now:
-
Assign the service account to an issue or MR
-
Check the session logs: Observe that the generated goal now includes the assigning user's username and notification instructions
It should mention you in a comment on the issue and assign you to the MR
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.




