Skip to content

fix(cli): load persisted index only when needed - #25

Merged
JohnXu22786 merged 2 commits into
mainfrom
bug/cli-load-persisted-index-before-commands
Sep 12, 2026
Merged

JohnXu22786 merged 2 commits into
mainfrom
bug/cli-load-persisted-index-before-commands

Conversation

@JohnXu22786

@JohnXu22786 JohnXu22786 commented Sep 12, 2026

Copy link
Copy Markdown
Owner

What this PR does

Before this PR:

Standalone reindex and stats commands created a fresh SearchIndex without loading persisted state. Incremental reindex therefore rebuilt the workspace fully, while stats reported an empty in-memory index.

After this PR:

Incremental reindex and stats load persisted state before operating. reindex --full skips initialization because the full rebuild discards the loaded state, avoiding redundant memory and I/O. Focused CLI regressions cover persisted refresh/stat reporting and the full-rebuild initialization guard.

Type of change

Bug fix

Breaking changes (if any)

None.

Standalone reindex and stats commands construct a fresh SearchIndex. Initialize it before refreshing or reading stats so persisted files and chunks are available.
A full rebuild discards all loaded state, so initializing first only adds unnecessary memory and I/O. Keep initialization for incremental refreshes while avoiding the redundant load for --full.
@JohnXu22786 JohnXu22786 changed the title fix(cli): load persisted index before reindex and stats fix(cli): load persisted index only when needed Sep 12, 2026
@JohnXu22786
JohnXu22786 marked this pull request as ready for review September 12, 2026 11:17
@JohnXu22786
JohnXu22786 merged commit 35ed705 into main Sep 12, 2026
2 checks passed
@JohnXu22786
JohnXu22786 deleted the bug/cli-load-persisted-index-before-commands branch September 12, 2026 11:17
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.

1 participant