Files
hermes-agent/tests/tools/test_bot_mode_refusal_contract.py
Teknium 5409d89a2d test: migrate adjacent bot tests off the retired local CLI turn and mailbox claim
Cron Bot Chat delivery now asserts stable per-execution delivery ids
against a fake profile authority (exact retry inspects, owner loss reads
as ambiguous, new execution mints a new id) instead of claiming from the
mailbox. Deleted (sole assertion was the retired mechanism): the local
runner stderr refusal-code parse, and the four turn-lock tests that pinned
the local query-file CLI turn / relay subprocess under the profile lock.
The peer stdin transport lock-skip and the lock primitives stay.
2026-09-09 01:45:07 -07:00

12 lines
636 B
Python

from types import SimpleNamespace
def test_one_shot_cli_preserves_refusal_reason(monkeypatch, capsys):
from cli import HermesCLI
from hermes_cli import active_sessions
refusal = active_sessions.ActiveSessionRefusal("Ce chat est occupé.", reason=active_sessions.SESSION_NOT_OWNED)
monkeypatch.setattr(active_sessions, "try_acquire_active_session", lambda **kwargs: (None, refusal))
cli = SimpleNamespace(_active_session_lease=None, session_id="isolated", config={})
assert not HermesCLI._claim_active_session(cli, stderr=True)
assert "hermes-refusal-reason: SESSION_NOT_OWNED\n" in capsys.readouterr().err