-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Surface external index state in status item too #3257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@mjbvz CI is unhappy... |
There was a problem hiding this 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
CodeSearchRemoteIndexStateto includeexternalIngestStateand wired it throughgetRemoteIndexState(). - 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()reportsCodeSearchRepoStatus.Readywhenever_currentIngestOperation.completedis true, even if the ingest operation failed (checkpoint not updated) and_currentIngestOperationis never cleared. This can make the UI show “Ready” after an error. Consider tracking the final Result/success flag (or clearing_currentIngestOperationon completion) and deriving the post-completion status from the checkpoint / last result instead of always returningReady.
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,
};
}
| // Track building state | ||
| const operation: typeof this._currentIngestOperation = { | ||
| promise: undefined!, | ||
| progressMessage: undefined, | ||
| completed: false, | ||
| }; |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
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.
|
|
||
| if (this.isExternalIngestEnabled() === 'force') { | ||
| return { | ||
| status: '', |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
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).
| status: '', | |
| status: 'loaded', |
| // 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, | ||
| }, | ||
| }); | ||
| } |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
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.
For microsoft/vscode#290782