The dashboard re-instantiates AgentStore on every /api/agents request, and each instance was opening a fresh Database — re-running schema migrations and PRAGMA integrity_check on the full file. On a multi-hundred-MB DB that was 3-7s per request and leaked file handles. Sharing a cached Database keyed by rootDir reduces it to a one-time process cost. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
372 B
372 B
@runfusion/fusion
| @runfusion/fusion |
|---|
| patch |
Cache the AgentStore SQLite connection per project so the dashboard no longer reopens the database, re-runs migrations, and re-executes PRAGMA integrity_check on every /api/agents request. On large project databases this turned a sub-100ms call into multi-second latency that bled into every dashboard view fetching the agent list.