Skip to content

fix(cli): init reports an incomplete index instead of 'Already initialized' (#3228) - #3282

Open
LuisAlbertoMK wants to merge 1 commit into
colbymchenry:mainfrom
LuisAlbertoMK:fix/init-partial-index
Open

LuisAlbertoMK wants to merge 1 commit into
colbymchenry:mainfrom
LuisAlbertoMK:fix/init-partial-index

Conversation

@LuisAlbertoMK

Copy link
Copy Markdown

Follow-up to #3223.

When a first index stops partway (OOM, killed mid-index, etc.), the schema can be present while the index is incomplete. \codegraph init\ then printed 'Already initialized in ' with no hint that the index is incomplete, so it read like a working setup that just needed updating.

Now
unInit\ opens the project read-only and checks \getIndexState(). When the state is not 'complete' (e.g. 'indexing', 'partial', 'failed'), it warns that the last run did not finish and tells the user to run \codegraph index\ to rebuild. Otherwise it keeps the previous 'Already initialized' message.

Added a test in cli-install-init.test.ts that seeds index_state='indexing' and asserts the new message (and that 'Already initialized' is not printed).

Tested: tsc --noEmit clean, npm run build, focused cli-install-init suite (5 tests pass).

This branch has not been deployed

No deployments
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