From d398cdb59cd02bc565ecbe54b2de6beb1e8c5e96 Mon Sep 17 00:00:00 2001 From: Adam Weidman Date: Tue, 12 May 2026 17:31:25 -0400 Subject: [PATCH] docs(core): update comments for composite session key in RemoteSessionInvocation --- packages/core/src/agents/remote-session-invocation.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/agents/remote-session-invocation.ts b/packages/core/src/agents/remote-session-invocation.ts index d15e39bb6e..94c40320c9 100644 --- a/packages/core/src/agents/remote-session-invocation.ts +++ b/packages/core/src/agents/remote-session-invocation.ts @@ -40,15 +40,16 @@ export interface SubagentInvocationOptions { * which wraps the A2A client streaming behind the AgentProtocol interface. * * Cross-invocation A2A session state (contextId/taskId) is persisted via a - * static map keyed by agent name, matching the original RemoteAgentInvocation - * behavior. + * static map keyed by a composite of agent name and target URL. This ensures + * agents with the same name but different endpoints maintain independent state. */ export class RemoteSessionInvocation extends BaseToolInvocation< RemoteAgentInputs, ToolResult > { // Persist A2A conversation state across ephemeral invocation instances. - // Keyed by agent name — each remote agent maintains independent state. + // Keyed by composite of name + target URL so agents with the same name + // but different endpoints don't share state. private static readonly sessionState = new Map< string, { contextId?: string; taskId?: string }