Files
hermes-agent/tests
Teknium ec24dd3556 fix(acp): replay the retained content_refused row so a reopened editor still shows the refused ask
A provider safety refusal takes the whole refused turn out of the MODEL context
(retain_refused_turn_for_display) so a reload can't re-send the blocked content and
re-lock the chat, but KEEPS the user's ask in the DISPLAY projection as a greyed
content_refused row. ACP's _replay_session_history replayed only state.history (the
active-only model view), which no longer carries that row, so load_session/resume_session
hid the refused ask and notice on every reopen even though SQLite retained them.

Replay the durable DISPLAY projection instead (SessionManager.display_history ->
get_messages_as_conversation(include_compacted=True)), falling back to state.history when
the DB view is unavailable; model context stays clean. _history_replay_updates renders a
content_refused user row as the (greyable) ask followed by the refusal notice as an agent
message, so a reopened editor shows 'you asked X -> refused'.

Test drives a REAL load_session through a fresh server on the same DB (process-restart
fidelity) and asserts the replayed session/update stream carries the refused ask + notice;
proven red on bde73dde794.
2026-11-05 22:23:44 -08:00
..