mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
fix(tests): teach gateway-server fakes the include_row_ids kwarg
Slice 1 fell over on eight DB fakes with frozen get_messages_as_conversation signatures — the new opt-in kwarg is part of the method's contract now, so the fakes accept **_kwargs like the real SessionDB. Also opts the child-watch resume projection into row ids: it feeds the same _history_to_messages as the desktop resume, so reactions on a watched child session address rows the same way.
This commit is contained in:
parent
fec1ac0a7a
commit
5ecc35f9bb
2 changed files with 9 additions and 9 deletions
|
|
@ -2405,7 +2405,7 @@ def test_session_resume_uses_parent_lineage_for_display(monkeypatch):
|
|||
def get_ancestor_display_prefix(self, _sid):
|
||||
return []
|
||||
|
||||
def get_messages_as_conversation(self, target, include_ancestors=False, repair_alternation=False):
|
||||
def get_messages_as_conversation(self, target, include_ancestors=False, repair_alternation=False, **_kwargs):
|
||||
captured.setdefault("history_calls", []).append((target, include_ancestors))
|
||||
return (
|
||||
[
|
||||
|
|
@ -2475,7 +2475,7 @@ def test_live_visible_history_prefers_db_display_with_candidate():
|
|||
|
||||
class DB:
|
||||
def get_messages_as_conversation(
|
||||
self, key, include_ancestors=False, repair_alternation=False
|
||||
self, key, include_ancestors=False, repair_alternation=False, **_kwargs
|
||||
):
|
||||
assert key == "s1"
|
||||
assert include_ancestors is True
|
||||
|
|
@ -2539,7 +2539,7 @@ def test_live_visible_history_keeps_candidate_and_fresh_tail():
|
|||
]
|
||||
|
||||
class DB:
|
||||
def get_messages_as_conversation(self, key, include_ancestors=False, repair_alternation=False):
|
||||
def get_messages_as_conversation(self, key, include_ancestors=False, repair_alternation=False, **_kwargs):
|
||||
return list(db_display)
|
||||
|
||||
result = server._live_visible_history({"session_key": "s1"}, DB(), in_memory)
|
||||
|
|
@ -2777,7 +2777,7 @@ def test_session_resume_passes_stored_runtime_to_agent(monkeypatch):
|
|||
def get_ancestor_display_prefix(self, _sid):
|
||||
return []
|
||||
|
||||
def get_messages_as_conversation(self, target, include_ancestors=False, repair_alternation=False):
|
||||
def get_messages_as_conversation(self, target, include_ancestors=False, repair_alternation=False, **_kwargs):
|
||||
return [{"role": "user", "content": "hello"}]
|
||||
|
||||
def fake_make_agent(sid, key, session_id=None, session_db=None, **kwargs):
|
||||
|
|
@ -2846,7 +2846,7 @@ def test_session_resume_profile_uses_profile_db_cwd(monkeypatch, tmp_path):
|
|||
def get_ancestor_display_prefix(self, _sid):
|
||||
return []
|
||||
|
||||
def get_messages_as_conversation(self, _target, include_ancestors=False, repair_alternation=False):
|
||||
def get_messages_as_conversation(self, _target, include_ancestors=False, repair_alternation=False, **_kwargs):
|
||||
return [{"role": "user", "content": "hello"}]
|
||||
|
||||
def update_session_cwd(self, *_args):
|
||||
|
|
@ -7398,7 +7398,7 @@ def test_slash_exec_r7_read_commands_use_metadata_mirror_flag_on(monkeypatch):
|
|||
def get_ancestor_display_prefix(self, _sid):
|
||||
return []
|
||||
|
||||
def get_messages_as_conversation(self, key, include_ancestors=True, repair_alternation=False):
|
||||
def get_messages_as_conversation(self, key, include_ancestors=True, repair_alternation=False, **_kwargs):
|
||||
assert key == "session-key"
|
||||
assert include_ancestors is True
|
||||
return list(history_from_db)
|
||||
|
|
@ -10677,7 +10677,7 @@ def test_session_history_uses_session_profile_db(monkeypatch, tmp_path):
|
|||
seen: dict = {}
|
||||
|
||||
class LaunchDB:
|
||||
def get_messages_as_conversation(self, _key, include_ancestors=True):
|
||||
def get_messages_as_conversation(self, _key, include_ancestors=True, **_kwargs):
|
||||
seen["launch"] = True
|
||||
return [{"role": "user", "content": "launch"}]
|
||||
|
||||
|
|
@ -10685,7 +10685,7 @@ def test_session_history_uses_session_profile_db(monkeypatch, tmp_path):
|
|||
def __init__(self, db_path=None):
|
||||
seen["db_path"] = db_path
|
||||
|
||||
def get_messages_as_conversation(self, _key, include_ancestors=True):
|
||||
def get_messages_as_conversation(self, _key, include_ancestors=True, **_kwargs):
|
||||
seen["profile"] = True
|
||||
return [{"role": "user", "content": "from-profile"}]
|
||||
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ def _(rid, params: dict) -> dict:
|
|||
# feeds live replay. Fall back to it if the display read fails.
|
||||
try:
|
||||
display_history = db.get_messages_as_conversation(
|
||||
target, repair_alternation=False
|
||||
target, repair_alternation=False, include_row_ids=True
|
||||
)
|
||||
except Exception:
|
||||
logger.debug("child-watch display projection read failed", exc_info=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue