SIGN IN SIGN UP

Fix gRPC client interceptor breaking bidirectional streaming (#1180) (#4259)

* Fix gRPC client interceptor breaking bidirectional streaming (#1180)

Route bidi (stream-stream) RPCs through `_intercept` instead of the
generator-based `_intercept_server_stream`. The generator wrapper strips
the grpc.Call/grpc.Future interface, causing downstream code (e.g.
google.api_core.bidi.BidiRpc) to crash with:

    AttributeError: 'generator' object has no attribute 'add_done_callback'

The fix adds `and not client_info.is_client_stream` to the condition in
`intercept_stream()` so only unary-stream RPCs use the generator path.

Includes a regression test verifying the bidi stream response preserves
the grpc.Call interface (add_done_callback, cancel, is_active).

Co-authored-by: Cursor <cursoragent@cursor.com>

* Add gRPC status code attributes to error handling in client

* Remove redundant status description from span error status

The gRPC status code is already captured in the RPC_GRPC_STATUS_CODE
attribute, making the description in span status unnecessary.

* Update CHANGELOG.md

* Update CHANGELOG.md

* Add RPC_GRPC_STATUS_CODE assertions to client error tests

Verify that error spans include the correct gRPC status code attribute
(INVALID_ARGUMENT) in both sync and async client interceptor tests.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
J
Juan Calvo Pozo committed
bd01dcd720b0a47261c939f2a136ab07d5a0f550
Parent: 7930a15
Committed by GitHub <noreply@github.com> on 3/19/2026, 9:03:37 AM