Skip to content

Small updates to ActiveContext Code ad-hoc indexing

What does this MR do and why?

Two small fixes I found while testing the ad-hoc indexing end-to-end:

  1. After calling AdHocIndexingWorker, we had a hardcoded true return which means we always display MESSAGE_INITIAL_INDEXING_STARTED even if the indexing was not successful (e.g. if the namespace wasn't eligible or an error occurred). This MR changes it to return what AdHocIndexingWorker returns.
  2. We should check if an enabled namespace is in the ready state before performing ad-hoc indexing for the namespace. SaasInitialIndexingEventWorker now creates records in ready state so it doesn't functionally affect the flow.

Screenshots or screen recordings

When indexing is attempted but fails (in this case I disabled the feature flag active_context_code_index_project):

Before After
Screenshot_2025-11-03_at_15.43.55 Screenshot_2025-11-03_at_15.46.36

How to test

  • Follow Test semantic_code_search MCP tool locally
  • Ensure repository record for the project does not exist
  • Test the tool -> it should show the initial indexing was attempted but could not be started message on this branch vs. initial indexing has been started, try again in a few minutes on master

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.

Edited by Madelein van Niekerk

Merge request reports

Loading