Request only the current model in the Code indexing queue

What does this MR do and why?

During an embedding-model migration, the semantic-search Code indexing queue requested embeddings for both the current and next model in a single batch call. If the next-model call failed, the whole batch was discarded and retried, including any current-model result that had already succeeded.

This merge request makes the Code queue request only the current model, the same way CodeBackfill already requests only the next model. CodeBackfill remains solely responsible for backfilling the next model onto existing content. The generic Retry queue chain is unchanged and still requests both models.

Related to #548766 (closed)

How to set up and validate locally

  1. In a Rails console:
    collection = Ai::ActiveContext::Collections::Code.collection_record
    collection.update_metadata!(
      next_indexing_embedding_model: collection.current_indexing_embedding_model.merge('field' => 'test_next')
    )
    
    ref = Ai::ActiveContext::References::Code.serialize(
      collection_id: collection.id, routing: <project_id>, data: { id: <indexed_id> }
    )
    Ai::ActiveContext::Queues::Code.push([ref])
    Ai::ActiveContext::BulkProcessWorker.new.perform('Ai::ActiveContext::Queues::Code', 0)
  2. Confirm only the current model's field gets requested — the next model is never touched.
Edited by Arturo Herrero

Merge request reports

Loading
Loading