The agent's SQLite store (packages/core/store/store.ts) creates its tables with CREATE TABLE IF NOT EXISTS and has no versioning. That works until a release changes a table's shape: an existing data volume then has the old columns, IF NOT EXISTS skips it and the runtime hits missing-column errors at runtime rather than at startup.
Add a migration mechanism so schema changes are safe across upgrades of long-lived agents:
- Track a schema version (
PRAGMA user_version is the natural fit)
- On startup, run ordered migrations from the stored version to the current one, inside a transaction
- Fail loudly at startup if the database is newer than the runtime (downgrade case)
- A fresh database just gets the latest schema and version
This matters because the data volume is the agent's identity and history; "wipe /data" can't be the upgrade story once agents run unattended for months.
🤖 Generated with Claude Code
The agent's SQLite store (
packages/core/store/store.ts) creates its tables withCREATE TABLE IF NOT EXISTSand has no versioning. That works until a release changes a table's shape: an existing data volume then has the old columns,IF NOT EXISTSskips it and the runtime hits missing-column errors at runtime rather than at startup.Add a migration mechanism so schema changes are safe across upgrades of long-lived agents:
PRAGMA user_versionis the natural fit)This matters because the data volume is the agent's identity and history; "wipe /data" can't be the upgrade story once agents run unattended for months.
🤖 Generated with Claude Code