Problem
The core workspace SQLite connections set no busy_timeout and no WAL journaling. Under parallel batch execution, multiple subprocesses write to the same workspace DB concurrently, and server background agent threads add more concurrent writers. With no busy_timeout, a concurrent writer gets an immediate database is locked OperationalError instead of waiting.
The platform_store Database already sets WAL + busy_timeout=5000, so core is inconsistent with the rest of the codebase.
Evidence
codeframe/core/workspace.py:839 (get_db_connection) and the other direct sqlite3.connect() calls use bare defaults
codeframe/core/conductor.py:2087+ (_execute_task_subprocess) — parallel writers
codeframe/ui/routers/tasks_v2.py:716 — server-triggered concurrent agent threads
codeframe/platform_store/database.py:78-84 — sets WAL + busy_timeout=5000 (the pattern core should match)
Fix
- In
get_db_connection (and the other direct connects), set PRAGMA busy_timeout and PRAGMA journal_mode=WAL, matching platform_store/database.py.
Acceptance criteria
Source: release-readiness audit 2026-06-13 (backend agent). Top backend fix before parallel batch execution is relied upon in production.
Problem
The core workspace SQLite connections set no
busy_timeoutand no WAL journaling. Under parallel batch execution, multiple subprocesses write to the same workspace DB concurrently, and server background agent threads add more concurrent writers. With nobusy_timeout, a concurrent writer gets an immediatedatabase is lockedOperationalErrorinstead of waiting.The platform_store
Databasealready sets WAL +busy_timeout=5000, so core is inconsistent with the rest of the codebase.Evidence
codeframe/core/workspace.py:839(get_db_connection) and the other directsqlite3.connect()calls use bare defaultscodeframe/core/conductor.py:2087+(_execute_task_subprocess) — parallel writerscodeframe/ui/routers/tasks_v2.py:716— server-triggered concurrent agent threadscodeframe/platform_store/database.py:78-84— sets WAL +busy_timeout=5000(the pattern core should match)Fix
get_db_connection(and the other direct connects), setPRAGMA busy_timeoutandPRAGMA journal_mode=WAL, matchingplatform_store/database.py.Acceptance criteria
busy_timeoutand WAL.database is locked.Source: release-readiness audit 2026-06-13 (backend agent). Top backend fix before parallel batch execution is relied upon in production.