Skip to content

.NET: Replace AgentRunMode with SendMessageConfiguration.return_immediately #7367

Description

@SergeyMenshykh

Motivation & Context

The A2A hosting adapter currently uses a server-side AgentRunMode to decide whether the agent runs in background mode. This predates the A2A spec's SendMessageConfiguration.return_immediately field, which gives the caller control over execution mode.

Per the A2A spec:

  • Blocking (return_immediately: false or unset): The operation MUST wait until the task reaches a terminal or interrupted state before returning. This is the default behavior.
  • Non-Blocking (return_immediately: true): The operation MUST return immediately after creating the task.

When SendMessageConfiguration is absent entirely, the default is also blockingreturn_immediately is a bool that defaults to false per the protobuf definition.

The current AgentRunMode (DisallowBackground, AllowBackgroundIfSupported, dynamic delegate) ignores the caller's intent and makes this a server-only decision.

Description

Replace AgentRunMode with logic that honors return_immediately:

  • When configuration is present, use return_immediately to set AllowBackgroundResponses.
  • When configuration is absent, default to blocking (AllowBackgroundResponses = false), matching the spec default.

Metadata

Metadata

Labels

.NETUsage: [Issues, PRs], Target: .Neta2aUsage: [Issues, PRs], Target: A2A

Type

Projects

Status
Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions