Skip to content

fix: remove stale chunks for empty reingest - #23

Merged
haolpku merged 1 commit into
OpenDCAI:mainfrom
DevChiniwala:codex/fix-empty-kb-reingest
Sep 20, 2026
Merged

haolpku merged 1 commit into
OpenDCAI:mainfrom
DevChiniwala:codex/fix-empty-kb-reingest

Conversation

@DevChiniwala

Copy link
Copy Markdown
Contributor

KB source replacement removed stale chunks when a file changed to new non-empty content, but an empty revision returned before cleanup and left the previous content searchable. Route empty revisions through the existing source-replacement cleanup so the live index and manifest reflect the current source. Added a deterministic re-ingest regression with a fake vector store. Validation: 2 KB ingest revision tests passed; no public API or index schema change; targets main.

Copilot AI lite review requested due to automatic review settings September 17, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@haolpku haolpku left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes because the empty-reingest path still calls provider.embed_texts([]) at the start of _upsert_chunks before reaching the new if not chunks branch. Real embedding APIs may reject an empty input even though the fake test accepts it, so stale chunks would remain. Please handle the empty replacement before embedding and add a provider fake that raises if called with an empty list.

@haolpku
haolpku merged commit 867fff9 into OpenDCAI:main Sep 20, 2026
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