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:
- After calling
AdHocIndexingWorker, we had a hardcoded true return which means we always displayMESSAGE_INITIAL_INDEXING_STARTEDeven if the indexing was not successful (e.g. if the namespace wasn't eligible or an error occurred). This MR changes it to return whatAdHocIndexingWorkerreturns. - We should check if an enabled namespace is in the ready state before performing ad-hoc indexing for the namespace.
SaasInitialIndexingEventWorkernow 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 |
|---|---|
|
|
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 startedmessage on this branch vs.initial indexing has been started, try again in a few minuteson 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

