hermes-agent/acp_adapter
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 feat: restore ACP server implementation from PR #949 (#1254) 2026-03-14 00:09:05 -07:00
__main__.py feat: restore ACP server implementation from PR #949 (#1254) 2026-03-14 00:09:05 -07:00
auth.py feat(azure-foundry): add Microsoft Entra ID auth 2026-05-18 10:14:38 -07:00
edit_approval.py fix: bound threat-pattern/FTS5 regex input and cover V4A Move-File edits 2026-07-01 01:05:28 -07:00
entry.py fix(tui): stop a cwd package named utils/proxy/ui from crashing the gateway child (#51693) 2026-06-23 23:29:45 -07:00
events.py fix(acp): use modes for edit auto-approval 2026-05-18 01:19:55 -07:00
permissions.py feat(acp): enrich permission request cards 2026-05-18 11:47:27 -07:00
provenance.py feat(acp): emit session provenance metadata for compression rotation (#41724) 2026-06-07 22:22:21 -07:00
server.py fix(acp): thread-safe interactive approval via contextvars 2026-06-30 03:24:58 -07:00
session.py fix(acp): also preserve archived rows on model-switch / restore saves 2026-07-01 17:16:51 +05:30
tools.py feat(moa): expose MoA presets as selectable virtual models (#46081) 2026-06-25 13:52:06 -07:00