Skip to content

refactor(grpc): eliminate third-party grpcio-status dependency#1130

Open
Iwaniukooo11 wants to merge 2 commits into
a2aproject:mainfrom
Iwaniukooo11:mateusziwaniuk/refactor/remove-grpcio-status-rs1
Open

refactor(grpc): eliminate third-party grpcio-status dependency#1130
Iwaniukooo11 wants to merge 2 commits into
a2aproject:mainfrom
Iwaniukooo11:mateusziwaniuk/refactor/remove-grpcio-status-rs1

Conversation

@Iwaniukooo11

Copy link
Copy Markdown

PR: Eliminate grpcio-status Dependency

Summary

Dumped the third-party dependency grpcio-status to reduce the SDK's attack surface. Replaced it with native helper functions in the client and server transport layers.


Changes

  1. Dependencies: Removed grpcio-status from pyproject.toml and updated uv.lock.
  2. Client (grpc.py): Replaced rpc_status.from_call with a local _from_call helper that parses status payloads and validates details.
  3. Server (grpc_handler.py): Replaced rpc_status.to_status with a local _to_status helper that maps status codes and returns a typed GrpcStatus namedtuple.

Verification

Ran tests and linters locally with grpcio-status uninstalled:

./scripts/lint.sh
uv run pytest tests/client/transports/test_grpc_client.py tests/server/request_handlers/test_grpc_handler.py

Status: 73 tests passed, linter green.

@Iwaniukooo11 Iwaniukooo11 requested a review from a team as a code owner July 10, 2026 14:20

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the dependency on grpcio-status across the codebase. The grpc_status library usage has been replaced with custom, lightweight helper functions (_from_call in the gRPC client transport and _to_status in the gRPC server request handler) to extract and convert rich gRPC status details. Additionally, pyproject.toml was updated to remove grpcio-status from the grpc extra, and some minor formatting and indentation adjustments were made. There are no review comments, so I have no additional feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@Iwaniukooo11 Iwaniukooo11 force-pushed the mateusziwaniuk/refactor/remove-grpcio-status-rs1 branch 2 times, most recently from ddf51a7 to 3fa48cb Compare July 10, 2026 14:46
Replaced grpcio-status imports with local implementations _from_call and _to_status in client and server transport layers. Removed the grpcio-status dependency from pyproject.toml.
@Iwaniukooo11 Iwaniukooo11 force-pushed the mateusziwaniuk/refactor/remove-grpcio-status-rs1 branch from 3fa48cb to 0d77788 Compare July 10, 2026 14:55
@github-actions

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

Base PR Delta
src/a2a/client/transports/grpc.py 92.75% 88.55% 🔴 -4.20%
src/a2a/server/events/event_queue_v2.py 91.19% 91.71% 🟢 +0.52%
src/a2a/server/request_handlers/grpc_handler.py 95.42% 94.61% 🔴 -0.81%
src/a2a/utils/telemetry.py 90.70% 91.47% 🟢 +0.78%
Total 92.99% 92.92% 🔴 -0.07%

Generated by coverage-comment.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant