Route Duo Developer mentions through the messaging adapter
What does this MR do and why?
Right now, our foundational flows have 2 issues when you trigger them through mentioning:
- We ignore the final response and don't route it back to the user --> We need workarounds (e.g. custom llm tool calls) to respond back
- They have a different UX than the
GitLabDuobot.
See: Unify UX for mentioning GitLabDuo and Duo Devel... (#601705)
What this MR does:
- Gives the Duo Developer
@mentionflow the same UX as@GitLabDuo: an inline "started session" system note plus a framework-delivered reply, instead of today's plain🔄 Processing → ✅ has startedcomment where the agent self-posts. Behind theai_use_messaging_adapter_for_mentionsfeature flag (default off). - This routes foundational-flow
@mentiontriggers (e.g.developer/v1) through theGitlabDuoNotemessaging adapter. Non-foundational and non-mention triggers stay on the legacyRunServicepath, unchanged.@GitLabDuoMR mentions use a separate handler and already use the adapter.
| Before | After |
|---|---|
![]() |
![]() |
How it works
- Reuse
GitLabDuoNoteadapter - Shared lifecycle.
Base#with_lifecycle_hooksis extracted as the synchronous lifecycle (on-receipt ack → build context → started/failed dispatch).Base#trigger(used by@GitLabDuo/Slack) is now expressed in terms of it, so both entry points share one dispatch path.
Known follow-up (frontend)
The progress note renders three different ways today — work-item comment chrome, MR system bullet, and the @GitLabDuo animated indicator — and on merge requests it only clears on reload (the live note-deletion subscription is issue/work-item only). The backend creates an identical, correct note in all cases (destroyed on completion). Unifying the rendering (animated + auto-removing, consistent across issues/MRs) is a separate frontend follow-up.
How to set up and validate locally
Prereqs: a DAP-onboarded project with the developer/v1 foundational flow enabled and a :mention service-account trigger, and the Duo Workflow executor running in GDK. Enable the flags (also settable at /rails/features):
Feature.enable(:ai_use_messaging_adapter_for_mentions)
Feature.enable(:ai_duo_mention_messaging_adapter) # -
Duo Developer mention (flag on):
@mentionthe flow service account@GitLabDuoin an issue/MR/work-item thread → inline "started session" note, then a framework-delivered reply in the same thread when the flow finishes. You should also see the session activity log entries below -
Duo Developer mention (flag off): same action → legacy UX (
🔄 Processing…→✅ has started). Confirms no change when off. -
@GitLabDuoregression (flag on): comment@GitLabDuo …on an MR diff → started note + framework reply, with no duplicate session notes (its bot suppresses them).
References
- Tracking issue: #601705
- Rollout issue: #602269
@GitLabDuoadapter path: !237658 (merged)- Conversation context +
delivery_modeseam: !238516 (merged) manages_system_notesrationale: https://gitlab.com/gitlab-org/gitlab/-/issues/585237



