Files
hermes-agent/tests
kshitijk4poor 25a43ddfb3 fix(tui_gateway): probe foreign rows by keyset and re-hydrate after a remote compaction
The review round on the final head found two things. The unconditional full
transcript decode on every prompt.submit cost ~155 ms at 3k rows even when
nothing was foreign; SessionDB.get_messages(after_id=) answers the same
question in ~0.04 ms, so the full read now runs only when the probe finds
rows below this turn's submit row.

_strip_in_memory_overlap was built on a wrong premise: archive_and_compact
re-stamps _row_id on the in-memory dicts, so a local /compact leaves nothing
above the boundary and the helper never ran. The epoch that does exist is a
compaction by another surface, whose summary row leads the foreign rows and
can never align with the in-memory tail. That case is now detected on the
probe rows (_compressed_summary) and the history is re-hydrated from the DB
the way session.resume does, below the submit row, instead of appended to.

Test 2 covers both epochs: local compaction is a no-op, remote compaction
replaces the history with summary markers intact and the submit row excluded.
2026-09-19 12:33:57 +05:30
..
…
…