feat: Implement extended card support on server side#197
feat: Implement extended card support on server side#197guglielmo-san merged 15 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 server-side support for extended agent cards by introducing a flexible mechanism to modify these cards based on user authentication and other contextual information. It allows developers to inject custom logic via a new 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 support for an authenticated extended agent card, which can reveal more details to authenticated users. This is primarily achieved by adding an extendedCardModifier callback to the DefaultRequestHandler. The changes look good overall, but I've identified a few critical issues. The ServerCallContext, which contains authentication information, is not being passed to getAuthenticatedExtendedAgentCard in the JSON-RPC transport handler. Additionally, the new tests for this feature contain a bug that makes them pass incorrectly and they are not type-safe. I've also suggested a design improvement to the ExtendedCardModifier signature to make it more robust and useful by providing it with access to the public agent card.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
# Description This PR introduces a more robust implementation of the `getAuthenticatedExtendedAgentCard` API. The user may inject in the `default_request_handler` an AgentCart object or a callback (`ExtendedAgentCardProvider`) which receives as input parameters the `ServerCallContext` and returns an AgentCard object. - If extendedAgentCardProvider is provided as callback: The logic delegates entirely to the callback. This allows consumers to implement custom authorization check if the user has insufficient permissions. - If extendedAgentCardProvider is provided as AgentCard object: 1. User in context is Authenticated: Returns extendedAgentCard. 2. User in context is Unauthenticated: Returns the basic agentCard. Fixes a2aproject#196 🦕 Release-As: 0.3.6 --------- 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 introduces a more robust implementation of the
getAuthenticatedExtendedAgentCardAPI.The user may inject in the
default_request_handleran AgentCart object or a callback (ExtendedAgentCardProvider) which receives as input parameters theServerCallContextand returns an AgentCard object.1. User in context is Authenticated: Returns extendedAgentCard.
2. User in context is Unauthenticated: Returns the basic agentCard.
Fixes #196 🦕
Release-As: 0.3.6