Commit Graph

479 Commits

Author SHA1 Message Date
Tobi Lütke
e627ca7de6
test: allow slow CPU rerank fixture 2026-05-09 18:20:26 +00:00
Tobi Lütke
ddc969a5f4
fix embed model and qmd home resolution 2026-05-09 18:17:10 +00:00
Tobi Lütke
b775592230
fix mcp --index store selection 2026-05-09 18:16:02 +00:00
Tobi Lütke
e8229d8bfb
Fix Windows CUDA context parallelism 2026-05-09 18:15:39 +00:00
Tobi Lütke
dff6513693
Preserve document IDs across case-only renames 2026-05-09 18:15:15 +00:00
Tobi Lütke
656707c6b4
Fix Node ESM index path normalization 2026-05-09 18:14:33 +00:00
Tobi Lütke
3653f6015c
Fix MCP stdio native log pollution 2026-05-09 18:14:15 +00:00
Tobi Lütke
3f055e705d
Fix AST grammar packaging for Bun installs 2026-05-09 18:13:58 +00:00
Tobi Lütke
004714af48
Fix hybrid RRF weighting by query type 2026-05-09 18:13:38 +00:00
Tobi Lütke
92aaded36e
fix(store): preserve inactive docs during orphan cleanup 2026-05-09 18:13:01 +00:00
Tobi Lütke
5b9f472849
fix(embed): honor collection filter 2026-05-09 18:12:45 +00:00
Tobi Lütke
d045a8bab6
fix(search): support CJK FTS queries 2026-05-09 18:12:45 +00:00
Tobi Lütke
3d991b2a47
fix(cli): keep status from importing llama 2026-05-09 18:12:45 +00:00
Tobias Lütke
d58fedf4b5
Merge pull request #579 from lukeboyett/fix/db-transaction-type
fix(db): declare transaction() on local Database interface
2026-05-02 20:16:33 -04:00
Tobias Lütke
06218b1cc5
Merge pull request #384 from rymalia/fix/semantic-query-hyphen-validation
fix: allow hyphenated words in vec/hyde queries (#383)
2026-05-02 20:16:30 -04:00
Tobias Lütke
a2fcac8225
Merge pull request #602 from fxstein/fix/mcp-production-mode-test-leak
fix(mcp): do not enable production mode at module import time
2026-05-02 20:16:27 -04:00
Pi
a0c460333b fix(cli): do not enable production mode at module import time
src/cli/qmd.ts has the same module-scope enableProductionMode() call that
src/mcp/server.ts had — and the same test-isolation leak. test/cli.test.ts
imports buildEditorUri and termLink from this module, which executes the
top-level enableProductionMode() as a side effect of import, flipping the
global _productionMode flag for every later test file in the Bun process.

This is the actual driver of the Store Creation > createStore throws
without explicit path in test mode failure — test/cli.test.ts runs
alphabetically before test/store.test.ts, so the flag is already true by
the time store.test.ts checks it.

Mirror the fix applied to src/mcp/server.ts in the previous commit: move
enableProductionMode() from module scope into the if (isMain) guard so
the flag is only flipped when qmd is actually invoked as the CLI
entrypoint, not when the module is imported for its exports.
2026-04-23 17:41:10 +00:00
Pi
54262f566c fix(mcp): do not enable production mode at module import time
The top-level enableProductionMode() call added in #537 fixed a real issue
(MCP server resolving the wrong database path at startup) but introduced
test-isolation breakage as a side effect: merely importing src/mcp/server.ts
flipped the global _productionMode flag, which then broke unrelated tests
that depend on the default (development) database path resolution.

This shows up concretely as "Store Creation > createStore throws without
explicit path in test mode" failing on Bun (ubuntu-latest) in CI, because
test/mcp.test.ts imports startMcpHttpServer from this module.

Move the enableProductionMode() call from module scope into the two server
entry points (startMcpServer and startMcpHttpServer). The fix originally
intended by #537 — ensuring production mode is active before getDefaultDbPath
runs — is preserved because both call sites still flip the flag before
createStore / getDefaultDbPath. Importing the module for its exports no longer
mutates global state.

Verified locally against current main: CI failure on Bun (ubuntu-latest)
reproduces on unmodified upstream main (14+ consecutive failed runs since
#537 merged on 2026-04-09) and is resolved by this change.

Refs: #537
2026-04-23 15:57:02 +00:00
Tobias Lütke
e8de7cab02 fix(cli): make status device probe opt-in 2026-04-21 21:45:52 -04:00
Luke Boyett
d231b64617 fix(db): declare transaction() on local Database interface
The narrow cross-runtime Database interface in src/db.ts defines the
subset of better-sqlite3 / bun:sqlite methods used throughout QMD.
Commit fee576b ("fix: migrate legacy lowercase paths on reindex")
introduced a db.transaction(...) call in src/store.ts but did not
extend the interface, breaking `tsc -p tsconfig.build.json`:

  src/store.ts(2142,22): error TS2339: Property 'transaction' does
  not exist on type 'Database'.

Both underlying engines expose transaction(fn), so this just makes
the type reflect reality.
2026-04-14 08:34:20 -04:00
Tobi Lütke
cfd640ed34
fix(test): resolve LLM test timeouts by disabling file parallelism
Parallel test files each cold-load their own LLM model, competing for
CPU and causing timeouts even at 120s. Sequential execution eliminates
contention — tests that timed out at 30s now complete in 1-15s.

Made-with: Cursor
2026-04-11 01:21:22 +00:00
Tobi Lütke
3023ab3c99
fix: bump transitive deps to resolve security alerts
npm: vite 7.3.1→7.3.2, hono 4.12.10→4.12.12,
@hono/node-server 1.19.12→1.19.13

pypi: add uv constraint-dependencies for authlib>=1.6.9,
aiohttp>=3.13.4, cryptography>=46.0.7

Made-with: Cursor
2026-04-11 01:07:09 +00:00
Tobias Lütke
525b9970cd
Merge pull request #546 from junmo-kim/fix/handelize-preserve-case
fix: preserve original case in handelize()
2026-04-10 20:48:24 -04:00
Tobias Lütke
3295294be3
Merge pull request #532 from kuishou68/fix-qmd-uri-index-query
fix: include custom index in qmd:// links
2026-04-10 20:47:55 -04:00
Tobias Lütke
46c4dfdaac
Merge pull request #545 from kuishou68/fix-sqlite-vec-actionable-guidance
fix(store): surface actionable sqlite-vec guidance
2026-04-10 20:47:16 -04:00
Tobias Lütke
89df31142d
Merge pull request #548 from kevinburkesegment/fix-gguf-magic-error
fix: detect and explain non-GGUF model files after download
2026-04-10 20:46:59 -04:00
Tobias Lütke
b1dc848086
Merge pull request #554 from bek91/codex/harden-embedding-overflow
fix: Harden embedding overflow handling
2026-04-10 20:46:40 -04:00
Tobias Lütke
b2ffd10cb8
Merge pull request #555 from max0n232/fix/windows-home-fallback
fix: add USERPROFILE fallback for Windows HOME resolution
2026-04-10 20:45:55 -04:00
max0n232
77e71d09f2 fix: add USERPROFILE fallback for Windows HOME resolution
On Windows, `HOME` is not a standard environment variable — the
equivalent is `USERPROFILE`. When MCP clients (e.g. Claude Code)
spawn the QMD server as a subprocess, they pass `USERPROFILE` but
not `HOME`. This causes QMD to fall back to `/tmp`, opening an
empty database instead of the user's actual index.

Fix: check `USERPROFILE` before falling back to `/tmp`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:20:07 +03:00
Bek
e4990e470e Harden embedding overflow handling 2026-04-10 16:02:46 -04:00
Kevin Burke
f53ee26213
fix: detect and explain non-GGUF model files after download
When a proxy or firewall intercepts HuggingFace downloads, the cached
file is an HTML page instead of a GGUF model. Previously this surfaced
as an opaque "Invalid GGUF magic" error from node-llama-cpp.

Now we validate the GGUF magic bytes right after download, detect HTML
pages specifically, delete the bad file, and show an actionable error
message with workarounds (HF_ENDPOINT mirror, manual download path).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-09 13:27:46 -07:00
Kim Junmo
bb5becaf81 Merge remote-tracking branch 'origin/main' into fix/handelize-preserve-case
# Conflicts:
#	CHANGELOG.md
2026-04-09 18:27:16 +09:00
kuishou68
0adbdeb337 fix(store): surface actionable sqlite-vec guidance 2026-04-09 10:13:40 +08:00
Tobias Lütke
171e9e3e65
Merge pull request #530 from kuishou68/fix-status-no-build-probe 2026-04-08 21:19:56 -04:00
Tobias Lütke
414fee520b
Merge pull request #533 from rymalia/fix/json-line-field 2026-04-08 21:19:42 -04:00
Tobias Lütke
9990ca01b4
Merge pull request #534 from erskingardner/fix-529-qmd-llama-gpu-override 2026-04-08 21:19:23 -04:00
Tobias Lütke
33bdf9a308
Merge pull request #537 from fenrire/fix/mcp-production-mode 2026-04-08 21:18:50 -04:00
Kim Junmo
fee576bf98 fix: migrate legacy lowercase paths on reindex
When qmd update runs against an index created before case-preservation,
documents may exist under lowercase paths (e.g. "skill.md" for a file
actually named "SKILL.md"). Add findOrMigrateLegacyDocument() that:

- Falls back to a lowercase lookup when the canonical path is not found
- Renames the document path in-place via UPDATE OR IGNORE
- Manually rebuilds the FTS entry (FTS5 INSERT OR REPLACE does not
  reliably update existing rows via triggers)
- Handles UNIQUE conflicts gracefully (returns null on conflict)

Embeddings are keyed by content hash, so the rename preserves all
existing vectors — no re-embedding required.

Both the CLI indexer and the library reindexer share the same helper,
eliminating the duplication that a previous review flagged.

Includes integration tests for: successful migration, already-lowercase
no-op, and UNIQUE conflict handling.
2026-04-09 08:25:00 +09:00
Kim Junmo
9fb9de4fd2 fix: preserve original case in handelize()
The blanket .toLowerCase() in handelize() drops filename casing,
which breaks path resolution on case-sensitive filesystems (Linux).
Files like README.md, CHANGELOG.md, and SKILL.md become unreachable
when the index stores them as readme.md, changelog.md, skill.md.

Since FTS5 already performs case-insensitive matching via the
unicode61 tokenizer, lowercasing the stored path provides no search
benefit — it only corrupts the metadata used to locate files on disk.

Remove .toLowerCase() and update all affected test expectations.
2026-04-09 07:59:22 +09:00
jungholee
9dd8a738f9 fix(mcp): call enableProductionMode before getDefaultDbPath
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:55:07 +09:00
Ryan Malia
17074eafa1 fix: include line in CLI --json search output
but that function has no callers — the CLI's outputResults() uses its
own inline JSON formatting that destructured only .snippet from
extractSnippet(), discarding .line. Extract the full SnippetResult
and spread the line field into the JSON output object.

Closes #505
2026-04-07 11:53:09 -07:00
Jeff Gardner
1ecb5c9f96
Fix QMD_LLAMA_GPU backend override handling 2026-04-07 18:49:22 +02:00
cocoon
8404cc3bb1 fix(uri): include index in custom qmd links 2026-04-07 23:26:19 +08:00
cocoon
26e3d0c077 fix(status): avoid build attempts during device probe 2026-04-07 23:18:58 +08:00
Tobi Lutke
c2f3a40372
Derive flake version from package.json 2026-04-05 19:17:15 -04:00
Tobi Lutke
986fca3564
Add homeModules.default for home-manager integration 2026-04-05 19:10:22 -04:00
Tobi Lutke
65cd1b3fd0
fix(nix): update aarch64-darwin node_modules hash 2026-04-05 18:47:44 -04:00
Tobi Lutke
a02b9fe016
fix: update nix flake hash and stabilize bun test ordering
Update x86_64-linux node_modules hash after dependency pinning.
Add _resetProductionModeForTesting to fix getDefaultDbPath test
that fails when bun runs all test files in a single process.
Remove duplicate path/handelize tests from store.test.ts.
2026-04-05 18:44:40 -04:00
Tobi Lutke
66e70c028e
fix(test): reset _productionMode in getDefaultDbPath test
Bun runs all test files in a single process, so module-level state
leaks between files. The getDefaultDbPath test now resets the
_productionMode flag before asserting it throws, fixing the flaky
failure on Bun (ubuntu-latest) in CI.
2026-04-05 18:39:51 -04:00
Tobi Lutke
32e504c883
fix(test): remove duplicate path/handelize tests from store.test.ts
These tests are already in store.helpers.unit.test.ts. The duplicates
in store.test.ts failed in CI because _productionMode module state
leaked from earlier tests in the same bun process, causing
getDefaultDbPath to return a path instead of throwing.
2026-04-05 18:31:17 -04:00