Skip to content

Add cache-only message

Jan Provaznik requested to merge jp-reset-cache into master

What does this MR do and why?

Checks for a special "/reset" message which is only stored in cache but not sent as AI async request. The use-case is to put a "marker" into chat history to delimit start of the context.

  • when user clicks "Start a new chat" button (from design demo in https://gitlab.com/gitlab-org/gitlab/-/issues/413211#proposed-solution-iteration-1), the chat just uses same GraphQL API endpoint used for sending any other messages
  • it's effectively same as if user would type "/reset" in input
  • on BE side if we recognize this "special" message, we just store "reset session" mark in user's cached messages stream. Then later when we start sending previous messages (as part of follow-up questions), we will use this "special" message to send only messages after this delimiter.
  • on FE side special handling of "/reset" is needed - if FE recognizes this message, it should rather render "new chat line" instead of showing the message as a regular user's message

Another option would be to add a separate mutation for handling "reset" of chat conversation.

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/413211

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

Numbered steps to set up and validate the change are strongly suggested.

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 Jan Provaznik

Merge request reports