Skip to content

Include Pinned MR content in Chat - Backend

Add support of Merge Requests to additional context for Duo Chat.

Implementation details

Currently, I (@ck3g) see at least two solutions we can use to achieve this functionality.

Solution 1️⃣

Utilize Claude Tools to fetch information about merge requests.

  1. Introduce a new category MERGE_REQUEST
  2. On the AIGW side, when the category is MR, call a tool to read information about the MR.

We already have some tools described here https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/blob/main/ai_gateway/chat/tools/gitlab.py

However, I am concerned about how this solution will work for self-managed GitLab instances when they are not public. The LLM and AIGW might not have access to the instance to fetch any MR-related information.

Solution 2️⃣

Fetch MR information on the Rails Monolith.

  1. Introduce a new category MERGE_REQUEST
  2. Iterate through additional context before passing it to AIGW
  3. If MR information is present, fetch the MR's title and description from the database and add it to the content field. That should be fast, since all the information is present in the DB.
  4. Use the content on AIGW to add MR information in the prompt.

Solution 3️⃣

Fetch MR information within the language server.

Edited by Elwyn Benson