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 blocking — return_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.
Motivation & Context
The A2A hosting adapter currently uses a server-side
AgentRunModeto decide whether the agent runs in background mode. This predates the A2A spec'sSendMessageConfiguration.return_immediatelyfield, which gives the caller control over execution mode.Per the A2A spec:
When
SendMessageConfigurationis absent entirely, the default is also blocking —return_immediatelyis aboolthat defaults tofalseper the protobuf definition.The current
AgentRunMode(DisallowBackground,AllowBackgroundIfSupported, dynamic delegate) ignores the caller's intent and makes this a server-only decision.Description
Replace
AgentRunModewith logic that honorsreturn_immediately:configurationis present, usereturn_immediatelyto setAllowBackgroundResponses.configurationis absent, default to blocking (AllowBackgroundResponses = false), matching the spec default.