Skip to content

[Feat]: Advanced Error Handling in A2AClient for timeouts #249

@njbrake

Description

@njbrake

Is your feature request related to a problem? Please describe.

Discovered while debugging mozilla-ai/any-agent#529

In the A2A client, there is a super helpful parameter to be able to change any of the HTTP arguments, such as timeouts. I've been using this a fair amount because when I make a request to an agent, sometimes that agent can take a while to respond if it's doing some more complicated tasks. Right now, my implementation does not use the streaming API, it sends a message and waits for the response.

When I was building up a sample, I found that I was getting some 503 error codes with no description attached. It took me a while to figure out that the problem was that my client was timing out because there wasn't any specific description about what was happening in the error.

The code at https://github.com/a2aproject/a2a-python/blob/main/src/a2a/client/client.py#L112 wraps any request with a generic 503 code.

Describe the solution you'd like

I think it would be good to have a more flexible handling for request errors, or at least to provide back some more specific detail details if the problem is because of a request timeout.

Describe alternatives you've considered

No response

Additional context

No response

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions