Skip to content

Conversation

@yamadashy
Copy link

@yamadashy yamadashy commented Dec 8, 2025

Summary

Add .yml extension to the watched file extensions in AgentChangeEventHandler.on_modified() alongside .py and .yaml files.

This allows the --reload_agents flag to properly detect changes in .yml configuration files.

Fixes #3834

Scope

This PR only adds .yml to the file watcher for hot reload. It does not add support for root_agent.yml as an agent definition file (that would require changes to AgentLoader and could be addressed in a separate PR if needed).

Testing Plan

  • Manual testing: Run adk web --reload_agents, modify a .yml file in the agent directory, and verify the reload is triggered

Note: This PR is marked as draft because the approach hasn't been confirmed in the issue yet. Please let me know if this direction works for you.

@google-cla
Copy link

google-cla bot commented Dec 8, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yamadashy, 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 enhances the agent file watcher to recognize .yml file extensions, alongside existing .py and .yaml extensions. This ensures that any changes made to .yml configuration files will properly trigger a hot reload when the --reload_agents flag is active, addressing a previous limitation where these files were not being monitored for modifications.

Highlights

  • New File Extension Support: Added .yml to the list of file extensions watched by the AgentChangeEventHandler.
  • Hot Reload Functionality: This change enables the --reload_agents flag to correctly detect and respond to modifications in .yml configuration files.
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.

@adk-bot adk-bot added the tools [Component] This issue is related to tools label Dec 8, 2025
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 adds support for the .yml file extension to the agent file watcher for hot reloading. While the change is a good first step, I've suggested a small refactoring for better readability. More critically, the agent loading logic in AgentLoader doesn't seem to support .yml files, which will likely cause reloads to fail. This needs to be addressed to make the feature work as intended. Please see my detailed comments for specifics.


def on_modified(self, event):
if not (event.src_path.endswith(".py") or event.src_path.endswith(".yaml")):
if not (event.src_path.endswith(".py") or event.src_path.endswith(".yaml") or event.src_path.endswith(".yml")):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

While this change correctly adds .yml to the file watcher for hot reloading, the underlying AgentLoader in src/google/adk/cli/utils/agent_loader.py does not appear to support loading agents from .yml files. Functions like _load_from_yaml_config and _determine_agent_language specifically look for root_agent.yaml. This discrepancy will likely cause reloads triggered by .yml file changes to fail. To fully implement this feature, the agent loading logic should also be updated to recognize and load .yml configuration files.


def on_modified(self, event):
if not (event.src_path.endswith(".py") or event.src_path.endswith(".yaml")):
if not (event.src_path.endswith(".py") or event.src_path.endswith(".yaml") or event.src_path.endswith(".yml")):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The chain of or conditions can be made more concise and maintainable. The endswith() string method can accept a tuple of suffixes to check against, which is a more Pythonic way to handle this.

Suggested change
if not (event.src_path.endswith(".py") or event.src_path.endswith(".yaml") or event.src_path.endswith(".yml")):
if not event.src_path.endswith(('.py', '.yaml', '.yml')):

Add .yml extension to the watched file extensions in AgentChangeEventHandler.on_modified() alongside .py and .yaml files.

Fixes google#3834
@yamadashy yamadashy force-pushed the feat/add-yml-extension-support branch from 2098634 to 493e59c Compare December 8, 2025 09:09
@adk-bot
Copy link
Collaborator

adk-bot commented Dec 8, 2025

Response from ADK Triaging Agent

Hello @yamadashy, thank you for your contribution!

To help reviewers evaluate your changes, could you please add a testing plan section to your pull request description? This section should detail how you've tested the changes to ensure the agent file watcher correctly reloads on .yml file modifications.

Additionally, it appears the CLA (Contributor License Agreement) check has failed. Please ensure you have signed the CLA, as we cannot merge this pull request until that is complete.

Thank you!

@yamadashy yamadashy force-pushed the feat/add-yml-extension-support branch from 667dd80 to 493e59c Compare December 8, 2025 09:33
@ryanaiagent ryanaiagent self-assigned this Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add .yml file extension support for --reload_agents file watcher

3 participants