mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-08 13:12:08 +00:00
test(gateway): assert _record_gateway_session_peer fires only on the persisted split
The fake _SessionStore tracked peer_records but no test read it, leaving #55300's peer-record behavior unasserted. Add a positive assertion on the persist path and negative (== []) assertions on the two stale/moved-binding skip paths, so the peer-record side effect is bound. Mutation-verified: removing the production _record_gateway_session_peer call makes the positive assertion fail. Co-authored-by: João Vitor Cunha <jvsantos.cunha@gmail.com>
This commit is contained in:
parent
ed6f80a20c
commit
f2b8a5d541
1 changed files with 6 additions and 0 deletions
|
|
@ -170,6 +170,10 @@ def test_failed_turn_still_syncs_compression_session_split(monkeypatch):
|
|||
assert result["history_offset"] == 0
|
||||
assert session_store.entry.session_id == "session-after-compression"
|
||||
assert session_store.save_calls == 1
|
||||
# #55300: the child's gateway peer metadata is recorded on the persist path.
|
||||
assert session_store.peer_records == [
|
||||
("session-after-compression", SESSION_KEY, source)
|
||||
]
|
||||
runner._sync_telegram_topic_binding.assert_called_once_with(
|
||||
source, session_store.entry, reason="agent-run-compression"
|
||||
)
|
||||
|
|
@ -197,6 +201,7 @@ def test_stale_run_does_not_overwrite_new_session_after_compression(monkeypatch)
|
|||
assert result["history_offset"] == 0
|
||||
assert session_store.entry.session_id == "session-before-compression"
|
||||
assert session_store.save_calls == 0
|
||||
assert session_store.peer_records == []
|
||||
assert getattr(runner._sync_telegram_topic_binding, "call_count") == 0
|
||||
|
||||
|
||||
|
|
@ -222,4 +227,5 @@ def test_session_split_sync_skips_when_binding_already_moved(monkeypatch):
|
|||
assert result["history_offset"] == 0
|
||||
assert session_store.entry.session_id == "fresh-session-after-new"
|
||||
assert session_store.save_calls == 0
|
||||
assert session_store.peer_records == []
|
||||
assert getattr(runner._sync_telegram_topic_binding, "call_count") == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue