Skip to content

The agent that grows with you

fix(state): name the user-facing repair commands in the FTS corruption error

kshitijk4poor324850626a81
diff --git a/hermes_state_search.py b/hermes_state_search.py
index 841d1ba8704..3920ebac042 100644
--- a/hermes_state_search.py
+++ b/hermes_state_search.py
@@ -1332,7 +1332,8 @@ class SessionSearchMixin:
if is_malformed_db_error(exc):
logger.error(
"FTS rebuild failed with a corruption-class error for %s: %s; "
- "the index needs the offline repair path (repair_state_db_schema)", tbl, exc)
+ "run 'hermes sessions repair' (or 'hermes doctor --fix') to rebuild the index offline",
+ tbl, exc)
else:
logger.warning("FTS rebuild failed for %s: %s", tbl, exc)
return rebuilt
diff --git a/tests/hermes_state/test_fts_rebuild_corruption_class.py b/tests/hermes_state/test_fts_rebuild_corruption_class.py
index f1583575bfa..14a1f68b910 100644
--- a/tests/hermes_state/test_fts_rebuild_corruption_class.py
+++ b/tests/hermes_state/test_fts_rebuild_corruption_class.py
@@ -60,7 +60,7 @@ def test_corruption_class_error_is_caught_rolled_back_and_reported(
)
with caplog.at_level("WARNING"):
assert db.rebuild_fts() == 0
- assert any("offline repair" in rec.message for rec in caplog.records) is repair_hint
+ assert any("hermes sessions repair" in rec.message for rec in caplog.records) is repair_hint
@pytest.mark.parametrize("method,command", [("rebuild_fts", "rebuild"), ("optimize_fts", "optimize")])