hermes-agent/acp_adapter
alt-glitch 16642e2769 fix(mcp): revert ACP rebuild to original; harden generation guard
CI caught 3 ACP test failures (tests/acp/test_server.py,
tests/acp/test_mcp_e2e.py). Root cause: routing ACP's tool-surface rebuild
through the shared refresh_agent_mcp_tools helper (added in the round-2 pass)
broke a deliberate, pre-existing ACP contract:

- the ACP tests assert `agent.tools is <get_tool_definitions return>` (object
  identity) and an exact get_tool_definitions(enabled_toolsets=[...],
  disabled_toolsets=..., quiet_mode=True) call signature; the shared helper
  list()-copies and re-derives differently, breaking identity; and
- the tests use a MagicMock agent whose _tool_snapshot_generation is a mock, so
  the new `int < published_gen` generation guard raised TypeError and the whole
  ACP refresh silently failed.

ACP already preserves memory-provider tools (its own inject call) and excludes
context_engine, so there was no bug to fix there — only over-reach. Reverted ACP
to its original rebuild. (Same lesson as the gateway path: leave call sites that
carry their own tested contract alone; a reviewer's "inert today, fragile" note
meant leave-it, not change-it.)

Also hardened the generation guard defensively: tolerate a non-int
_tool_snapshot_generation (mock / partially-built agent) instead of throwing
TypeError and silently failing the refresh.
2026-06-19 11:57:43 -07:00
..
__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(acp): use tempfile.gettempdir() in workspace auto-approve 2026-05-19 03:05:10 -07:00
entry.py refactor(bootstrap): consolidate ACP browser bootstrap into install.{sh,ps1} (#27851) 2026-05-18 16:36:26 +05:30
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(mcp): revert ACP rebuild to original; harden generation guard 2026-06-19 11:57:43 -07:00
session.py fix(acp): replace direct db._lock/_conn access with public update_session_meta() 2026-06-04 17:54:59 -07:00
tools.py style: restore PEP8 blank-line separation after dead-code removal 2026-05-29 04:22:27 -07:00