Skip to content

Do not store chat messages by default

Nicolas Dular requested to merge nd/do-not-cache-ai-actions into master

What does this MR do and why?

Related issue: #419596 (closed)

We no longer want to store and show AI messages on the chat, if not explicitly enabled by the feature. It is now only enabled for the chat AI action. We do this by setting skip_cache = true by default.

It also fixes a bug where the skip_cache was not passed along properly to the GraphqlSubscriptionResponseService.

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. Enable AI features https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally
  2. Feature.enable(:gitlab_duo, true)
  3. Go to a page that has AI features, e.g. Vulnerabilities, or an Issue.
  4. Use the AI feature, e.g. summarize issues or Explain Vulnerabilities
  5. Refresh the browser and Open the GitLab Duo chat
    1. This is a necessity to test the feature, because right now, the chat listens on the AiCompletionResponseSubscription - and adds it to the chat, regardless of the action performed. This is another problem that needs to be tackled, also see #413600 (comment 1485444913)
  6. Before: You'd see the answer from the AI in the chat, Now: You no longer see the response because we don't store the message for the chat.

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