fix(state): route the remaining model_config marker reads through _sql_json_extract

Sibling widening of the #101726 salvage: FTS_TRIGRAM_SESSION_SQL (trigram view/triggers/backfill),
the v16 delegate-tagging data migration and reopen_session's legacy reset-child stamp still called
json_extract() on the raw model_config cell, so one malformed JSON row could still abort FTS
maintenance, a schema migration or /resume of a reset child. Zero raw model_config json_extract
reads remain in hermes_state_*.py.
This commit is contained in:
teknium1
2026-09-11 02:28:00 -07:00
committed by Teknium
parent c4a8572d68
commit 46afbfec10
3 changed files with 6 additions and 7 deletions
+1 -2
View File
@@ -454,8 +454,7 @@ class SessionSessionsMixin:
conn.execute(
"UPDATE sessions AS child SET model_config = json_set("
"COALESCE(child.model_config, '{}'), '$._reset_from', child.parent_session_id) "
"WHERE child.parent_session_id = ? AND json_extract(COALESCE(child.model_config, '{}'), "
" '$._reset_from') IS NULL "
f"WHERE child.parent_session_id = ? AND {_sql_json_extract('child.model_config', '$._reset_from')} IS NULL "
f"AND {_legacy_reset_child_sql('child', _session_ids_placeholders(_RESET_END_REASONS))}",
(session_id, *_RESET_END_REASONS),
)