Skip to content

Dashboard fails when sessions table is missing summary column #1

Description

@primmer

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

  1. Sessions page shows emptyGET /api/sessions returns {"sessions": [], "total": 0, "error": "no such column: s.summary"}
  2. Startup backfill thread crashes_run_startup_session_metadata_backfill() queries WHERE summary IS NULL and throws sqlite3.OperationalError: no such column: summary
  3. Dashboard log is polluted with the traceback on every restart

Steps to Reproduce

  1. Install hermes-agent and let it create state.db with the default schema
  2. Install and start the dashboard
  3. Open the Sessions tab in the dashboard UI
  4. 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:

  1. Check column existence before querying — use PRAGMA table_info(sessions) and adjust queries accordingly
  2. Auto-migrate on startup — run ALTER TABLE sessions ADD COLUMN summary TEXT during initialization if the column doesn't exist
  3. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions