Make Duo Chat goal mode start the Developer flow
What does this MR do and why?
Goal mode used to be cosmetic. Typing /goal showed a token, changed the placeholder, and removed the /goal text, but the message was then sent as an ordinary chat turn. Nothing actually ran a goal.
This MR makes goal mode real. Sending a prompt in goal mode starts the Developer foundational flow in its goal configuration. Duo chat only enables the /goal functionality if the Developer foundational flow is also enabled at a group and/or instance level.
A few design decisions worth noting:
- Goal is a configuration of the existing Developer foundational flow (
developer/v1), not a flow of its own. The turn names amodeso the backend picks that configuration, and the flow's identity staysdeveloper/v1, which is what billing and enablement key off. - Availability is one question asked in one place: a shared
getGoalFlowlookup collapses the feature flag, project, flow configuration, and user permission into a single yes/no. The slash command and the+menu row are gated by the same answer, and the query is cache-first so the two callers cost one request. - Commands and actions are now separate concepts. A slash command is a trigger;
START_GOALis the effect. Typing/goaland clicking the+menu row both run that one action, so the two entry points can't drift apart. - The prompt object now carries which flow goal mode runs, instead of a plain on/off boolean, so the send path has what it needs.
What is not included in this MR?
This MR doesn't implement a UI to identify that a user message starts a goal or that a session is a goal session in the sessions pill or the session widget:
This depends on two MRs to actually run goals:
- !255291 (closed) adds the
modeparameter to the flow-start API. - gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!6945 (closed) passes
modethrough the Duo Workflow Service.
References
Epic: gitlab-org#23107
Screenshots or screen recordings
| From slash command | From prompt actions menu |
|---|---|
How to set up and validate locally
- Enable the flag:
Feature.enable(:duo_chat_goal_command) - Enable the Developer flow for the project.
- Type
/goalin Duo Chat, or pick Goal from the+menu. Either way the goal token appears and the/goaltext is removed. - Send a goal. Confirm the session runs the Developer flow in its goal configuration rather than answering as chat.
- Turn the Developer flow off for the project and confirm
/goaland the Goal row both disappear.
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.
