Return the session URL when starting a Duo flow

What does this MR do and why?

I did some local tests to include MCP tools in our Slack agent and realized a problem: When GitLab Duo delegates work from Slack through start_duo_session, the tool returns only a numeric session ID, so the assistant cannot give the user a trustworthy link to follow. The URL would be a helpful output for agents since it avoids that they construct something on their own that could be wrong.

This MR returns the workflow's canonical URL in the response now as well.

The create-workflow API entity supplies the URL; the MCP tool passes it through in structured and human-readable output instead of constructing one from an ID. No URL is invented for a session without a project URL (I think today we don't have proper URLs for group level sessions, do we?).

References

None. Follow-up from testing Duo delegation through the Slack assistant.

How to set up and validate locally

  1. Run GDK on this Rails branch with the GitLab MCP client enabled for your user and Duo Agent Chat connected to the local Duo Workflow Service. Have a test project where you are allowed to start a Developer flow and its service account can execute.

  2. In web chat, ask GitLab Duo to start a Developer session for a task in that project, explicitly using the gitlab_start_duo_session MCP tool . Check the tool call in the trace: a built-in start_flow call would not exercise this change. For example

    Delegate to the developer flow to start a session in gitlab-duo/test. Ask it to just say hi. Make sure to use the gitlab_start_duo_session tool and tell me where I can follow along with the session.

  3. Check that the tool response includes both workflow_id and web_url, that the URL resolves to the newly created session, and that the assistant can give the user the link without guessing it.

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.

Edited by Thomas Schmidt

Merge request reports

Loading
Loading