feat: Add support for extension headers on client side#227
feat: Add support for extension headers on client side#227guglielmo-san merged 37 commits intoa2aproject:mainfrom
Conversation
Summary of ChangesHello @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 client-side capabilities by introducing a robust interception framework and explicit support for extension headers. The new interceptor pattern allows for greater control and customization of client-server interactions, while the extension header support enables more flexible communication protocols. These changes improve the extensibility and adaptability of the client library. Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces a powerful interceptor mechanism for client-side calls, which is a great addition for extensibility. The implementation is well-structured, with clear separation of concerns in the new interceptors.ts file and good test coverage for the new functionality. I've found a few areas for improvement: one is a minor API design suggestion to make RequestOptions.context optional, another is a bug fix for the non-streaming fallback in sendMessageStream where after interceptors were not being called, and finally a suggestion to refactor some duplicated code in the streaming methods to improve maintainability. Overall, this is a solid contribution.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for extension headers on the client side. The changes include updating the RequestOptions interface, adding helper functions to generate and parse extension headers, and integrating this logic into the JsonRpcTransport. A new test file is also added to verify the functionality. The implementation is solid, but I have identified a potential bug in the header parsing logic and a minor improvement for type safety in the tests. Overall, great work on implementing this feature.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for client-side extension headers. It adds a serviceParameters option to requests, which is then used by the JSON-RPC transport to include custom headers. The response headers are also parsed for activated extensions. The changes are well-tested. I've found one potential issue regarding the order of properties when constructing request headers, which could lead to important headers being unintentionally overridden. My review includes a suggestion to fix this.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [0.3.6](v0.3.5...v0.3.6) (2025-12-10) ### Features * add support for extendedAgentCard on client side ([#234](#234)) ([3073376](3073376)) * Add support for extension headers on client side ([#227](#227)) ([8c57002](8c57002)) * implement client interceptors ([#223](#223)) ([5694c22](5694c22)) * Implement extended card support on server side ([#197](#197)) ([45014ac](45014ac)) * implement server http+json ([#142](#142)) ([f20e662](f20e662)) * introduce AgentCardResolver ([#225](#225)) ([ddaf7de](ddaf7de)) * introduce transport agnostic client ([#198](#198)) ([94a9848](94a9848)) * server side support for extensions ([5ef7396](5ef7396)) * support authentication on server side ([#195](#195)) ([9872d93](9872d93)) ### Bug Fixes * handle errors occurred in non-blocking sendMessage ([#187](#187)) ([e55c0f4](e55c0f4)) ### Miscellaneous Chores * set version to 0.3.6 ([#191](#191)) ([3f8cea0](3f8cea0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Ivan Shymko <ishymko@google.com>
Description
This PR implements the support for extensions on client side
Fixes #170 🦕
Release-As: 0.3.6