Skip to content

v1.43.3

Choose a tag to compare

@moekatib moekatib released this 04 May 03:36
· 48 commits to main since this release

Fix: one --agent mem search exits in ~300ms instead of hanging for ~10s after the JSON response prints.

Root cause: node-pg Pool's default idleTimeoutMillis: 10000 kept the still-idle pooled connection alive after the query completed, so the event loop sat for the full 10 seconds before the process could exit. The mem_hybrid_search SQL itself was 37ms; the OpenAI embed call was 200ms; the actual work always finished in ~700ms — the rest was just the idle-timeout drain.

Fix: closeBackendIfCached() helper in runtime.ts, called from the program's postAction hook. Awaits the cached backend promise (if any) and calls backend.close() so every command that touched memory drains its pool before exit. No-op when no mem/sync command instantiated a backend; errors are swallowed (we're shutting down). Idle-timeout stays at the node-pg default during a command so sequential queries reuse one pool connection.

Verified against ~/CEO with 14,543 records:

  • Before: ~10.4s per mem search invocation
  • After: 300–420ms warm, ~2s cold

98/98 tests pass.