fix(cli): only a missing column/table means the read-only store needs migration

Other OperationalErrors (locked, disk I/O) keep their real message.
This commit is contained in:
kshitijk4poor
2026-09-15 12:24:49 +05:30
committed by kshitij
parent 55d9a49c1d
commit ddbd7a9437

View File

@@ -998,7 +998,7 @@ def cmd_sessions(args, sessions_parser=None):
try:
return handler(db, args)
except sqlite3.OperationalError as e:
if not observational:
if not observational or not str(e).lower().startswith("no such "):
raise
# A read-only opener skips schema migration, so a store from an older release can lack a column.
print(f"Error: session database needs migration — run any writing hermes command first ({e})")