Skip to content

fix(a2a): wait for final replies before resolving RPCs - #370

Open
hashbender wants to merge 1 commit into
hermes/hermes-8d223d48from
mirror/pr-56437
Open

fix(a2a): wait for final replies before resolving RPCs#370
hashbender wants to merge 1 commit into
hermes/hermes-8d223d48from
mirror/pr-56437

Conversation

@hashbender

Copy link
Copy Markdown
Owner

What does this PR do?

Fixes two integration bugs in the A2A plugin branch from NousResearch#41711:

  1. Inbound A2A RPCs now wait for the final gateway reply before resolving the blocked JSON-RPC request.
  2. A2AAdapter.connect() accepts adapter-agnostic gateway reconnect kwargs such as is_reconnect.

The important behavior change is in A2AAdapter.send(): only sends marked with metadata["notify"] == True satisfy the pending A2A reply future. Interim/status/editable sends are acknowledged locally but do not complete the RPC.

This is needed because NousResearch#41711 routes inbound A2A tasks into the live Hermes gateway session, following the design direction from NousResearch#11025. That is the right architecture, but the normal gateway path can emit progress/status/steering messages before the final answer. Without this guard, A2A callers can receive a compaction banner or steering notice instead of the actual task result.

Related contributor work:

This PR is intentionally based on hermes/hermes-8d223d48, the head branch for NousResearch#41711, because main does not contain the A2A plugin files yet.

Related Issue

Addresses NousResearch#56433 when NousResearch#41711 lands.

Also related: #514, #689, NousResearch#56434, NousResearch#56435.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • plugins/platforms/a2a/adapter.py
  • tests/plugins/test_a2a_plugin.py
    • Added regression coverage showing interim/editable sends do not resolve the pending reply future.
    • Updated the live inbound round-trip mock to send the same metadata={"notify": True} final marker the gateway uses.
    • Added coverage for connect(is_reconnect=True).

How to Test

  1. Check out this branch against the feat(a2a): consolidated Agent-to-Agent protocol plugin (closes #514) NousResearch/hermes-agent#41711 A2A branch.
  2. Run:
/home/hermes/.hermes/hermes-agent/venv/bin/python -m pytest -o addopts='' tests/plugins/test_a2a_plugin.py -q

Result from this branch:

.........................................                                [100%]
41 passed in 2.45s

Checklist

Code

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide
  • I've updated tool descriptions/schemas if I changed tool behavior — N/A

Screenshots / Logs

Focused A2A plugin suite:

/home/hermes/.hermes/hermes-agent/venv/bin/python -m pytest -o addopts='' tests/plugins/test_a2a_plugin.py -q
.........................................                                [100%]
41 passed in 2.45s

Mirror-of: NousResearch#56437
NousResearch#56437

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant