Draft: Expose alternatives field on DuoMessage GraphQL type for Duo Workflow retry
What does this MR do and why?
Add Rails side support for exposing alternative messages (previous retry attempts) on the DuoMessage GraphQL type used in Duo Workflows (Used by the FE to get the history).
When a user retries an agent response in agentic chat, the Python code gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!5570 (closed) stores the previous attempts as alternatives in the checkpoint. This MR allows the FE to retrieve these alternative messages so the FE is aware of retries.
References
- Issue: #600573 (closed)
- Epic: gitlab-org#21289 (closed)
- Full plan: gitlab-org#21289 (comment 3362962795) (updates in following messages)
- ai-assist MR (backend retry logic): gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!5570 (closed)
How to set up and validate locally
- Checkout this branch
- Create checkpoints with the required alternatives. Either:
- [Faked, Without AIGW changes]: Override a checkpoint:
- Start a new thread, and send any message
- In
gdk rails consolerun the snippet inOverride checkpoint with fake attempts code
- [Real, with AIGW changes]: Or follow the steps in gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!5570 (closed) to create the following types of messages in 1 or multiple chats:
- A message with no alternatives => The agent message should contain an empty
alternativesfield - A message with multiple alternatives => The agent message should have an
alternativesfield with multiple entries, these entries should have user and agent fields - A message with a single alternative => The agent message should have an
alternativesfield with a single entry - A message with multiple responses (tool request and tool call) with a similar alternative => The last agent message should have a
alternativesfield and it'sagentResponsesshould have multiple entries
- A message with no alternatives => The agent message should contain an empty
- [Faked, Without AIGW changes]: Override a checkpoint:
Override checkpoint with fake attempts code
checkpoint_string = "{\"v\":4,\"id\":\"1f15e668-3e5b-6983-800c-75bc79a34d30\",\"ts\":\"2026-06-02T09:36:21.774149+00:00\",\"versions_seen\":{\"agent\":{\"branch:to:agent\":22},\"__input__\":{},\"__start__\":{\"__start__\":1},\"run_tools\":{\"branch:to:run_tools\":21},\"__interrupt__\":{\"goal\":2,\"plan\":2,\"status\":21,\"project\":2,\"approval\":12,\"is_retry\":21,\"__start__\":2,\"namespace\":2,\"ui_chat_log\":20,\"denied_tools\":21,\"branch:to:agent\":20,\"last_human_input\":2,\"preapproved_tools\":21,\"branch:to:run_tools\":21,\"conversation_history\":20}},\"channel_values\":{\"goal\":\"Say 1\",\"plan\":{\"steps\":[]},\"status\":\"input_required\",\"project\":{\"id\":1000000,\"name\":\"Test\",\"web_url\":\"http://gdk.test:8080/gitlab-duo/test\",\"languages\":[{\"name\":\"Ruby\",\"share\":99.99},{\"name\":\"Python\",\"share\":0.01}],\"description\":null,\"default_branch\":\"main\",\"exclusion_rules\":null,\"http_url_to_repo\":\"http://gdk.test:8080/gitlab-duo/test.git\"},\"approval\":{\"type\":\"ApprovalStateRejection\",\"message\":\"\"},\"is_retry\":false,\"namespace\":null,\"ui_chat_log\":[{\"status\":\"success\",\"content\":\"Say 1\",\"timestamp\":\"2026-06-02T09:32:18.464823+00:00\",\"tool_info\":null,\"message_id\":\"user-d2ba4bac-cb27-4719-a1ea-554a22c47fa4\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":[{\"id\":\"page-context\",\"type\":\"AdditionalContext\",\"content\":\"\\u003ccurrent_gitlab_page_url\\u003ehttp://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\\u003c/current_gitlab_page_url\\u003e\\n\\u003ccurrent_gitlab_page_title\\u003eDummy MR for issue #43 (created 2026-05-15T11:09:27Z) (!522) · Merge requests · GitLab Duo / Test · GitLab\\u003c/current_gitlab_page_title\\u003e\",\"category\":\"repository\",\"metadata\":{\"icon\":\"link\",\"title\":\"Current page\",\"enabled\":true,\"subType\":\"open_tab\",\"pagePath\":\"/gitlab-duo/test/-/merge_requests/522\",\"projectPath\":\"gitlab-duo/test\",\"subTypeLabel\":\"Current page\",\"secondaryText\":\"Page context /gitlab-duo/test/-/merge_requests/522\"}}]},{\"status\":\"success\",\"content\":\"1\",\"timestamp\":\"2026-06-02T09:32:20.449829+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87ad-3ead-73e2-962c-c97217969f07\",\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},{\"status\":\"success\",\"content\":\"What page am I on?\",\"timestamp\":\"2026-06-02T09:33:30.691919+00:00\",\"tool_info\":null,\"message_id\":\"user-e439ec2c-07ed-4a96-a9f0-81a173d9b7e5\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":[{\"id\":\"page-context\",\"type\":\"AdditionalContext\",\"content\":\"\\u003ccurrent_gitlab_page_url\\u003ehttp://gdk.test:8080/gitlab-duo\\u003c/current_gitlab_page_url\\u003e\\n\\u003ccurrent_gitlab_page_title\\u003eGitLab Duo · GitLab\\u003c/current_gitlab_page_title\\u003e\",\"category\":\"repository\",\"metadata\":{\"icon\":\"link\",\"title\":\"Current page\",\"enabled\":true,\"subType\":\"open_tab\",\"pagePath\":\"/gitlab-duo\",\"projectPath\":\"\",\"subTypeLabel\":\"Current page\",\"secondaryText\":\"Page context /gitlab-duo\"}}]},{\"status\":\"success\",\"content\":\"You're on the **GitLab Duo** group page at `http://gdk.test:8080/gitlab-duo`.\",\"timestamp\":\"2026-06-02T09:33:34.234537+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87ae-58cc-7cf1-a2bf-fd89baabe995\",\"alternatives\":[{\"user_message\":{\"status\":\"success\",\"content\":\"What page am I on?\",\"timestamp\":\"2026-06-02T09:33:09.957788+00:00\",\"tool_info\":null,\"message_id\":\"user-38440c6a-2e0f-4035-80b2-2840dd1e7ee2\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":[{\"id\":\"page-context\",\"type\":\"AdditionalContext\",\"content\":\"\\u003ccurrent_gitlab_page_url\\u003ehttp://gdk.test:8080/gitlab-duo/test\\u003c/current_gitlab_page_url\\u003e\\n\\u003ccurrent_gitlab_page_title\\u003eGitLab Duo / Test · GitLab\\u003c/current_gitlab_page_title\\u003e\",\"category\":\"repository\",\"metadata\":{\"icon\":\"link\",\"title\":\"Current page\",\"enabled\":true,\"subType\":\"open_tab\",\"pagePath\":\"/gitlab-duo/test\",\"projectPath\":\"gitlab-duo/test\",\"subTypeLabel\":\"Current page\",\"secondaryText\":\"Page context /gitlab-duo/test\"}}]},\"agent_responses\":[{\"status\":\"success\",\"content\":\"You're on the **GitLab Duo / Test** project page at `http://gdk.test:8080/gitlab-duo/test`.\",\"timestamp\":\"2026-06-02T09:33:12.333734+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87ae-07d3-7ae3-adc9-9694c8791eae\",\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null}]},{\"user_message\":{\"status\":\"success\",\"content\":\"What page am I on?\",\"timestamp\":\"2026-06-02T09:32:27.907159+00:00\",\"tool_info\":null,\"message_id\":\"user-e360c025-96f1-457b-b32c-ef86c6001336\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},\"agent_responses\":[{\"status\":\"success\",\"content\":\"You're on the merge request page for **!522** - \\\"Dummy MR for issue #43\\\" in the [GitLab Duo / Test](http://gdk.test:8080/gitlab-duo/test) project.\\n\\nDirect link: [!522](http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522)\",\"timestamp\":\"2026-06-02T09:32:30.984576+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87ad-6389-7282-b6e7-563e26ad0d3f\",\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null}]}],\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},{\"status\":\"success\",\"content\":\"Add a comment to http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522 saying \\\"LLM was here\\\"\",\"timestamp\":\"2026-06-02T09:35:50.995306+00:00\",\"tool_info\":null,\"message_id\":\"user-8bd3b488-dc42-4cb1-94f1-298e38d72c10\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},{\"status\":\"success\",\"content\":\"Tool create_merge_request_note requires approval. Please confirm if you want to proceed.\",\"timestamp\":\"2026-06-02T09:35:54.102389+00:00\",\"tool_info\":{\"args\":{\"url\":\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"body\":\"LLM was here\"},\"name\":\"create_merge_request_note\"},\"message_id\":\"request-toolu_vrtx_0149kT4hb6oJ8Eu63yhgBX1e\",\"message_type\":\"request\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},{\"status\":\"success\",\"content\":\"Add comment to merge request http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"timestamp\":\"2026-06-02T09:36:19.048572+00:00\",\"tool_info\":{\"args\":{\"url\":\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"body\":\"LLM was here\"},\"name\":\"create_merge_request_note\",\"tool_response\":{\"id\":null,\"name\":\"create_merge_request_note\",\"type\":\"ToolMessage\",\"status\":\"success\",\"content\":\"{\\\"created_merge_request_note\\\": {\\\"id\\\": 3287, \\\"type\\\": null, \\\"body\\\": \\\"LLM was here\\\", \\\"author\\\": {\\\"id\\\": 1, \\\"username\\\": \\\"root\\\", \\\"public_email\\\": null, \\\"name\\\": \\\"Administrator\\\", \\\"state\\\": \\\"active\\\", \\\"locked\\\": false, \\\"avatar_url\\\": \\\"https://www.gravatar.com/avatar/24ac8438e86aa982df47ce9805b3ea5b437062525ce09fdace4974334bdd326d?s=80\\u0026d=identicon\\\", \\\"web_url\\\": \\\"http://gdk.test:8080/root\\\"}, \\\"created_at\\\": \\\"2026-06-02T09:36:18.991Z\\\", \\\"updated_at\\\": \\\"2026-06-02T09:36:18.991Z\\\", \\\"system\\\": false, \\\"noteable_id\\\": 678, \\\"noteable_type\\\": \\\"MergeRequest\\\", \\\"project_id\\\": 1000000, \\\"resolvable\\\": false, \\\"confidential\\\": false, \\\"internal\\\": false, \\\"imported\\\": false, \\\"imported_from\\\": \\\"none\\\", \\\"noteable_iid\\\": 522, \\\"commands_changes\\\": {}}}\",\"artifact\":null,\"tool_call_id\":\"toolu_vrtx_0149kT4hb6oJ8Eu63yhgBX1e\",\"additional_kwargs\":{},\"response_metadata\":{}}},\"message_id\":\"toolu_vrtx_0149kT4hb6oJ8Eu63yhgBX1e\",\"message_type\":\"tool\",\"correlation_id\":null,\"message_sub_type\":\"create_merge_request_note\",\"additional_context\":null},{\"status\":\"success\",\"content\":\"Done! The comment \\\"LLM was here\\\" has been added to [!522](http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522).\",\"timestamp\":\"2026-06-02T09:36:21.771591+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87b0-ea82-7e43-ac9e-53c08e3aa3c1\",\"alternatives\":[{\"user_message\":{\"status\":\"success\",\"content\":\"Add a comment to http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522 saying \\\"LLM was here\\\"\",\"timestamp\":\"2026-06-02T09:35:05.434091+00:00\",\"tool_info\":null,\"message_id\":\"user-6707ba49-1b15-4530-8e4b-7a391e1c1537\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},\"agent_responses\":[{\"status\":\"success\",\"content\":\"Tool create_merge_request_note requires approval. Please confirm if you want to proceed.\",\"timestamp\":\"2026-06-02T09:35:08.148482+00:00\",\"tool_info\":{\"args\":{\"url\":\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"body\":\"LLM was here\"},\"name\":\"create_merge_request_note\"},\"message_id\":\"request-toolu_vrtx_01Kqq3UgRX6K5LCRinXuGxG1\",\"message_type\":\"request\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},{\"status\":\"success\",\"content\":\"Add comment to merge request http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"timestamp\":\"2026-06-02T09:35:27.134355+00:00\",\"tool_info\":{\"args\":{\"url\":\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"body\":\"LLM was here\"},\"name\":\"create_merge_request_note\",\"tool_response\":{\"id\":null,\"name\":\"create_merge_request_note\",\"type\":\"ToolMessage\",\"status\":\"success\",\"content\":\"{\\\"created_merge_request_note\\\": {\\\"id\\\": 3286, \\\"type\\\": null, \\\"body\\\": \\\"LLM was here\\\", \\\"author\\\": {\\\"id\\\": 1, \\\"username\\\": \\\"root\\\", \\\"public_email\\\": null, \\\"name\\\": \\\"Administrator\\\", \\\"state\\\": \\\"active\\\", \\\"locked\\\": false, \\\"avatar_url\\\": \\\"https://www.gravatar.com/avatar/24ac8438e86aa982df47ce9805b3ea5b437062525ce09fdace4974334bdd326d?s=80\\u0026d=identicon\\\", \\\"web_url\\\": \\\"http://gdk.test:8080/root\\\"}, \\\"created_at\\\": \\\"2026-06-02T09:35:27.016Z\\\", \\\"updated_at\\\": \\\"2026-06-02T09:35:27.016Z\\\", \\\"system\\\": false, \\\"noteable_id\\\": 678, \\\"noteable_type\\\": \\\"MergeRequest\\\", \\\"project_id\\\": 1000000, \\\"resolvable\\\": false, \\\"confidential\\\": false, \\\"internal\\\": false, \\\"imported\\\": false, \\\"imported_from\\\": \\\"none\\\", \\\"noteable_iid\\\": 522, \\\"commands_changes\\\": {}}}\",\"artifact\":null,\"tool_call_id\":\"toolu_vrtx_01Kqq3UgRX6K5LCRinXuGxG1\",\"additional_kwargs\":{},\"response_metadata\":{}}},\"message_id\":\"toolu_vrtx_01Kqq3UgRX6K5LCRinXuGxG1\",\"message_type\":\"tool\",\"correlation_id\":null,\"message_sub_type\":\"create_merge_request_note\",\"additional_context\":null},{\"status\":\"success\",\"content\":\"Done! The comment \\\"LLM was here\\\" has been added to [!522](http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522).\",\"timestamp\":\"2026-06-02T09:35:31.081092+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87b0-1fae-7b60-8838-579e9459b203\",\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null}]},{\"user_message\":{\"status\":\"success\",\"content\":\"Add a comment to http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522 saying \\\"LLM was here\\\"\",\"timestamp\":\"2026-06-02T09:34:03.328592+00:00\",\"tool_info\":null,\"message_id\":\"user-14949919-7636-43eb-88e5-b9d063667e5b\",\"message_type\":\"user\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":[{\"id\":\"page-context\",\"type\":\"AdditionalContext\",\"content\":\"\\u003ccurrent_gitlab_page_url\\u003ehttp://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\\u003c/current_gitlab_page_url\\u003e\\n\\u003ccurrent_gitlab_page_title\\u003eDummy MR for issue #43 (created 2026-05-15T11:09:27Z) (!522) · Merge requests · GitLab Duo / Test · GitLab\\u003c/current_gitlab_page_title\\u003e\",\"category\":\"repository\",\"metadata\":{\"icon\":\"link\",\"title\":\"Current page\",\"enabled\":true,\"subType\":\"open_tab\",\"pagePath\":\"/gitlab-duo/test/-/merge_requests/522\",\"projectPath\":\"gitlab-duo/test\",\"subTypeLabel\":\"Current page\",\"secondaryText\":\"Page context /gitlab-duo/test/-/merge_requests/522\"}}]},\"agent_responses\":[{\"status\":\"success\",\"content\":\"Tool create_merge_request_note requires approval. Please confirm if you want to proceed.\",\"timestamp\":\"2026-06-02T09:34:06.066565+00:00\",\"tool_info\":{\"args\":{\"url\":\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"body\":\"LLM was here\"},\"name\":\"create_merge_request_note\"},\"message_id\":\"request-toolu_vrtx_01C63dSZ5yxEaoHgieMjjXtT\",\"message_type\":\"request\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null},{\"status\":\"success\",\"content\":\"Comment was not posted as the action was cancelled.\",\"timestamp\":\"2026-06-02T09:34:17.256487+00:00\",\"tool_info\":null,\"message_id\":\"lc_run--019e87af-0557-71b3-ad10-dee201616a17\",\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null}]}],\"message_type\":\"agent\",\"correlation_id\":null,\"message_sub_type\":null,\"additional_context\":null}],\"denied_tools\":[],\"last_human_input\":null,\"preapproved_tools\":[\"gitlab_get_mcp_server_version\",\"gitlab_get_workitem_notes\",\"gitlab_get_saved_view_work_items\",\"gitlab_search_labels\",\"gitlab_get_pipeline_jobs\",\"gitlab_get_issue\",\"gitlab_get_merge_request\",\"gitlab_get_merge_request_commits\",\"gitlab_get_merge_request_diffs\",\"gitlab_get_merge_request_pipelines\",\"gitlab_search\"],\"conversation_history\":{\"Chat Agent\":[{\"id\":null,\"name\":null,\"type\":\"HumanMessage\",\"content\":\"Say 1\",\"additional_kwargs\":{\"additional_context\":[{\"id\":\"page-context\",\"content\":\"\\u003ccurrent_gitlab_page_url\\u003ehttp://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\\u003c/current_gitlab_page_url\\u003e\\n\\u003ccurrent_gitlab_page_title\\u003eDummy MR for issue #43 (created 2026-05-15T11:09:27Z) (!522) · Merge requests · GitLab Duo / Test · GitLab\\u003c/current_gitlab_page_title\\u003e\",\"category\":\"repository\",\"metadata\":{\"icon\":\"link\",\"title\":\"Current page\",\"enabled\":true,\"subType\":\"open_tab\",\"pagePath\":\"/gitlab-duo/test/-/merge_requests/522\",\"projectPath\":\"gitlab-duo/test\",\"subTypeLabel\":\"Current page\",\"secondaryText\":\"Page context /gitlab-duo/test/-/merge_requests/522\"}}]},\"response_metadata\":{}},{\"id\":\"lc_run--019e87ad-3ead-73e2-962c-c97217969f07\",\"name\":null,\"type\":\"AIMessage\",\"content\":\"1\",\"tool_calls\":[],\"usage_metadata\":{\"input_tokens\":29127,\"total_tokens\":29132,\"output_tokens\":5,\"input_token_details\":{\"cache_read\":0,\"cache_creation\":29124}},\"additional_kwargs\":{},\"response_metadata\":{\"model_name\":\"claude-sonnet-4-6\",\"finish_reason\":\"stop\"},\"invalid_tool_calls\":[]},{\"id\":null,\"name\":null,\"type\":\"HumanMessage\",\"content\":\"What page am I on?\",\"additional_kwargs\":{\"additional_context\":[{\"id\":\"page-context\",\"content\":\"\\u003ccurrent_gitlab_page_url\\u003ehttp://gdk.test:8080/gitlab-duo\\u003c/current_gitlab_page_url\\u003e\\n\\u003ccurrent_gitlab_page_title\\u003eGitLab Duo · GitLab\\u003c/current_gitlab_page_title\\u003e\",\"category\":\"repository\",\"metadata\":{\"icon\":\"link\",\"title\":\"Current page\",\"enabled\":true,\"subType\":\"open_tab\",\"pagePath\":\"/gitlab-duo\",\"projectPath\":\"\",\"subTypeLabel\":\"Current page\",\"secondaryText\":\"Page context /gitlab-duo\"}}]},\"response_metadata\":{}},{\"id\":\"lc_run--019e87ae-58cc-7cf1-a2bf-fd89baabe995\",\"name\":null,\"type\":\"AIMessage\",\"content\":\"You're on the **GitLab Duo** group page at `http://gdk.test:8080/gitlab-duo`.\",\"tool_calls\":[],\"usage_metadata\":{\"input_tokens\":29249,\"total_tokens\":29281,\"output_tokens\":32,\"input_token_details\":{\"cache_read\":0,\"cache_creation\":29246}},\"additional_kwargs\":{},\"response_metadata\":{\"model_name\":\"claude-sonnet-4-6\",\"finish_reason\":\"stop\"},\"invalid_tool_calls\":[]},{\"id\":null,\"name\":null,\"type\":\"HumanMessage\",\"content\":\"Add a comment to http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522 saying \\\"LLM was here\\\"\",\"additional_kwargs\":{\"additional_context\":null},\"response_metadata\":{}},{\"id\":\"lc_run--019e87b0-7ce7-7fb1-a3f1-1acdfc462383\",\"name\":null,\"type\":\"AIMessage\",\"content\":\"\",\"tool_calls\":[{\"id\":\"toolu_vrtx_0149kT4hb6oJ8Eu63yhgBX1e\",\"args\":{\"url\":\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\",\"body\":\"LLM was here\"},\"name\":\"create_merge_request_note\",\"type\":\"tool_call\"}],\"usage_metadata\":{\"input_tokens\":29321,\"total_tokens\":29421,\"output_tokens\":100,\"input_token_details\":{\"cache_read\":29318,\"cache_creation\":0}},\"additional_kwargs\":{\"tool_calls\":[{\"id\":\"toolu_vrtx_0149kT4hb6oJ8Eu63yhgBX1e\",\"type\":\"function\",\"index\":0,\"function\":{\"name\":\"create_merge_request_note\",\"arguments\":\"{\\\"url\\\": \\\"http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522\\\", \\\"body\\\": \\\"LLM was here\\\"}\"}}]},\"response_metadata\":{\"model_name\":\"claude-sonnet-4-6\",\"finish_reason\":\"tool_calls\"},\"invalid_tool_calls\":[]},{\"id\":null,\"name\":\"create_merge_request_note\",\"type\":\"ToolMessage\",\"status\":\"success\",\"content\":\"{\\\"created_merge_request_note\\\": {\\\"id\\\": 3287, \\\"type\\\": null, \\\"body\\\": \\\"LLM was here\\\", \\\"author\\\": {\\\"id\\\": 1, \\\"username\\\": \\\"root\\\", \\\"public_email\\\": null, \\\"name\\\": \\\"Administrator\\\", \\\"state\\\": \\\"active\\\", \\\"locked\\\": false, \\\"avatar_url\\\": \\\"https://www.gravatar.com/avatar/24ac8438e86aa982df47ce9805b3ea5b437062525ce09fdace4974334bdd326d?s=80\\u0026d=identicon\\\", \\\"web_url\\\": \\\"http://gdk.test:8080/root\\\"}, \\\"created_at\\\": \\\"2026-06-02T09:36:18.991Z\\\", \\\"updated_at\\\": \\\"2026-06-02T09:36:18.991Z\\\", \\\"system\\\": false, \\\"noteable_id\\\": 678, \\\"noteable_type\\\": \\\"MergeRequest\\\", \\\"project_id\\\": 1000000, \\\"resolvable\\\": false, \\\"confidential\\\": false, \\\"internal\\\": false, \\\"imported\\\": false, \\\"imported_from\\\": \\\"none\\\", \\\"noteable_iid\\\": 522, \\\"commands_changes\\\": {}}}\",\"artifact\":null,\"tool_call_id\":\"toolu_vrtx_0149kT4hb6oJ8Eu63yhgBX1e\",\"additional_kwargs\":{},\"response_metadata\":{}},{\"id\":\"lc_run--019e87b0-ea82-7e43-ac9e-53c08e3aa3c1\",\"name\":null,\"type\":\"AIMessage\",\"content\":\"Done! The comment \\\"LLM was here\\\" has been added to [!522](http://gdk.test:8080/gitlab-duo/test/-/merge_requests/522).\",\"tool_calls\":[],\"usage_metadata\":{\"input_tokens\":29721,\"total_tokens\":29766,\"output_tokens\":45,\"input_token_details\":{\"cache_read\":29124,\"cache_creation\":596}},\"additional_kwargs\":{},\"response_metadata\":{\"model_name\":\"claude-sonnet-4-6\",\"finish_reason\":\"stop\"},\"invalid_tool_calls\":[]}]}},\"channel_versions\":{\"goal\":2,\"plan\":2,\"status\":23,\"project\":2,\"approval\":12,\"is_retry\":21,\"__start__\":2,\"namespace\":2,\"ui_chat_log\":23,\"denied_tools\":21,\"branch:to:agent\":23,\"last_human_input\":2,\"preapproved_tools\":21,\"branch:to:run_tools\":22,\"conversation_history\":23},\"updated_channels\":[\"conversation_history\",\"status\",\"ui_chat_log\"]}"
last_checkpoint = Ai::DuoWorkflows::Checkpoint.last
last_workflow = last_checkpoint.workflow
last_workflow.checkpoints.create!(
thread_ts: Time.current.iso8601(6),
parent_ts: last_checkpoint.thread_ts,
checkpoint: JSON.parse(checkpoint_string),
metadata: last_checkpoint.metadata
)Make the following graphQL query in http://gdk.test:8080/-/graphql-explorer:
query getWorkflowLatestCheckpoint($workflowId: AiDuoWorkflowsWorkflowID!) {
duoWorkflowWorkflows(workflowId: $workflowId) {
nodes {
id
status
aiCatalogItemVersionId
workflowDefinition
archived
stalled
latestCheckpoint {
workflowGoal
workflowStatus
errors
duoMessages {
content
messageType
messageSubType
status
toolInfo
timestamp
correlationId
messageId
role
additionalContext {
category
id
content
metadata
}
alternatives {
userMessage {
messageId
messageType
content
additionalContext {
category
id
content
metadata
}
}
agentResponses {
messageId
messageType
content
status
toolInfo
timestamp
}
}
}
}
}
}
}With the variables:
{
"workflowId": "gid://gitlab/Ai::DuoWorkflows::Workflow/2359"
}ID can be found in the Session Storage of the application tab:
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.



