Repository navigation
Conversation
…d conversations missing from the index - sync: copyIfNewer always removes its temp file. On Windows, renameSync throws (EPERM/EBUSY) while another process holds the destination open; it now retries, then falls back to a direct copy, so a failure never leaves a full *.jsonl.tmp.<pid> copy behind (obra#199). - verify: a conversation that has a real (non-empty, non-errored) summary but no rows in the index is reported as `unindexed` (for example after the database was rebuilt, for sessions that only exist in the archive). repair indexes it without summarizing it again. `index-cli verify` prints the count (obra#200). - test: tmp-cleanup-and-unindexed.test.ts covers both cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #199 and #200.
#199: orphan
*.jsonl.tmp.<pid>copies on WindowscopyIfNewer(src/sync.ts) copies to a temp file, then callsrenameSyncover the archive copy. On Windows that rename throws (EPERM/EBUSY) while another process holds the destination open, and the temp file was never removed. One install had accumulated 1,861 of them, about 98 GB, nearly all of them byte-identical to their final file or a prefix of it.The rename now runs in a
try/finallythat always removes the temp file. It is retried a few times with a short backoff, then falls back to a directcopyFileSynconto the destination.#200: archived conversations that are never re-indexed
verifyIndexflags a conversation only when its summary is missing or errored, or when it is already indexed and outdated. A conversation with a real summary and no row inexchanges(lastIndexed === null) fell through both checks. That happens after the database is rebuilt, for sessions that only exist in the archive because Claude Code already cleaned them from~/.claude/projects.VerificationResultgainsunindexed.repairIndexindexesunindexedconversations without calling the summarizer, since their summary already exists. Missing and outdated conversations behave as before.index-cli verifyprintsNot in index: Nand counts it as an issue.Tests
test/tmp-cleanup-and-unindexed.test.ts:renameSyncmocked to throw EPERM: the archive copy is complete and no.tmpis left;unindexed(an empty-summary one is not), andrepairindexes it without summarizing; a secondverifyreports nothing.Both tests fail on
mainand pass with this change.On Windows 11 with Node 26, the full suite gives the same 5 failures with and without this change, in
file-lock,mcp-install-runner,parserandshow. They are unrelated to this PR and already fail onmainthere.dist/is rebuilt for the four changed modules only.Not included
#198 (tool_call duplication) is closed:
ON DELETE CASCADEfrom #81 already prevents it on v1.6.0.