mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 14:59:47 +00:00
The four `hybridSearch — reranker enabled (reorder)` cases stub the gateway at 1536 dims (DIMS). Since v0.36.3.0 hybridSearch resolves the embedding column via loadConfig(), whose precedence is cfg.embedding_dimensions > gateway dims > default. On any machine whose ~/.gbrain/config.json sets embedding_dimensions to something other than 1536 (e.g. text-embedding-3-small at 1280), the real config outranks the stub: the 1536-d stub vector fails the gateway dim check, the error is swallowed, search falls back to keyword-only, and the reranker never runs (rerankerFn gets 0 docs, rerank_score undefined). Green in CI only because a fresh runner has no config file — deterministic red on a contributor's machine. Fix (test-only): isolate GBRAIN_HOME to an empty tmpdir in beforeAll so loadConfig() returns null and the stub's dims win, then restore it and clean up in afterAll. Same idiom as emptyHome() in test/ai/gateway-probe-chat-model.test.ts. Verified with a planted ~/.gbrain/config.json at 1280 dims: 2 pass / 4 fail before, 6 pass / 0 fail after; still green with no config file. typecheck clean. Fixes #1527 Co-authored-by: Willisbest <132954469+Willisbest@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>