Skip to content

Do not broadcast AI responses twice

Nicolas Dular requested to merge nd/de-duplicate-summarize-issue-in-chat into master

What does this MR do and why?

Do not broadcast AI responses twice

When the Agent picks the SummarizeComments tool, we are internally calling the GenerateSummaryService, which also stores the response to the cache and broadcasts it via the GraphQL subscription.

With skip_cache: true we were already able to not store the response to the cache. This change renames the skip_cache option to internal_request and also no longer broadcasts the response to the client, which resulted in duplicated responses in the chat.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Set up AI features locally, including the feature flag gitlab_duo
  2. Go to an issue
  3. Open the chat
  4. Ask the chat to "summarize this issue"
  5. Responses are no longer sent twice

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Nicolas Dular

Merge request reports

Loading