feat(core): add default execution limits for subagents#18274
feat(core): add default execution limits for subagents#18274abhipatel12 merged 2 commits intomainfrom
Conversation
Summary of ChangesHello @abhipatel12, 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 centralizes and applies default execution limits for subagents, specifically for maximum turns and maximum execution time. This enhancement aims to improve the robustness of subagents by preventing infinite loops and prolonged execution, thereby ensuring more predictable and stable agent behavior across the system. 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 introduces default execution limits for subagents, which is a great step for robustness. The implementation correctly adds default values for max_turns and timeout_mins in the agent loader and documentation. My review focuses on improving the implementation within the local-executor to reduce code duplication and on fixing a type inconsistency in types.ts to make the agent configuration more robust and clear.
|
Size Change: +237 B (0%) Total Size: 23.7 MB ℹ️ View Unchanged
|
Summary
Introduced centralized default execution limits for subagents to prevent infinite loops and hanging processes.
Details
DEFAULT_MAX_TURNS(15) andDEFAULT_MAX_TIME_MINUTES(5) topackages/core/src/agents/types.ts.agentLoader.tsto apply these defaults when parsing agent definitions (e.g., from Markdown files).local-executor.tsto use these constants as fallbacks during runtime and updated error reporting to reflect the actual limits hit.agentLoader.test.tsto verify the new default behavior.docs/core/subagents.mdto document the new default values.Related Issues
Related to improving subagent robustness and observability.
How to Validate
Run the updated tests:
npm test -w @google/gemini-cli-core -- src/agents/agentLoader.test.ts src/agents/local-executor.test.tsPre-Merge Checklist