Skip to content

feat(go-adk): add per-call session isolation for Agent tools#2202

Draft
dimetron wants to merge 1 commit into
kagent-dev:mainfrom
dimetron:dimetron/session_a2a
Draft

feat(go-adk): add per-call session isolation for Agent tools#2202
dimetron wants to merge 1 commit into
kagent-dev:mainfrom
dimetron:dimetron/session_a2a

Conversation

@dimetron

Copy link
Copy Markdown
Contributor

Add an isolateSessions flag to Agent tools so a declarative coordinator can fan out parallel, isolated sub-agent calls: when set, a fresh A2A context_id is minted per call instead of reusing one stable id for the tool's lifetime.

Also replace the per-branch map[string]any tool return with a single typed remoteA2AResponse so subagent_session_id is reported on every outcome (success, input_required, failure, non-terminal, no-result). processResult now switches explicitly on the terminal task state and passes through child-provided structured failure fields with sub-agent task linkage.

  • v1alpha2 Tool.IsolateSessions (*bool, Agent-only via CEL) -> adk RemoteAgentConfig.IsolateSessions via the translator; Python config parity.
  • NewKAgentRemoteA2ATool takes a RemoteA2AToolConfig struct; isolated tools return an empty stamp id and add no subagentSessionIDs entry (UI links via the per-call id in the function_response instead).
  • Unit tests for contextIDForCall, every processResult branch, structured failure passthrough, and the translator wiring.

Design: specs/a2a_sessions/EP_2153.md

Add an isolateSessions flag to Agent tools so a declarative coordinator can
fan out parallel, isolated sub-agent calls: when set, a fresh A2A context_id
is minted per call instead of reusing one stable id for the tool's lifetime.

Also replace the per-branch map[string]any tool return with a single typed
remoteA2AResponse so subagent_session_id is reported on every outcome
(success, input_required, failure, non-terminal, no-result). processResult
now switches explicitly on the terminal task state and passes through
child-provided structured failure fields with sub-agent task linkage.

- v1alpha2 Tool.IsolateSessions (*bool, Agent-only via CEL) -> adk
  RemoteAgentConfig.IsolateSessions via the translator; Python config parity.
- NewKAgentRemoteA2ATool takes a RemoteA2AToolConfig struct; isolated tools
  return an empty stamp id and add no subagentSessionIDs entry (UI links via
  the per-call id in the function_response instead).
- Unit tests for contextIDForCall, every processResult branch, structured
  failure passthrough, and the translator wiring.

Design: specs/a2a_sessions/EP_2153.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant