molecule-core/workspace/tests/snapshots
Hongming Wang 09e99a09c6 feat(a2a-mcp): add chat_history tool for prior turns with a peer
When a peer_agent push lands and the agent needs context from prior
turns with that workspace ("what task did this peer assign me last
hour?", "what did I tell them?"), the only options today are
re-deriving from memory (lossy) or scrolling activity_logs in the
canvas (no agent-facing tool). Surface the platform's existing
audit log directly via a new MCP tool so agents can read both sides
of an A2A conversation in chronological order.

Implementation:
- a2a_tools.py: new tool_chat_history(peer_id, limit=20, before_ts="")
  hits /workspaces/<self>/activity?peer_id=X&limit=N (the new server
  filter from molecule-core#2472). Reverses the DESC response into
  chronological order so the agent reads top-down. Graceful error
  envelope on validation/network/non-200 — never crashes the MCP
  server, agent can branch on Error: prefix.
- platform_tools/registry.py: ToolSpec wired into the A2A section so
  the rendered system-prompt block automatically includes it. Same
  pattern as the existing inbox_peek/inbox_pop/wait_for_message.
- a2a_mcp_server.py: dispatch in handle_tool_call.
- executor_helpers.py: _CLI_A2A_COMMAND_KEYWORDS gets a None entry
  (CLI runtimes don't expose chat history today; flip to a keyword
  when a2a_cli grows a `history` subcommand).
- snapshots/a2a_instructions_mcp.txt regenerated.

Tests: 10 new branches in TestChatHistory (validation / param
forwarding / limit cap / before_ts pass-through / DESC→chronological
reorder / 400 verbatim / 500 generic / network exc / non-list resp).
Mutation-verified: reverting a2a_tools.py fails 10/10. Full test
suite remains green at 1516 passed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 17:54:23 -07:00
..
a2a_instructions_cli.txt chore(registry): snapshot tests + CLI-block alignment for #2240 2026-04-28 20:42:15 -07:00
a2a_instructions_mcp.txt feat(a2a-mcp): add chat_history tool for prior turns with a peer 2026-05-01 17:54:23 -07:00
adapter_base_signature.json test(adapter_base): extend signature snapshot to public dataclasses (#2364 item 2 followup) 2026-04-30 05:53:10 -07:00
hma_instructions.txt chore(registry): snapshot tests + CLI-block alignment for #2240 2026-04-28 20:42:15 -07:00
platform_auth_signature.json test(platform_auth): module-functions signature snapshot drift gate 2026-04-30 08:41:42 -07:00
runtime_wedge_signature.json test(runtime_wedge): module-functions signature snapshot drift gate 2026-04-30 07:01:10 -07:00
skill_loader_signature.json test: extract shared signature-snapshot helpers + skill_loader gate 2026-04-30 06:27:20 -07:00