hermes-agent/tests/acp
kshitijk4poor 723ccda275 fix(acp): also preserve archived rows on model-switch / restore saves
Follow-up widening the archived-history fix to the sibling save paths the
original PR did not cover. Model switches (_cmd_model, set_session_model) and
_restore mint a fresh AIAgent with _session_db_created=False, so the
agent-owns-persistence guard evaluates False and the blind full-history
replace_messages() fired — DELETEing the durable active=0/compacted=1 rows on
any compressed ACP session (same data-loss class the PR fixes, different
trigger).

- hermes_state.replace_messages: add active_only=True to delete/reinsert only
  the live (active=1) rows, leaving soft-archived rows untouched (idea adopted
  from the competing PR #50306 by @mrparker0980, credited).
- hermes_state.has_archived_messages: cheap existence probe for active=0 rows.
- acp_adapter._persist: when the agent doesn't own persistence but the session
  already has archived rows on disk, replace active-only; otherwise the
  destructive full replace stays (fresh create/fork has nothing to lose).
- Regression test: model-switch save on a compacted session keeps the archived
  turn discoverable via get_messages(include_inactive=True) + search_messages.
2026-07-01 17:16:51 +05:30
..
__init__.py
test_approval_isolation.py fix(acp): thread-safe interactive approval via contextvars 2026-06-30 03:24:58 -07:00
test_auth.py feat: add ACP registry metadata for Zed 2026-05-14 20:26:02 -07:00
test_edit_approval.py fix: bound threat-pattern/FTS5 regex input and cover V4A Move-File edits 2026-07-01 01:05:28 -07:00
test_entry.py refactor(bootstrap): consolidate ACP browser bootstrap into install.{sh,ps1} (#27851) 2026-05-18 16:36:26 +05:30
test_events.py fix(ci): rip out some xdist legacy stuff... how did these ever work?? 2026-06-26 19:15:18 -07:00
test_mcp_e2e.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_permissions.py feat(acp): enrich permission request cards 2026-05-18 11:47:27 -07:00
test_ping_suppression.py fix(acp): silence 'Background task failed' noise on liveness-probe requests (#12855) 2026-04-20 00:10:27 -07:00
test_registry_manifest.py feat(acp-registry): switch to uvx distribution, drop npm launcher 2026-05-14 22:27:09 -07:00
test_server.py fix(acp): preserve memory provider tools 2026-06-13 04:51:44 -07:00
test_session.py fix(acp): also preserve archived rows on model-switch / restore saves 2026-07-01 17:16:51 +05:30
test_session_db_private_access.py fix(acp): replace direct db._lock/_conn access with public update_session_meta() 2026-06-04 17:54:59 -07:00
test_session_provenance.py feat(acp): emit session provenance metadata for compression rotation (#41724) 2026-06-07 22:22:21 -07:00
test_tools.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00