From fb7eda7416ed2004f906a57bb3e3ad2e92cb8e93 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 27 Sep 2026 16:36:15 +0530 Subject: [PATCH] refactor(persistence): drop a dead digest pop and scope the transcript-write docstring --- hermes_state_messages.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hermes_state_messages.py b/hermes_state_messages.py index ab342aa366..82e0187a5e 100644 --- a/hermes_state_messages.py +++ b/hermes_state_messages.py @@ -454,7 +454,7 @@ class SessionMessagesMixin: def _execute_transcript_write(self, fn, messages: List[Dict[str, Any]], **kwargs): """``_execute_write(fn)`` for callbacks that stamp row state onto the caller's *messages* (every - :meth:`_insert_message_rows` caller). Each attempt, and a final failure, restores the caller's + :meth:`_insert_message_rows` caller that passes caller-owned dicts; rewind and import insert fresh copies). Each attempt, and a final failure, restores the caller's ``_row_id`` / digest / timestamp: a rolled-back insert's id is reused by SQLite, so a stale stamp would make a later flush adopt another writer's row and drop this message.""" _absent = object() @@ -699,9 +699,6 @@ class SessionMessagesMixin: msg["timestamp"] = message_timestamp if cur.lastrowid is not None: msg["_row_id"] = cur.lastrowid - # A new row makes any carried CAS version (a clone's parent digest) meaningless; the - # stored digest of the new row is stamped below. - msg.pop(DB_ROW_SNAPSHOT, None) inserted += 1 tool_calls_total += _tool_calls_count(tool_calls) now_ts = max(now_ts, message_timestamp) + 1e-6