feat(a2a): propagate agent settings to experimental A2A server#21405
feat(a2a): propagate agent settings to experimental A2A server#21405alisa-alisa wants to merge 10 commits intogrpc-v0-branch4from
Conversation
|
Hi @alisa-alisa, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
|
This review is part of a big PR: #21348 |
Summary of ChangesHello, 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 finalizes the gRPC V0 integration by enabling the experimental A2A server to properly consume and utilize agent-related settings. This ensures that the server can leverage the new secure agent infrastructure and gRPC features, providing a programmatic interface equivalent to the CLI for agent management and communication. Highlights
Changelog
Activity
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 correctly propagates agent settings to the experimental A2A server by updating the configuration loading logic and adding corresponding tests. However, it introduces significant security concerns: defaulting enableAgents to true enables an SSRF attack vector via malicious agent definitions, and the new agents settings are vulnerable to insecure environment variable expansion when loaded from untrusted workspace directories, potentially leading to sensitive credential leakage. Additionally, there is a high-severity naming collision for the AgentSettings type within packages/a2a-server/src/config/config.ts that needs to be addressed for better maintainability.
0baaf47 to
a0e1717
Compare
1d0ba06 to
7611416
Compare
a0e1717 to
6047d93
Compare
f2b3367 to
cfae184
Compare
6047d93 to
1b9ccf8
Compare
cfae184 to
ff1911a
Compare
6453c5f to
a3ef0a5
Compare
ff1911a to
0a0b672
Compare
| import { v4 as uuidv4 } from 'uuid'; | ||
| import { logger } from '../utils/logger.js'; | ||
| import type { AgentSettings } from '../types.js'; | ||
| import { type AgentSettings as CoderAgentSettings } from '../types.js'; |
There was a problem hiding this comment.
Why alias this type? Is there a collision?
a3ef0a5 to
aca4e49
Compare
0a0b672 to
5b3c955
Compare
aca4e49 to
5d088c8
Compare
22160ff to
7875e33
Compare
6576088 to
e8be953
Compare
216277a to
6f4dea9
Compare
e8be953 to
0abe06e
Compare
6f4dea9 to
5f1474b
Compare
0abe06e to
f40f810
Compare
…rect gRPC URL - Pass empty string to resolver.resolve() to prevent SDK from appending /.well-known/agent-card.json to direct card URLs - Simplify normalizeAgentCard to only handle proto field name aliases (supportedInterfaces → additionalInterfaces, protocolBinding → transport) - Use gRPC-specific URL from additionalInterfaces for credentials - Remove dead helper functions and unnecessary behaviors - Add shallow copy to prevent SDK object mutation
f40f810 to
62d0ecf
Compare
5f1474b to
dc733a5
Compare
dc733a5 to
1d2ba62
Compare
7f2ab59 to
9f5c35d
Compare
Summary
This final PR completes the gRPC V0 integration by propagating the new agent settings to the experimental A2A server environment. It addresses critical security feedback regarding "secure by default" defaults and trust-gated environment variable expansion.
Details
enableAgentsandagentssettings, allowing for native remote agent discovery and gRPC communication within the server.enableAgentstofalse, matching the security posture of the core CLI and requiring explicit user opt-in for agent discovery.agentsblock) are loaded as "raw" values and only expanded via environment variables if the workspace is explicitly trusted. This prevents sensitive credential leakage (like GEMINI_API_KEY) from malicious repositories.AgentSettingstoCoderAgentSettings, improving code clarity and maintainability.Why this is needed
This PR ensures that the new gRPC and security features are fully accessible not just via the CLI, but also through the experimental Agent-to-Agent server, enabling programmatic access to the same secure agent infrastructure without introducing new attack vectors.
Related Issues
Resolves #18642.
How to Validate (Manual Repro)
1. Prepare the Go Server (a2a-go repo)
examples/helloworld/server/grpc/main.go."0.1"ina2a/core.go.go run examples/helloworld/server/grpc/main.go(listens on port 9001).2. Prepare the Gemini CLI
.gemini/agents/grpc-test-agent.mdwith URL:http://localhost:9001/.well-known/agent-card.json."enableAgents": truein theexperimentalblock of.gemini/settings.json.3. Verify
npm run start -w @google/gemini-cli-a2a-server