-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Is your feature request related to a problem? Please describe.
Currently, when developing agents with ADK, developers need to manually restart the agent process every time they make changes to Python or YAML files. This creates a poor development experience, especially when iterating on agent logic, tools, or configuration.
Developers have to:
- Stop the running agent
- Make code changes
- Restart the agent
- Resume testing
This workflow is slow and disrupts the development flow, similar to how web developers had to manually restart servers before tools like nodemon existed.
Describe the solution you'd like
Add a --dev flag to the adk run command that enables development mode with automatic agent reloading. When enabled, the system should:
- Monitor the agent directory for changes to
.pyand.yamlfiles - Automatically reload the agent when files are modified or created
- Provide visual feedback when auto-reload is active
- Continue the existing session context after reload
Usage
adk run --dev path/to/my_agentExpected behavior
- Start agent with "Auto-reload enabled - watching for file changes..." message
- Monitor agent directory recursively for
.pyand.yamlfile changes - Automatically reload agent when changes detected
- Preserve session state where possible
- Continue accepting user input seamlessly
Implementation Details
The implementation uses Python's watchdog library (already a dependency) to monitor file system events:
DevModeChangeHandlerclass extendsFileSystemEventHandler- Monitors
on_modifiedandon_createdevents for.pyand.yamlfiles - Uses
threadingevents to signal when reload is needed - Integrates with existing CLI infrastructure
Describe alternatives you've considered
- Manual reload command: Add a separate
adk reloadcommand - less seamless than auto-reload. - Polling-based approach: File system polling instead of events - less efficient.
- IDE integration: Rely on IDE hot-reload features - not all developers use compatible IDEs.
- External tools: Recommend using external file watchers - increases complexity.
Additional context
This feature would significantly improve the agent development workflow by:
- Reducing development friction
- Enabling faster iteration cycles
- Providing immediate feedback on code changes
- Making ADK more developer-friendly, similar to modern web frameworks
The implementation leverages the existing watchdog dependency and integrates cleanly with the current CLI architecture. It follows the same pattern as successful developer tools like nodemon, webpack-dev-server, and similar auto-reload utilities in other ecosystems.
Prerequisites/Requirements
- Python
watchdoglibrary (already included in ADK dependencies) - File system permissions to monitor directories
- Compatible with existing session management and agent loading infrastructure