molecule-core/workspace/tests/snapshots
Hongming Wang b47d4ceb00 feat(workspace-runtime): add inbox polling for standalone molecule-mcp path
The universal MCP server (a2a_mcp_server.py) was outbound-only — agents
in standalone runtimes (Claude Code, hermes, codex, etc.) could
delegate, list peers, and write memories, but never observed the
canvas-user or peer-agent messages addressed to them. This blocked
"constantly responding" loops without forcing operators back onto a
runtime-specific channel plugin.

This PR closes the inbound gap with a poller-fed in-memory queue and
three new MCP tools:

  - wait_for_message(timeout_secs?) — block until next message arrives
  - inbox_peek(limit?)              — list pending messages (non-destructive)
  - inbox_pop(activity_id)          — drop a handled message

A daemon thread polls /workspaces/:id/activity?type=a2a_receive every
5s, fills the queue from the cursor (since_id), and persists the cursor
to ${CONFIGS_DIR}/.mcp_inbox_cursor so a restart doesn't replay backlog.
On 410 (cursor pruned) we fall back to since_secs=600 for a bounded
recovery window. Activity-row → InboxMessage extraction mirrors the
molecule-mcp-claude-channel plugin's extractText (envelope shapes #1-3
+ summary fallback).

mcp_cli.main starts the poller alongside the existing register +
heartbeat threads. In-container runtimes (which have push delivery via
canvas WebSocket) skip activation, so inbox tools return an
informational "(inbox not enabled)" message instead of double-delivery.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 16:32:48 -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(workspace-runtime): add inbox polling for standalone molecule-mcp path 2026-04-30 16:32:48 -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