Skip to content

[Code Embeddings Query] Trigger ad-hoc indexing worker

Context

As part of &19655, we are going to implement ad-hoc embeddings indexing of projects.

With ad-hoc indexing, it's possible that a user asks a question about a project, Agentic Chat triggers the SemanticCodeSearch tool, and it turns out that a project does not have code embeddings yet. In this scenario we need to:

  1. In Ai::ActiveContext::Queries::Code, check whether the Ai::ActiveContext::Code::Repository record for the project exists (issue: #576632 (closed))
  2. If it does not exist
    • Trigger the AdHocIndexingWorker - THIS ISSUE
    • Return a response that the record does not exist yet (issue: #576632 (closed))

Proposal

In Ai::ActiveContext::Queries::Code, trigger the AdHocIndexingWorker if the Ai::ActiveContext::Code::Repository.

Note: this is dependent on the AdHocIndexingWorker already being introduced.

Edited by 🤖 GitLab Bot 🤖