Bug
When upgrading Hermes from a version that predates the session_id column to v0.14.0, the kanban dispatcher and dashboard fail with:
sqlite3.OperationalError: no such column: session_id
File "hermes_cli/kanban_db.py", line 1012, in connect
conn.executescript(SCHEMA_SQL)
The Kanban board in the web dashboard shows "Failed to load Kanban board: 500: Internal Server Error".
Root Cause
SCHEMA_SQL (line 808) contains:
CREATE TABLE IF NOT EXISTS tasks (...);
CREATE INDEX IF NOT EXISTS idx_tasks_session_id ON tasks(session_id); -- line 868
For an existing kanban.db created by an older version, CREATE TABLE IF NOT EXISTS is a no-op (table already exists, old schema without session_id). But the CREATE INDEX on the next line references session_id which doesn't exist yet — this runs before _migrate_add_optional_columns() at line 1013, so the migration never gets a chance to add the column.
Steps to Reproduce
- Install an older version of Hermes (before
session_id was added to kanban schema)
- Run
hermes dashboard or anything that triggers kanban.db creation
- Upgrade to v0.14.0
- Run
hermes dashboard → Kanban tab shows 500 error
Workaround
Delete the old kanban.db and let it regenerate:
rm ~/.hermes/kanban.db
hermes dashboard --stop
hermes dashboard
Proposed Fix
Option A: Move the CREATE INDEX IF NOT EXISTS idx_tasks_session_id and idx_tasks_model_override statements from SCHEMA_SQL into _migrate_add_optional_columns(), after the corresponding ALTER TABLE ADD COLUMN calls.
Option B: Wrap the index creation in a check for the column's existence:
if "session_id" in cols:
conn.execute("CREATE INDEX IF NOT EXISTS idx_tasks_session_id ON tasks(session_id)")
Environment
- Hermes v0.14.0 (updated from a pre-kanban v2 version)
- WSL2 / Ubuntu
- Node v22.22.2
Bug
When upgrading Hermes from a version that predates the
session_idcolumn to v0.14.0, the kanban dispatcher and dashboard fail with:The Kanban board in the web dashboard shows "Failed to load Kanban board: 500: Internal Server Error".
Root Cause
SCHEMA_SQL(line 808) contains:For an existing kanban.db created by an older version,
CREATE TABLE IF NOT EXISTSis a no-op (table already exists, old schema withoutsession_id). But theCREATE INDEXon the next line referencessession_idwhich doesn't exist yet — this runs before_migrate_add_optional_columns()at line 1013, so the migration never gets a chance to add the column.Steps to Reproduce
session_idwas added to kanban schema)hermes dashboardor anything that triggers kanban.db creationhermes dashboard→ Kanban tab shows 500 errorWorkaround
Delete the old kanban.db and let it regenerate:
rm ~/.hermes/kanban.db hermes dashboard --stop hermes dashboardProposed Fix
Option A: Move the
CREATE INDEX IF NOT EXISTS idx_tasks_session_idandidx_tasks_model_overridestatements fromSCHEMA_SQLinto_migrate_add_optional_columns(), after the correspondingALTER TABLE ADD COLUMNcalls.Option B: Wrap the index creation in a check for the column's existence:
Environment