Skip to content

fix(executor): derive peer_id + peer_name distinctly from chat_id - #34

Merged
HongmingWang-Rabbit merged 2 commits into
mainfrom
fix/peer-id-distinct-from-chat-id
May 3, 2026
Merged

HongmingWang-Rabbit merged 2 commits into
mainfrom
fix/peer-id-distinct-from-chat-id

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Self-review followup to PR #32 (see issue #33).

The plugin /a2a/inbound payload set chat_id, peer_id, and peer_name all to the same derived task_id. Wire-accepted but semantically wrong:

  • chat_id — per-conversation key (stable across turns) ✅
  • peer_id — sender workspace UUID
  • peer_name — sender's registered display name

Adds _derive_peer_identity(context, *, fallback) that picks up real values from context.message (peer_id / peer_name, plus legacy sender_id / from_name) when the a2a-sdk surfaces them. Falls back to chat_id otherwise — current behavior preserved when no peer fields are present.

Test plan

  • 3 new unit tests cover: missing message → fallback; explicit peer fields → used; legacy attrs (sender_id / from_name) → used.
  • Full suite: 39 tests pass (was 36).
  • No prod-payload shape change for single-tenant proxy use; only enriches when a2a-sdk has the data.

🤖 Generated with Claude Code

HongmingWang-Rabbit and others added 2 commits May 2, 2026 17:57
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>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit 29651a4 into main May 3, 2026
9 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/peer-id-distinct-from-chat-id branch May 3, 2026 10:59
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