Skip to content

[FEATURE] Support for Full A2A Task Lifecycle States (especially input_required) #1371

@mikolamm

Description

@mikolamm

Problem Statement

The current Strands A2A integration (StrandsA2AExecutor) only supports a minimal subset of the A2A protocol's task lifecycle states. Specifically:

Current Implementation:

  • Uses only TaskState.working during streaming
  • Calls updater.complete() when done
  • cancel() raises UnsupportedOperationError

Missing A2A Task States:

State Purpose Currently Supported
submitted Initial task submission
working Task in progress
input_required Agent needs more user input
completed Task finished successfully
canceled Task intentionally stopped
failed Unrecoverable error occurred
rejected Agent refused the task
auth_required Authentication needed

The most critical missing state is input_required, which is essential for interactive agent workflows where an agent needs to pause execution and request additional information from the caller before proceeding.

Proposed Solution

  1. Expose the TaskUpdater to Strands agents so they can signal state transitions during execution:
# Example: Agent signals it needs more input
await updater.requires_input(
    message=new_agent_text_message("Please provide your API key to continue")
)
  1. Map Strands agent events to A2A states:

    • When a Strands agent uses an interrupt mechanism or similar, translate to input_required
    • Map exceptions/errors to failed state
    • Support explicit rejection via rejected state
  2. Implement cancel() support in StrandsA2AExecutor

  3. Add convenience methods or hooks in the Strands Agent that allow signaling these states:

# Hypothetical API
@tool
def process_request(context: ToolContext):
    if need_more_info:
        context.request_input("Please provide additional details")  # triggers input_required
    # ...

Use Case

Orchestrator-Subagent Communication with Mid-Process Input Requests

In multi-agent systems, an orchestrator delegates tasks to subagents via A2A. Subagents often need to:

  1. Request clarification - A subagent processing a document may need user confirmation on ambiguous content
  2. Gather missing information - A booking agent may need additional traveler details mid-workflow
  3. Obtain authorization - A financial agent may need approval before proceeding with a transaction
  4. Handle interactive workflows - Any agent that requires human-in-the-loop decision making

Example Flow:

Orchestrator → Subagent: "Book a flight to NYC"
Subagent → Orchestrator: [input_required] "What date would you prefer?"
Orchestrator → User: "The agent needs a date"
User → Orchestrator: "December 25th"
Orchestrator → Subagent: "December 25th"
Subagent → Orchestrator: [completed] "Flight booked for Dec 25th"

Without input_required support, subagents cannot properly pause and request information, breaking the interactive workflow pattern that A2A was designed to enable.

Alternatives Solutions

No response

Additional Context

  • A2A Protocol Specification: The Agent-to-Agent (A2A) protocol (spec) defines these task states as core to the protocol. The input_required state is specifically designed for interactive agent workflows.

  • Official A2A Python SDK: The a2a-python SDK provides a TaskUpdater class with convenience methods for all state transitions:

    • requires_input() - transitions to input_required
    • requires_auth() - transitions to auth_required
    • failed() - transitions to failed
    • reject() - transitions to rejected
    • cancel() - transitions to canceled
  • Event Consumer Behavior: The A2A event consumer is designed to stop consuming on input_required (see a2a-python#167), indicating this is a well-defined pause point in the protocol.

  • Strands has related concepts: The SDK already has interrupt types (src/strands/types/interrupt.py) and hooks system that could potentially be leveraged for implementing these state transitions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions