You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feat]: Add RetryTransport for automatic retry with exponential backoff #871
Is your feature request related to a problem? Please describe.
The SDK's transports (JsonRpcTransport, RestTransport, GrpcTransport) raise immediately on transient failures (network errors, timeouts, rate limits, 5xx responses, gRPC UNAVAILABLE/RESOURCE_EXHAUSTED) with no built-in retry mechanism. Every caller has to reimplement the same retry/backoff loop, and to do it correctly they have to inspect __cause__ chains because A2AClientError doesn't expose HTTP status codes or gRPC codes directly.
Describe the solution you'd like
A RetryTransport decorator wrapping any ClientTransport, mirroring the existing TenantTransportDecorator pattern:
A2AClientError chained from httpx.RequestError or httpx.HTTPStatusError(408/429/502/503/504).
A2AClientError chained from grpc.aio.AioRpcError(UNAVAILABLE/RESOURCE_EXHAUSTED).
Domain errors (TaskNotFoundError, etc.) are never retried.
retry_predicate is configurable for custom logic, and on_retry is exposed as a hook for logging/metrics. Streaming methods (send_message_streaming, subscribe) only retry before the first event is yielded.
Describe alternatives you've considered
Retry via ClientCallInterceptor — not feasible; after() only fires on successful results, so interceptors never see exceptions.
Transport-specific retry (httpx custom transport, gRPC retryPolicy / UnaryUnaryClientInterceptor) — operates below the SDK's exception layer, requires two separate configurations, and doesn't cover all three transports uniformly.
Retry inside each transport implementation — triples the logic across JsonRpcTransport, RestTransport, GrpcTransport and forces every future transport to reimplement it.
Additional context
Purely additive: new RetryTransport class, tests, and one export change. No new dependencies — the grpc import is conditional, matching the SDK's existing pattern. ClientFactory integration is left as a follow-up.
Hi @ishymko — congrats on the v1 release! I see this PR was closed when 1.0-dev was deleted as part of the cleanup. Is this feature still of interest for a future release? Happy to rebase onto whichever branch is the right target now. Thanks!
Yeah the PR got auto-closed due to branch removal, this branch was merged to main now after 1.0 stable release.
It makes sense conceptually but details require careful review, would you mind consolidating PR description, issue description and 1.0-dev notes comment (and update this issue description)? Lower level details can be discussed in the PR, let's focus on the most important aspects to make it more compact.
Activity
cchinchilla-dev commentedon Mar 19, 2026
rohityan commentedon Mar 25, 2026
Hi @cchinchilla-dev , thanks for the detailed approach. Please submit a PR when you are ready.
cchinchilla-dev commentedon Mar 25, 2026
@rohityan Thanks for the confirmation. I’m finalizing the implementation and will submit the PR shortly.
cchinchilla-dev commentedon Apr 22, 2026
Hi @ishymko — congrats on the v1 release! I see this PR was closed when
1.0-devwas deleted as part of the cleanup. Is this feature still of interest for a future release? Happy to rebase onto whichever branch is the right target now. Thanks!ishymko commentedon Apr 24, 2026
Hi @cchinchilla-dev, thank you!
Yeah the PR got auto-closed due to branch removal, this branch was merged to
mainnow after 1.0 stable release.It makes sense conceptually but details require careful review, would you mind consolidating PR description, issue description and 1.0-dev notes comment (and update this issue description)? Lower level details can be discussed in the PR, let's focus on the most important aspects to make it more compact.
Thank you!
cchinchilla-dev commentedon Apr 25, 2026
Hi @ishymko, thanks for the quick reply!
Consolidated as suggested: issue trimmed to rationale + alternatives, and implementation details + validation are in #1018.
Fully agree this needs careful review. No rush — happy to iterate.