You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): the store lock is held across the blocking LLM call in capture extraction #1663
capture_worker::run_cycle (crates/uteke-server/src/capture_worker.rs:40) locks the shared Mutex<Uteke> and calls run_capture_extraction inside the guard's scope. That function calls facts.extract(), a blocking HTTP request to the LLM provider with a 120 s timeout (extraction.rsREQUEST_TIMEOUT_SECS). While it runs, every recall, remember and viewer request that needs the mutex waits.
Why
The module doc says the lock is taken per session so a run does not hold requests back for its whole length. That holds for the run, not for each session: one slow provider call still blocks the server for up to two minutes, and a hung provider does so on every scheduled run. Found by a Cora scan run as agent on the files added since v0.22.1 (2026-11-04). Line numbers are for develop @ 7e53cec.
Proposal
Split extraction into three steps: claim the batch and read its turns under the lock, release the lock, call the extractor, then re-take the lock to store the facts and mark the batch done. The batch lease already makes this safe against a crash in between.
Testing
A fake FactSource that sleeps: a concurrent recall on the same Mutex completes while the extraction is still running.
A crash between claim and store (extractor error, panic) leaves the batch recoverable, as today.
Activity
fix(server): do not hold the store lock across the capture extractor …
ajianaz commentedon Nov 4, 2026
Fixed by #1674 (merged): the lock is held only to claim a batch and to store its facts, not across the extractor call.