[FEATURE] Mods API: carry the sender's agent id and one delivery id on every agent message
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
High Command (github.com/dot-agi/high-command) is a mod that shows agent messages in one thread per sender. Claude Code 2.1.296, macOS.
A named subagent's SendMessage to the main conversation does not raise session.receive. It reaches prompt.submit with origin: { kind: 'peer' }, documented as "Another Claude session's message". That variant is only kind: 'peer';, with no sender field.
So the mod reads the sender from the <agent-message> frame text. A plugin can write or rewrite that frame. Names are not unique: AgentInfo.name says "Two agents may hold one name: id tells them apart."
The other hooks carry different ids, and nothing joins them:
SessionSendInput.agentId: "The id of the loop sending".SessionReceiveInput.agentId: "The id of the loop the delivery is for".SessionReceiveOrigin.plugin: "AS THE SENDER SAYS".SessionSendResultreturnsisDeliveredand no id.
Proposed Solution
PromptOrigin{ kind: 'peer' }from an agent of this session: addagentId?: string(the sender'sAgentInfo.id),plugin?: string(as onSessionReceiveOrigin) anddeliveryId: string. Engine-stamped and pinned.SessionReceiveOriginpeerandcoordinator: addfromAgentId?: stringanddeliveryId: string.SessionSendResult{ isDelivered: true }: return the samedeliveryId.- Cross-session peers: add a stable
fromSessionIdwhen the engine knows it.
Alternative Solutions
Send every subagent-to-main message through session.receive with these fields. The only join today matches session.send text to the next peer prompt. It fails for identical or rewritten texts.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
This closes three known limits in High Command's README:
- Two senders with one name share one row.
- A mod-written subagent message still gets the
local senderlabel. - A message between the main conversation and an agent can show twice, in the main inbox and in the agent's lane.
Additional Context
Generated types/claude-code/index.d.ts (2.1.296), lines 183, 8911, 11378, 11406, 11589, 11629.
Related, not the same: #94675, #89101, #97782, #92177.