When we perform a write inside a transaction in SQLite, the database is locked until the transaction ends.
So performing a write before starting the entire agentic workflow will lock the DB for quite a while.
Solution
Move the message write to directly before the result storage (lump all the writes together in time with no wait).
Context
When we perform a write inside a transaction in SQLite, the database is locked until the transaction ends. So performing a write before starting the entire agentic workflow will lock the DB for quite a while.
Solution
Move the message write to directly before the result storage (lump all the writes together in time with no wait).