Skip to content

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

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

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

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because of no activity in the last 15 days. It will be closed in the next 5 days unless it is tagged "no stalebot" or other activity occurs.

@github-actions github-actions Bot added the stale This issue or PR has become stale label Jul 26, 2026
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: design/EP-2153-a2a-session-isolation.md

Signed-off-by: Dmytro Rashko <dimetron@me.com>
@dimetron
dimetron force-pushed the dimetron/session_a2a branch from bfded41 to 3405856 Compare July 28, 2026 21:57
@github-actions github-actions Bot added the enhancement-proposal Indicates that this PR is for an enhancement proposal label Jul 28, 2026
@dimetron

Copy link
Copy Markdown
Contributor Author

Rebased on main — merge conflict resolved

This was conflicting in go/adk/pkg/tools/remote_a2a_tool.go. Rebased onto main (single commit, signed off), so the PR is mergeable again. The design doc moved from specs/a2a_sessions/EP_2153.md to design/EP-2153-a2a-session-isolation.md to match the repo layout.

go build ./..., go vet ./... and go test ./adk/... ./api/... are clean against current main.

Not stale — please take another look when you have a moment.

@github-actions github-actions Bot removed the stale This issue or PR has become stale label Jul 29, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale because of no activity in the last 15 days. It will be closed in the next 5 days unless it is tagged "no stalebot" or other activity occurs.

@github-actions github-actions Bot added the stale This issue or PR has become stale label Aug 14, 2026
@EItanya EItanya closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request enhancement-proposal Indicates that this PR is for an enhancement proposal stale This issue or PR has become stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants