fix(executor): derive peer_id + peer_name distinctly from chat_id - #34
Merged
Merged
Conversation
The plugin /a2a/inbound payload set chat_id, peer_id, and peer_name all to the same derived task_id. Wire-correct (the plugin accepts it) but semantically wrong: peer_id is the sender workspace UUID, peer_name is its registered display name, and chat_id is the per-conversation key. Sending all three equal makes plugin logs unreadable and would misroute if the plugin ever uses peer_id for peer-aware dispatch. Add _derive_peer_identity(context, fallback=chat_id) that picks up peer_id / peer_name (and legacy sender_id / from_name) from context.message when the a2a-sdk surfaces them. Falls back to chat_id otherwise, preserving today's behavior. Caught in self-review of PR #32 — see hermes-template issue #33 for the broader PR-discipline followup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Self-review followup to PR #32 (see issue #33).
The plugin
/a2a/inboundpayload setchat_id,peer_id, andpeer_nameall to the same derivedtask_id. Wire-accepted but semantically wrong:chat_id— per-conversation key (stable across turns) ✅peer_id— sender workspace UUIDpeer_name— sender's registered display nameAdds
_derive_peer_identity(context, *, fallback)that picks up real values fromcontext.message(peer_id/peer_name, plus legacysender_id/from_name) when the a2a-sdk surfaces them. Falls back tochat_idotherwise — current behavior preserved when no peer fields are present.Test plan
🤖 Generated with Claude Code