# NousResearch/hermes-agent · Duplicate transcript entries on gateway replay/flush

## Open now

- Nothing open on GitHub.

These issues and pull requests concern a bug where replayed or reloaded history rows are re-inserted or re-appended to the transcript database, producing duplicate blocks. The fixes focus on preserving persistence stamps and repairing rows in place rather than re-flushing them.

## TL;DR

- 7 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 2 merged PR(s), 4 PR(s) closed without merging.
- A fix was merged to main in PR #123975. Verify it addresses your case.
- **Recommended:** read PR #123975 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-125146`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.29`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #123462: Gateway re-appends the whole loaded history to state.db on some tool turns (duplicate transcript blocks)

## Prior & competing PRs

- **#123975: fix(gateway): keep the persisted stamp on replayed rows so stamp-only flushes don't duplicate history**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `gateway/run.py`, `tests/gateway/test_cached_agent_history_guard.py`, `tests/gateway/test_gateway_history_persistence_stamp.py`
- **#125146: fix(persistence): stop re-inserting sanitized user and tool rows on re-flush**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/message_metadata.py`, `agent/message_sanitization.py`, `agent/session_persistence.py`, `agent/transcript_repair.py`, `contributors/emails/[redacted:email]`, `hermes_state_compression.py`, `hermes_state_messages.py`, `tests/agent/test_compression_rotation_state.py`, `tests/agent/test_tool_call_incremental_persistence.py`
- **#123472: fix(gateway): carry _db_persisted stamp in _build_replay_entry to prevent duplicate transcript flushes**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `cb3142d3257b15ac42de544bd585793567400d0f`, `#123975`
- **#123473: fix(gateway): preserve durable replay identity across DB reload**. closed without merge
  - maintainer direction: category `silent_close`; implication `active`
- **#123487: fix(gateway): preserve _db_persisted stamp in _build_replay_entry to avoid duplicate transcript blocks**. closed without merge
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`; refs `cb3142d3257b15ac42de544bd585793567400d0f`, `#123975`
- **#123849: fix(persistence): repair inactive transcript rows in place**. closed without merge
  - maintainer direction: category `partial_fix`; implication `needs_llm`; refs `dab7201c350b01376c7680aaaaaf3772f72cfc86`, `d0288be5b3330d2442e3907185b8e9d0958297bb`

## Fix status

- Merged to main in PR #123975 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-27`.
