Your Agent Didn't Lose Its Memory. SQLite Said 'Database Is Locked' and Dropped the Write.
When a cron job and a long-running agent share one SQLite file, writes fail with 'database is locked' and scripts exit 0. Use WAL, busy_timeout, and BEGIN IMMEDIATE.