feat(core): transition sub-agents to XML format and improve definitions#18555
feat(core): transition sub-agents to XML format and improve definitions#18555NTaylorMullen merged 2 commits intomainfrom
Conversation
Summary of ChangesHello @NTaylorMullen, 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 how sub-agent information is presented within the system prompts, particularly for Gemini 3 models. By moving to a structured XML format and centralizing the rendering logic, the system achieves greater consistency with existing prompt patterns and improves the overall maintainability of prompt generation. This change also cleans up deprecated code related to sub-agent context retrieval. 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 is a well-executed refactoring that transitions the sub-agent listing in system prompts to a structured XML format for Gemini 3 models, while maintaining a markdown format for legacy models. The changes successfully centralize the rendering logic for sub-agents into the prompts/ directory, removing it from AgentRegistry and simplifying the ${SubAgents} substitution process. This improves code clarity and maintainability. The test suite has been updated comprehensively to reflect these changes, including new tests for the XML format and adjustments to existing mocks and snapshots. The overall implementation is clean and aligns with the stated goals. I have not found any issues of high or critical severity.
|
Size Change: +1.08 kB (0%) Total Size: 23.9 MB
ℹ️ View Unchanged
|
6819106 to
24296b2
Compare
- Transition sub-agent listing to XML format for Gemini 3 models - Centralize sub-agent rendering in snippet files - Remove obsolete getDirectoryContext from AgentRegistry - Unify sub-agent instructions across system prompt and template substitutions Fixes #18550
- Update prompts snapshot to reflect corrected interpolation Fixes #18550
24296b2 to
497bbc6
Compare
Summary
This PR transitions the sub-agent listing in the system prompt to a structured XML format for Gemini 3 models and centralizes sub-agent rendering within the core snippet files. It also removes obsolete methods from the
AgentRegistryto simplify sub-agent management and ensures consistent instructions across the system prompt and template substitutions.Details
<available_subagents>and<subagent>tags for Gemini 3 models to improve model parsing and tool selection reliability.AgentRegistrytosnippets.tsandsnippets.legacy.ts, allowing for better model-specific tailoring.getDirectoryContextfromAgentRegistryas its logic is now handled by the prompt providers.prompts.test.tsto reflect the new XML structure and formatting changes (indentation and spacing).Related Issues
Fixes #18550
How to Validate
Run the core prompt tests and verify snapshots:
npm test -w @google/gemini-cli-core -- src/core/prompts.test.tsRun a full preflight check to ensure no regressions:
Pre-Merge Checklist