Resolve diff discussions with Duo
## Summary Add a "Resolve with Duo" action to MR diff discussions. When triggered, a Duo workflow reads the review comment and its surrounding code context, implements the change the reviewer described, leaves a reply in the thread explaining what was done, and resolves the discussion. The action is available to users with Duo access and push permissions on the MR branch, and keeps the human in the loop: Duo replies with what it changed and why before closing the thread. ## Problem Statement Modern code review produces more discussion threads than teams can resolve efficiently. AI-assisted development has accelerated MR volume substantially, but the resolution cycle between "reviewer leaves a comment" and "author implements and closes the thread" has not shortened to match. For many review comments, the gap is not cognitive: the reviewer has already done the hard work of identifying the problem and describing the fix. The remaining work is mechanical. The current discussion model assumes the author reads a comment in the GitLab UI, opens their editor, implements the fix, commits, pushes, and then manually resolves the thread. Each step is a context switch with its own overhead. On an MR with a dozen unresolved discussions, that overhead compounds. The result is delayed review cycles, accumulated unresolved threads, and reviewer frustration when comments that were clearly understood still take hours to close. This is a structural gap in how GitLab connects the review surface to the execution surface. GitLab already has the infrastructure to act on natural-language instructions through the Duo Agent Platform, and review comments are among the highest-signal natural-language instructions available in the development lifecycle: they are scoped to a specific file and line range, written by a human who understands the codebase, and already express intent rather than just observation. The platform can act on these inputs directly. Today, it does not. ## Proposal Add a "Resolve with Duo" option to the action menu on unresolved diff discussions in MRs. When a user triggers the action, GitLab starts a Duo workflow that: 1. Reads the full discussion thread and the surrounding code at the relevant file and line range 2. Implements the change described by the reviewer 3. Commits the change to the MR branch 4. Leaves a reply in the discussion thread describing what was changed and why 5. Resolves the discussion The workflow runs asynchronously. The discussion shows a loading state while Duo is working, then updates with the generated reply and resolved status once the workflow completes. If the workflow fails, the discussion returns to its unresolved state and the user can retry or resolve manually. The action is visible only to users with Duo access and the appropriate MR permissions (push access to the branch). It is feature-flagged for controlled rollout. This proposal keeps scope narrow deliberately. The initial iteration addresses the most bounded case: a single unresolved discussion, a single Duo workflow, a single commit. Multi-discussion batch resolution, discussion prioritization, and more complex multi-file refactors are out of scope for the initial delivery. ### Proof of concept An initial implementation exists in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/235596. ## Metrics **Primary:** Reduction in time from discussion opened to discussion resolved for Duo-assisted threads, compared to manually resolved threads on the same MRs. This is the clearest signal that the workflow is saving meaningful time. **Secondary:** - Adoption rate: percentage of eligible (unresolved, Duo-accessible) discussions where users choose "Resolve with Duo" vs. resolving manually. A low rate may indicate discoverability or trust issues; a high rate indicates the action fits naturally into the review workflow. - Re-open rate: percentage of Duo-resolved discussions that a reviewer subsequently reopens or follows up with another comment. This is a quality signal. A high re-open rate suggests Duo's implementation frequently misses the intent of the review comment. - Workflow completion rate: percentage of triggered Duo sessions that complete successfully (produce a commit and resolve the discussion) vs. failing, timing out, or being abandoned. This measures reliability.
epic