fix(cli): report orphaned embedding vectors and add cleanup --dry-run - #851
Merged
Conversation
…#768) Incremental update still does not auto-prune vectors (a transient empty mount would force a full re-embed). Status and update now surface the orphan ratio, and cleanup --dry-run previews what would be removed.
|
Dear tobi/qmd,
We would like to acknowledge that we have received your request and a ticket has been created.
A support representative will be reviewing your request and will send you a personal response.(usually within 24-48 hours).
Thank you for your patience.
…On Thu, Aug 13 2026, at 01:29 AM, tobi/qmd ***@***.***> wrote:
Summary
* Incremental qmd update still does not auto-prune embedding vectors (a transient empty/partial mount would otherwise force a full re-embed). qmd status now reports orphaned embedding chunks (count + percent) when any exist. qmd update prints a hint when orphans exceed 10% of vectors: N orphaned embedding chunks (M% of vectors) — run 'qmd cleanup' to reclaim space. qmd cleanup --dry-run previews cache/orphan/inactive/vacuum work without changing the database. Fixes #768 (#768)
Test plan bun test test/store.helpers.unit.test.ts (countOrphanedVectors + existing cleanupOrphanedVectors) bun test test/cli.test.ts -t "orphaned embedding vectors|CLI Cleanup Command|CLI Status Command|CLI Update Command" node ./node_modules/vitest/vitest.mjs run test/store.helpers.unit.test.ts test/cli.test.ts -t "orphaned embedding vectors|CLI Cleanup Command|countOrphanedVectors" CI Bun/Node unit tests green (ignore pre-existing nix flake hash mismatches) You can view, comment on, or merge this pull request online at: #851 (#851) Commit Summary 20299b9 fix(cli): report orphaned embedding vectors and add cleanup --dry-run (#768) (20299b9) File Changes
( 5 files) (https://github.com/tobi/qmd/pull/851/files) M CHANGELOG.md
(5) (https://github.com/tobi/qmd/pull/851/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed) M src/cli/qmd.ts
(43) (https://github.com/tobi/qmd/pull/851/files#diff-e7252cdb14bd10e7feaedc038d3506947354fe9b644cd034e37a7f39c580859f) M src/store.ts
(42) (https://github.com/tobi/qmd/pull/851/files#diff-2717c7fb31c2070dd96f07394997809bc9be7f3fff03ab638db696cc480f39b6) M test/cli.test.ts
(90) (https://github.com/tobi/qmd/pull/851/files#diff-1deee0a575599b2df117c280da319f7938aaf6fdb0c04bcdbde769dbf464be69) M test/store.helpers.unit.test.ts
(21) (https://github.com/tobi/qmd/pull/851/files#diff-ee2e697b3b8fd5a3ffc8512c1b66a3a95181f458fcca811a807feee58e058046) Patch Links: https://github.com/tobi/qmd/pull/851.patch (https://github.com/tobi/qmd/pull/851.patch) https://github.com/tobi/qmd/pull/851.diff (https://github.com/tobi/qmd/pull/851.diff)
—
Reply to this email directly, view it on GitHub, or (#851?email_source=notifications&email_token=BRF3HG7MUXZE33KUEXTC56D5JUKXXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENRXGMYDGNJVGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVRTG633UMVZF6Y3MNFRWW) unsubscribe. (https://github.com/notifications/unsubscribe-auth/BRF3HG7VI4VKSCUIPAQUL2T5JUKXXAVCNFSNUABGKJSXA33TNF2G64TZHMYTCMJSGM3DKMZQGE5US43TOVSTWNJRGM3DQNBVGQ2TTILWAI)
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and (https://github.com/notifications/mobile/ios/BRF3HGZLVDQBVWPPRUVDU535JUKXXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENRXGMYDGNJVGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVJTG633UMVZF62LPOM) Android. Download it today! (https://github.com/notifications/mobile/android/BRF3HG6FHAGBG4TB7OGT4NL5JUKXXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENRXGMYDGNJVGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVZTG633UMVZF6YLOMRZG62LE)
You are receiving this because you are subscribed to this thread. Message ID: <tobi/qmd/pull/851 @ github . com> [
{
***@***.***": "http://schema.org",
***@***.***": "EmailMessage",
"potentialAction": {
***@***.***": "ViewAction",
"target": "#851?email_source=notifications\u0026email_token=BRF3HG4U66GPENNGAA3WGBL5JUKXXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENRXGMYDGNJVGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"url": "#851?email_source=notifications\u0026email_token=BRF3HG4U66GPENNGAA3WGBL5JUKXXA5CNFSNUABEM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UF42DENRXGMYDGNJVGSTHEZLBONXW5KTTOVRHGY3SNFRGKZFFMV3GK3TUVNTW2YLJNRPWG3DJMNVQ",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
***@***.***": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
|
This was referenced Aug 13, 2026
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.
Summary
qmd updatestill does not auto-prune embedding vectors (a transient empty/partial mount would otherwise force a full re-embed).qmd statusnow reports orphaned embedding chunks (count + percent) when any exist.qmd updateprints a hint when orphans exceed 10% of vectors:N orphaned embedding chunks (M% of vectors) — run 'qmd cleanup' to reclaim space.qmd cleanup --dry-runpreviews cache/orphan/inactive/vacuum work without changing the database.Fixes #768
Test plan
bun test test/store.helpers.unit.test.ts(countOrphanedVectors + existing cleanupOrphanedVectors)bun test test/cli.test.ts -t "orphaned embedding vectors|CLI Cleanup Command|CLI Status Command|CLI Update Command"node ./node_modules/vitest/vitest.mjs run test/store.helpers.unit.test.ts test/cli.test.ts -t "orphaned embedding vectors|CLI Cleanup Command|countOrphanedVectors"