Skip to content

feat: add AgentCard to interceptors parameters#236

Merged
guglielmo-san merged 7 commits intoa2aproject:mainfrom
guglielmo-san:add_agentCard_to_interceptor_args
Dec 8, 2025
Merged

feat: add AgentCard to interceptors parameters#236
guglielmo-san merged 7 commits intoa2aproject:mainfrom
guglielmo-san:add_agentCard_to_interceptor_args

Conversation

@guglielmo-san
Copy link
Member

Description

This PR add a feature to PR #223 adding the agentCard to the interceptors' parameters. Some values of the agentCard may be necessary at the interceptors level (e.g. security schemes).

BEGIN_COMMIT_OVERRIDE
refactor: add AgentCard to interceptors parameters
END_COMMIT_OVERRIDE

@gemini-code-assist
Copy link
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 refactors the client-side interceptor mechanism to expose the AgentCard data directly to interceptors. By making the AgentCard available in both pre- and post-execution arguments, interceptors can now utilize agent-specific details, like security configurations, to perform more context-aware operations or validations, thereby improving the flexibility and power of the interception pipeline.

Highlights

  • Interceptor Parameters: The AgentCard object is now included as a parameter in both BeforeArgs and AfterArgs interfaces for client-side interceptors.
  • Enhanced Interceptor Logic: This change allows interceptors to access agent-specific information, such as security schemes from the AgentCard, enabling more sophisticated logic within the interceptor chain.
  • Integration with Existing Feature: This pull request builds upon and enhances the functionality introduced in PR feat: implement client interceptors #223.
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.

Copy link
Contributor

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

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 aims to add the agentCard to interceptor parameters. The implementation correctly updates the necessary interfaces and the generic executeWithInterceptors method. However, the changes are incomplete as the streaming methods (sendMessageStream and resubscribeTask) have not been updated to pass the agentCard. Additionally, tests have not been updated to validate the new functionality. I've added specific comments with suggestions to address these issues.

@guglielmo-san guglielmo-san requested a review from ishymko December 8, 2025 08:49
@guglielmo-san guglielmo-san requested a review from ishymko December 8, 2025 13:33
@guglielmo-san guglielmo-san enabled auto-merge (squash) December 8, 2025 14:03
@guglielmo-san guglielmo-san merged commit 4785479 into a2aproject:main Dec 8, 2025
6 checks passed
@guglielmo-san guglielmo-san deleted the add_agentCard_to_interceptor_args branch December 8, 2025 14:05
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.

2 participants