Skip to content

[Bug]: Timeout behavior for long-running agent responses #684

@benedict-khoo-sap

Description

@benedict-khoo-sap

What happened?

Observed behavior

When response chunks from AgentExecutor.execute take more than several seconds to produce, a 503 timeout error is received on the A2A SDK client when using certain transport protocols and streaming/polling configurations.

Methodology

For my tests, I used

  • v0.3.22 of the SDK
  • 10s delay before the first response chunk
  • 10s delay after the first two response chunk
  • JSONRPC and HTTP+JSON
  • Streaming and non-blocking polling via tasks/get

Code to reproduce results: https://github.com/benedict-khoo-sap/a2a-python-long-running-response-demo

Summary

Here is a summary table of the results observed:

Server Type Mode 10s delay before the first response chunk 10s delay after the first two response chunk all response chunks sent quickly
JSONRPC Streaming ❌ Timeout error after several seconds ⚠️ First 2 chunks received, then timeout error after several seconds ✅ Works fine
JSONRPC Polling ❌ Timeout error after several seconds ✅ Works fine ✅ Works fine
HTTP+JSON Streaming ✅ Works fine ✅ Works fine ✅ Works fine
HTTP+JSON Polling ❌ Timeout error after several seconds ✅ Works fine ✅ Works fine

Potential related issue

#545 may be the cause of the issue in JSONRPC implementations, but HTTP+JSON with polling has the same timeout error if the first response chunk takes too long to return

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions