Files
stack/tests/llm/test_evidence.py
kert cc1051164e fix(llm): per-call DuckDB cursor for the cached replica handle; lock the cache; concurrency test (refs P48)
A /chat stream is a sync generator, so Starlette runs it in a threadpool
worker: concurrent turns shared the one cached DuckDBPyConnection and
read each other's result sets ("not enough values to unpack"), which the
broad except swallowed as "valuation evidence skipped" — the table just
vanished. Each call now runs on its own cursor off the shared handle and
closes it in a finally, and the cache check-and-open is under a lock so
a race on the first open cannot leak a connection.
2026-09-08 23:40:22 -04:00

14 KiB