qmd/test
Tobi Lutke c5f4217a6f
fix(cli): exit naturally so node-llama-cpp's beforeExit fires
The libggml-metal static destructor asserts on a non-empty residency-set
collection during __cxa_finalize_ranges, dumping a multi-kB GGML backtrace
after successful output (ggml-org/llama.cpp#22593, one-line fix open as
PR #22595). The assertion only trips when process.exit() skips Node's
beforeExit hook — which is exactly the hook node-llama-cpp registers to
auto-dispose its native handles.

Primary fix: finishSuccessfulCliCommand now sets process.exitCode = 0
and returns instead of calling process.exit(0). The event loop drains,
beforeExit fires, native Metal resources tear down in order, and the
process exits cleanly even without the workaround env var.

Defense-in-depth retained: bin/qmd and scripts/test-all.mjs still export
GGML_METAL_NO_RESIDENCY=1 on darwin for error paths and tests that
terminate via process.exit(). Opt back in with QMD_METAL_KEEP_RESIDENCY=1.

Also: correct upstream issue refs (was #17869 → now #22593/#22595).
Add scripts/repro-metal-rsets-crash.mjs minimal reproduction.
2026-05-28 17:23:31 -07:00
..
eval-docs Add 6 synthetic evaluation documents 2025-12-21 13:10:35 -04:00
ast-chunking.test.ts chore: migrate AST chunking tests to vitest 2026-04-05 17:19:59 -04:00
ast.test.ts Fix AST grammar packaging for Bun installs 2026-05-09 18:13:58 +00:00
bench-score.test.ts feat: support project-local indexes in bench 2026-05-16 18:22:04 +00:00
bin-wrapper.test.ts fix(launcher): prefer Node+tsx over Bun in source mode when both lockfiles exist 2026-05-28 11:57:30 -07:00
cli-exit-lifecycle.test.ts fix(cli): exit naturally so node-llama-cpp's beforeExit fires 2026-05-28 17:23:31 -07:00
cli-lazy-llm-import.test.ts fix(cli): keep status from importing llama 2026-05-09 18:12:45 +00:00
cli.test.ts fix: disable libggml-metal residency sets on darwin 2026-05-28 13:40:14 -07:00
collections-config.test.ts feat: add local init and doctor diagnostics 2026-05-19 14:27:33 -04:00
Containerfile Expand install smoke harness 2026-05-19 23:05:49 +00:00
esm-ambiguous-module.test.ts chore: strengthen package test task 2026-05-19 14:27:38 -04:00
eval-bm25.test.ts test: move all tests to flat test/ directory 2026-02-15 21:37:47 -04:00
eval-deep-research.jsonl Merge origin/main into feat/ast-aware-chunking 2026-03-28 20:00:49 -04:00
eval-deep-research.ts Merge origin/main into feat/ast-aware-chunking 2026-03-28 20:00:49 -04:00
eval-harness.ts refactor: move CLI and MCP to subdirectories, MCP consumes SDK 2026-03-10 11:39:55 -04:00
eval.test.ts test: move all tests to flat test/ directory 2026-02-15 21:37:47 -04:00
formatter.test.ts Add line to JSON search output 2026-04-05 10:08:57 +00:00
intent.test.ts refactor: move CLI and MCP to subdirectories, MCP consumes SDK 2026-03-10 11:39:55 -04:00
launcher-detection.test.sh fix: prioritize package-lock.json in launcher to prevent Bun false positive 2026-03-12 01:46:38 -07:00
llm.test.ts Improve qmd diagnostics and embed resilience 2026-05-19 21:39:48 +00:00
local-config.test.ts Fix QMD CI test runtime assumptions 2026-05-16 23:52:53 +00:00
mcp.test.ts feat: add qmd doctor vector diagnostics 2026-05-18 01:52:05 +00:00
multi-collection-filter.test.ts refactor: replace bash wrapper with standard #!/usr/bin/env node shebang 2026-02-22 11:09:36 -04:00
package.test.ts docs(qmd-skill): structured-query-first; cite docid + lines; no sed 2026-05-28 10:56:13 -07:00
rrf-trace.test.ts feat(query): add --explain score traces for hybrid search 2026-03-07 14:35:10 -04:00
sdk.test.ts fix: forward candidateLimit through search APIs 2026-05-11 20:25:34 -10:00
smoke-install.sh Expand install smoke harness 2026-05-19 23:05:49 +00:00
store-paths.test.ts test: move all tests to flat test/ directory 2026-02-15 21:37:47 -04:00
store.helpers.unit.test.ts fix: preserve original case in handelize() 2026-04-09 07:59:22 +09:00
store.test.ts feat(search,query): --full-path swaps qmd:// for on-disk paths 2026-05-28 11:18:03 -07:00
structured-search.test.ts Merge pull request #384 from rymalia/fix/semantic-query-hyphen-validation 2026-05-02 20:16:30 -04:00