Skip to content

Conversation

@mjbvz
Copy link
Contributor

@mjbvz mjbvz commented Jan 29, 2026

Copilot AI review requested due to automatic review settings January 29, 2026 01:09
@mjbvz mjbvz enabled auto-merge January 29, 2026 01:09
@vs-code-engineering vs-code-engineering bot added this to the January 2026 milestone Jan 29, 2026
@dmitrivMS
Copy link
Contributor

@mjbvz CI is unhappy...

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Surfaces external ingest (non-code-search) indexing state in the remote indexing status so the chat status item can reflect external ingest progress.

Changes:

  • Added external ingest status shape + state-change eventing to ExternalIngestIndex.
  • Extended CodeSearchRemoteIndexState to include externalIngestState and wired it through getRemoteIndexState().
  • Updated the workspace indexing status item to show “building” when external ingest is building.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/platform/workspaceChunkSearch/node/codeSearch/externalIngestIndex.ts Adds ExternalIngestStatus, state tracking, and an event to notify UI/state consumers about progress.
src/platform/workspaceChunkSearch/node/codeSearch/codeSearchChunkSearch.ts Plumbs external ingest state into getRemoteIndexState() and forwards external ingest state changes into the existing index-state event.
src/extension/workspaceChunkSearch/vscode-node/workspaceIndexingStatus.ts Displays external ingest “building” progress in the chat status item.
Comments suppressed due to low confidence (1)

src/platform/workspaceChunkSearch/node/codeSearch/externalIngestIndex.ts:106

  • getState() reports CodeSearchRepoStatus.Ready whenever _currentIngestOperation.completed is true, even if the ingest operation failed (checkpoint not updated) and _currentIngestOperation is never cleared. This can make the UI show “Ready” after an error. Consider tracking the final Result/success flag (or clearing _currentIngestOperation on completion) and deriving the post-completion status from the checkpoint / last result instead of always returning Ready.
	public getState(): ExternalIngestStatus {
		if (this._currentIngestOperation) {
			if (this._currentIngestOperation.completed) {
				return {
					status: CodeSearchRepoStatus.Ready,
					progressMessage: undefined,
				};
			} else {
				return {
					status: CodeSearchRepoStatus.BuildingIndex,
					progressMessage: this._currentIngestOperation.progressMessage,
				};
			}

Comment on lines +243 to +248
// Track building state
const operation: typeof this._currentIngestOperation = {
promise: undefined!,
progressMessage: undefined,
completed: false,
};
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

operation is created with promise: undefined! and later mutated via a cast to bypass the readonly promise field. This weakens type safety and makes the state tracking harder to reason about. Consider restructuring so the promise field is assigned normally (e.g., make it non-readonly or build the object after updatePromise is created) to avoid the non-null assertion and cast.

Copilot uses AI. Check for mistakes.

if (this.isExternalIngestEnabled() === 'force') {
return {
status: '',
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeSearchRemoteIndexState.status is a string union ('disabled' | 'initializing' | 'loaded'), but this branch returns status: '', which is not a valid value and should fail type-checking. If “force external ingest only” should still be treated as a loaded/initializing remote-index state, return one of the existing union values (and include externalIngestState as needed).

Suggested change
status: '',
status: 'loaded',

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +159
// All repos are ready, check if external ingest is building
if (state.remoteIndexState.externalIngestState?.status === CodeSearchRepoStatus.BuildingIndex) {
return this._writeStatusItem({
title: remotelyIndexedMessage,
details: {
message: state.remoteIndexState.externalIngestState.progressMessage || t('Building'),
busy: true,
},
});
}
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This external ingest “BuildingIndex” UI check runs before verifying that all repos are Ready (and before the checks for CheckingStatus / BuildingIndex on repos). As written, it can surface external ingest progress even while one or more repos are still building/checking, which can mask the more relevant repo status. Consider gating this on repos.every(...Ready) or moving it after the repo-status checks.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants