mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-28 14:59:47 +00:00
The four "reranker enabled (reorder)" cases stub the gateway at 1536 dims, but hybridSearch resolves the embedding column via loadConfig(), whose precedence puts cfg.embedding_dimensions above the gateway stub. On any machine whose ~/.gbrain/config.json sets a different dimension (e.g. 1280), the stub vector fails the dim check, search silently degrades to keyword-only, and the reranker never fires — deterministic 4-test failure for contributors, green in CI only because fresh runners have no config. Fix (test-only): point GBRAIN_HOME at an empty tmpdir in beforeAll so loadConfig() returns null and the stub's dims win; restore + clean up in afterAll. Same idiom as emptyHome() in test/ai/gateway-probe-chat-model.test.ts. Verified with a planted 1280-dim config.json: 2 pass / 4 fail before, 6 pass / 0 fail after; still 6/6 with no config. typecheck clean. Takeover of #2640. Co-authored-by: Willisbest <Willisbest@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>