Bug Description
The dashboard crashes on startup and fails to load sessions when the sessions table in state.db does not have a summary column. This happens because hermes-agent creates the sessions table without a summary column, but the dashboard's SQL queries assume it exists.
Impact
- Sessions page shows empty —
GET /api/sessions returns {"sessions": [], "total": 0, "error": "no such column: s.summary"}
- Startup backfill thread crashes —
_run_startup_session_metadata_backfill() queries WHERE summary IS NULL and throws sqlite3.OperationalError: no such column: summary
- Dashboard log is polluted with the traceback on every restart
Steps to Reproduce
- Install hermes-agent and let it create
state.db with the default schema
- Install and start the dashboard
- Open the Sessions tab in the dashboard UI
- Observe: no sessions listed, error in response
Root Cause
The sessions table schema from hermes-agent does not include a summary column:
CREATE TABLE sessions (
id TEXT PRIMARY KEY,
source TEXT NOT NULL,
...
title TEXT
-- no summary column
);
But the dashboard references s.summary in multiple queries (app.py lines ~1302, ~1317, ~1522).
Suggested Fix
The dashboard should handle the missing column gracefully. Options:
- Check column existence before querying — use
PRAGMA table_info(sessions) and adjust queries accordingly
- Auto-migrate on startup — run
ALTER TABLE sessions ADD COLUMN summary TEXT during initialization if the column doesn't exist
- Use defensive SQL — wrap the
summary references in try/except or check sqlite_master for column existence
Option 2 (auto-migrate) is probably the cleanest since it's a one-time schema fix and the column is nullable.
Environment
- Hermes Dashboard: latest (cloned 2026-04-09)
- hermes-agent: v0.8.0 (v2026.4.8)
- OS: Ubuntu (Oracle VM, aarch64)
- Python: 3.11.15 (venv)
Bug Description
The dashboard crashes on startup and fails to load sessions when the
sessionstable instate.dbdoes not have asummarycolumn. This happens because hermes-agent creates thesessionstable without asummarycolumn, but the dashboard's SQL queries assume it exists.Impact
GET /api/sessionsreturns{"sessions": [], "total": 0, "error": "no such column: s.summary"}_run_startup_session_metadata_backfill()queriesWHERE summary IS NULLand throwssqlite3.OperationalError: no such column: summarySteps to Reproduce
state.dbwith the default schemaRoot Cause
The
sessionstable schema from hermes-agent does not include asummarycolumn:But the dashboard references
s.summaryin multiple queries (app.pylines ~1302, ~1317, ~1522).Suggested Fix
The dashboard should handle the missing column gracefully. Options:
PRAGMA table_info(sessions)and adjust queries accordinglyALTER TABLE sessions ADD COLUMN summary TEXTduring initialization if the column doesn't existsummaryreferences in try/except or checksqlite_masterfor column existenceOption 2 (auto-migrate) is probably the cleanest since it's a one-time schema fix and the column is nullable.
Environment