fix(a2a): wait for final replies before resolving RPCs - #370
Open
hashbender wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes two integration bugs in the A2A plugin branch from NousResearch#41711:
A2AAdapter.connect()accepts adapter-agnostic gateway reconnect kwargs such asis_reconnect.The important behavior change is in
A2AAdapter.send(): only sends marked withmetadata["notify"] == Truesatisfy 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:
contextIdmulti-turn fix by @knoalsend()lock race fix by @knoalThis PR is intentionally based on
hermes/hermes-8d223d48, the head branch for NousResearch#41711, becausemaindoes 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
Changes Made
plugins/platforms/a2a/adapter.pyconnect()to accept**_kwargsfor gateway lifecycle compatibility.send()to ignore non-final sends while a context has a pending A2A reply future.fut.done()/fut.set_result()so this remains compatible with the race fix from fix(a2a): hold lock across fut.done/set_result in send() to fix race NousResearch/hermes-agent#53757.tests/plugins/test_a2a_plugin.pymetadata={"notify": True}final marker the gateway uses.connect(is_reconnect=True).How to Test
Result from this branch:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — N/Acli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Focused A2A plugin suite:
Mirror-of: NousResearch#56437
NousResearch#56437