CodebaseSearch: Handle non-empty repository and directory content

What does this MR do and why?

Background:

Currently, the Language Server sets the content of the repository and directory additional contexts as empty strings (see repository.ts & directory.ts code in LSP).

In Add content to the `repository` and `directory`... (gitlab-org/editor-extensions/gitlab-lsp#1776 - closed), we are going to update the payloads of the repository and directory additional contexts and add information to their respective content fields (see draft MR: gitlab-org/editor-extensions/gitlab-lsp!2578 (merged)). This upcoming update would ensure that Agentic Chat has access to the repository or directory information like Project Path or Directory Path.

The CodebaseSearch tool for Classic Duo Chat currently already appends these kinds of information to the content field.

Change:

In this MR, we update Classic Chat's CodebaseSearch tool to override the content coming from the Language Server. This way, repository or directory additional contexts will not end up with duplicate information.

References

See links in description.

Screenshots or screen recordings

N/A

How to set up and validate locally

N/A - as this is a very small change, the unit tests should cover the validation

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #569625 (closed)

Edited by Pam Artiaga

Merge request reports

Loading