Skip to content

feat: implement gRPC server#279

Merged
guglielmo-san merged 79 commits into
a2aproject:mainfrom
guglielmo-san:guglielmoc/ts-proto-for-grpc
Jan 15, 2026
Merged

feat: implement gRPC server#279
guglielmo-san merged 79 commits into
a2aproject:mainfrom
guglielmo-san:guglielmoc/ts-proto-for-grpc

Conversation

@guglielmo-san

@guglielmo-san guglielmo-san commented Dec 18, 2025

Copy link
Copy Markdown
Member

Description

This Pull Request implements server-side support for the gRPC transport protocol.

Schema and Generation
The implementation is based on A2A Proto Specification v3.0.0.

Tooling
ts-proto was adopted for generating TypeScript service definitions (with buf), which will reuse the message types previously generated (this requires a manual modification of the generated file).

Limitations
Due to the current dependency on Proto v3.0.0, the gRPC implementation is missing some APIs already available for other transports, for example the getExtendedAuthenticatedAgentCard method.
These missing endpoints will be implemented with future official releases of proto specification.

Entry Points
A new dedicated entry point has been introduced to export the gRPC server logic and @grpc/grpc-js and its related transport libraries have been added as peer dependencies.

Fixes #275 🦕

BEGIN_COMMIT_OVERRIDE
feat: implement gRPC server (#279)

Release-As: 0.3.9
END_COMMIT_OVERRIDE

@guglielmo-san

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @guglielmo-san, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the server's communication capabilities by integrating the gRPC transport protocol. This foundational change allows for more efficient and structured communication, laying the groundwork for improved performance and interoperability. The implementation includes new dependencies, generated protobuf types, and a robust gRPC server handler with comprehensive type conversion and error handling.

Highlights

  • gRPC Protocol Implementation: Full server-side support for the gRPC transport protocol has been added, enabling high-performance, structured communication.
  • New Dependencies: Key gRPC-related packages such as @grpc/grpc-js, google-proto-files, and ts-proto were introduced to support the new protocol.
  • Protobuf Type Generation: New scripts and generated TypeScript files for Google API and Protobuf types (e.g., google/api/, google/protobuf/) are now part of the codebase.
  • gRPC Server Handler: Dedicated gRPC handler (grpc_handler.ts) and transport handler (grpc_transport_handler.ts) were implemented to manage gRPC requests and responses, including error mapping and context building.
  • Type Conversion Utilities: A new utility (proto_type_converter.ts) was added to facilitate seamless conversion between internal data structures and gRPC protobuf types.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@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 introduces gRPC transport support on the server side, which is a significant feature addition. The changes include adding new dependencies, generating TypeScript types from protobuf definitions, and implementing the gRPC service handlers. The overall structure is well-designed, with a clear separation of concerns between transport-specific handling and the core request handler. I've identified a few areas for improvement: one is a potential bug in how resource names are parsed, another is a suggestion to improve the robustness of header parsing, and a final one is a recommendation to vendor the .proto file for better build stability. The new tests provide good initial coverage for the gRPC functionality.

Comment thread src/grpc/utils/proto_type_converter.ts Outdated
Comment thread package.json Outdated
Comment thread src/server/grpc/grpc_handler.ts Outdated

@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 introduces gRPC transport support on the server side, a significant feature enhancement. The changes include adding new dependencies, generating TypeScript code from protobuf definitions, and implementing the gRPC handlers and transport logic. My review focuses on the new implementation files, highlighting areas for improvement in error handling, dependency management, and code clarity. The key suggestions involve correcting a dependency downgrade, using specific error types for better gRPC status mapping, fixing a bug in metadata handling, and refactoring duplicated code.

Comment thread package.json
Comment thread src/grpc/utils/proto_type_converter.ts Outdated
Comment thread src/grpc/utils/to_proto.ts
Comment thread src/server/grpc/grpc_handler.ts Outdated
Comment thread src/server/grpc/grpc_handler.ts Outdated
guglielmo-san and others added 7 commits December 18, 2025 23:32
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@guglielmo-san

Copy link
Copy Markdown
Member Author

/gemini review

@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 introduces gRPC support on the server side, which is a great feature. The implementation is well-structured, with clear separation of concerns between the gRPC handler, the transport handler, and the type converters. The use of a wrapUnary helper in grpc_handler.ts is a good pattern to reduce boilerplate code.

I've left a couple of comments on potential improvements. The most significant one is regarding the lack of pagination support in the listTaskPushNotificationConfig endpoint. Additionally, there are some unused error codes in the error mapping that could be cleaned up, and a suggestion to improve script maintainability in package.json.

One general point to consider is the inclusion of auto-generated files (from .proto definitions) in the source control. While this can simplify the build process for consumers of the repository, it's often recommended to generate these files as part of the build step to keep the source repository cleaner and avoid large diffs when the proto files change. This is a project-level decision, but something to keep in mind.

Comment thread src/grpc/utils/to_proto.ts Outdated
Comment thread package.json Outdated
Comment thread src/server/grpc/grpc_service.ts
Comment thread tck/agent/index.ts Outdated
Comment thread src/server/grpc/index.ts
Comment thread src/grpc/buf.gen.yaml Outdated
Comment thread src/grpc/pb/a2a_services.ts
Comment thread src/server/grpc/common.ts Outdated
Comment thread src/server/grpc/grpc_handler.ts Outdated
Comment thread src/server/grpc/grpc_service.ts
Comment thread src/server/grpc/grpc_handler.ts Outdated
Comment thread src/types.ts Outdated
Comment thread vitest.edge.config.ts
@guglielmo-san guglielmo-san requested a review from ishymko January 14, 2026 16:42
@ishymko ishymko changed the title feat: Implementation of gRPC transport protocol on server side feat: implement GRPC server Jan 15, 2026
Comment thread src/server/grpc/grpc_service.ts
Comment thread src/server/grpc/grpc_handler.ts Outdated
Comment thread vitest.config.ts Outdated
@guglielmo-san guglielmo-san requested a review from ishymko January 15, 2026 11:37
Co-authored-by: Ivan Shymko <vana.shimko@gmail.com>
Comment thread package.json
@guglielmo-san guglielmo-san enabled auto-merge (squash) January 15, 2026 12:08
@guglielmo-san guglielmo-san merged commit bd4caa2 into a2aproject:main Jan 15, 2026
14 checks passed
@guglielmo-san guglielmo-san deleted the guglielmoc/ts-proto-for-grpc branch January 15, 2026 12:56
@ishymko ishymko changed the title feat: implement GRPC server feat: implement gRPC server Jan 16, 2026
@guglielmo-san guglielmo-san mentioned this pull request Jan 19, 2026
4 tasks
ishymko pushed a commit that referenced this pull request Jan 21, 2026
🤖 I have created a release *beep* *boop*
---


## [0.3.9](v0.3.8...v0.3.9)
(2026-01-21)


### Features

* implement gRPC client
([#299](#299))
([dbdb96e](dbdb96e))
* implement gRPC server
([#279](#279))
([bd4caa2](bd4caa2))


### Bug Fixes

* use proto default values in generated a2a_types.ts
([#303](#303))
([0215d42](0215d42))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Add support for gRPC

2 participants