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.
1️⃣
Solution Utilize Claude Tools to fetch information about merge requests.
- Introduce a new category
MERGE_REQUEST
- 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.
2️⃣
Solution Fetch MR information on the Rails Monolith.
- Introduce a new category
MERGE_REQUEST
- Iterate through additional context before passing it to AIGW
- 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. - Use the
content
on AIGW to add MR information in the prompt.
3️⃣
Solution Fetch MR information within the language server.
Edited by Elwyn Benson