Repository navigation
fix(compat): honor ClientCallContext.timeout in the v0.3 gRPC client - #1497
Merged
Iwaniukooo11 merged 2 commits intoNov 20, 2026
Merged
Conversation
CompatGrpcTransport called every stub method with only `metadata=`, so the per-call `timeout` in `ClientCallContext` never reached gRPC. A call to a slow or hung v0.3 gRPC server therefore waited forever, even though the caller had set a deadline, and the DEADLINE_EXCEEDED -> A2AClientTimeoutError mapping in this transport could never fire for it. The v1.0 GrpcTransport and the HTTP transports already pass the timeout through (a2aproject#776). CompatGrpcTransport landed right after that change and did not pick it up. Pass `timeout=` on all ten stub calls, the same way GrpcTransport does.
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/compat/v0_3/grpc_transport.py | 68.75% | 88.27% | 🟢 +19.52% |
| Total | 93.81% | 94.11% | 🟢 +0.29% |
Generated by coverage-comment.yml
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The v0.3 gRPC client (
compat/v0_3/grpc_transport.py) never passedClientCallContext.timeoutto its gRPC calls, so a caller's per-call timeout was silently ignored for all 10 methods (streaming included): a call to a slow or stuck v0.3 agent waited until the server answered, and the transport's ownA2AClientTimeoutErrormapping could never fire for a caller deadline. The timeout setting was added for all transports in #776; the v0.3 gRPC client (#779) landed just after and missed it. The v1.0 gRPC and HTTP clients already honour it.Fix: pass
timeout=self._get_grpc_timeout(context)on every call, using the same helper as the v1.0 gRPC client (client/transports/grpc.py).Testing
New parametrized test in
tests/compat/v0_3/test_grpc_transport.pychecking that each of the 10 calls receives the context's timeout.Before the fix:
Manual check against a real gRPC server that takes 2 s to answer, called with
timeout=0.2:Full suite:
ruff check,ruff formatandtypass on the changed files.CONTRIBUTINGGuide.Fixes #1496 🦕