Duo Agentic Chat loses context data after protobuf contract update

Summary

The additionalContext field is not being sent from the browser to the Duo Workflow Service, causing context information (like current page URL and title) to be lost. This is a regression introduced by protobuf contract changes in GitLab 18.7.

Steps to Reproduce

  1. Open Duo Agentic Chat in the browser
  2. Send a message that triggers a workflow that references this such as "What is this MR?"
  3. Observe that the Agentic Chat does not have access to the MR you're referencing.

Current Behavior

The browser sends:

{ startRequest: { additionalContext: [ { content: "<current_gitlab_page_url>...</current_gitlab_page_url>...", category: "repository", metadata: "{}" } ] } }

But the Duo Workflow Service receives the field as undefined or empty.

Expected Behavior

The additionalContext should be successfully transmitted to the Duo Workflow Service and be available for use in workflows.

Root Cause

The issue may have been introduced by gitlab-org/modelops/applied-ml/code-suggestions/ai-assist!4001 (merged), which added explicit json_name annotations to the protobuf contract to fix snake_case conversion issues.

The protobuf contract now explicitly requires the JSON field name to be additional_context (snake_case), but the JavaScript code in ee/app/assets/javascripts/ai/duo_agentic_chat/utils/workflow_socket_utils.js is still using additionalContext (camelCase).

Before MR !4001 (merged):

  • Protobuf allowed both additionalContext (camelCase) and additional_context (snake_case) in JSON

After MR !4001 (merged):

  • Protobuf explicitly requires additional_context (snake_case) via json_name annotation
  • The JavaScript code was not updated to match this requirement
Edited by 🤖 GitLab Bot 🤖