Files
gbrain/test/e2e
d4bbf6eeae perf(config): batch + cache engine.getConfig to kill ~85 round-trips per query
Takeover of #1694: a single search fires ~85 serial getConfig() reads
(loadConfigWithEngine x2 plus the mode/cache/intent/rerank/graph-signals
resolvers); on a remote pooler each read is a round-trip, dominating query
latency and risking cli.ts's 10s disconnect force-exit truncating stdout.

The first read now batch-loads the whole config table into a process-
lifetime Map (single-flight under concurrency); setConfig/unsetConfig
write through; a 30s TTL bounds multi-writer staleness and
GBRAIN_CONFIG_CACHE_TTL_MS=0 restores per-key reads.

Rebased onto current master: unlike the original diff, both the batch
load and the TTL=0 per-key fallback stay inside connRetry() so the
#1603/#1891 retry+reconnect posture (pooler-drop self-heal) is preserved.
PGLite stays uncached (in-process, zero round-trips; raw-SQL test
fixtures rely on fresh reads). E2E helpers pin the cache off since those
suites seed config via raw SQL.

Co-authored-by: Omerbahari <Omerbahari@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 14:26:28 -07:00
..