feat(core): pause agent timeout budget while waiting for tool confirmation#18415
feat(core): pause agent timeout budget while waiting for tool confirmation#18415abhipatel12 merged 1 commit intomainfrom
Conversation
…ation This change ensures that subagent timeouts only account for active processing time by pausing the timeout budget when the agent is waiting for user confirmation of a tool call. - Introduced `DeadlineTimer` utility to manage pauseable/resumable timeouts. - Added `onWaitingForConfirmation` hook to `Scheduler` to track idle states. - Integrated `DeadlineTimer` into `LocalAgentExecutor` to accurately track agent time.
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 refines how agent execution timeouts are managed by introducing a pauseable timer. This ensures that the time an agent spends waiting for human interaction, such as tool confirmation, does not count against its allocated timeout budget, leading to more robust and user-friendly agent operations. 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
|
|
Size Change: +3.33 kB (+0.01%) Total Size: 23.8 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature by pausing the agent's timeout budget while it awaits user confirmation for a tool call. The implementation is solid, utilizing a new DeadlineTimer utility with comprehensive unit tests, and thoughtfully integrated into LocalAgentExecutor and Scheduler. A security audit confirmed no high or critical vulnerabilities, noting robust resource management, accurate pause/resume logic, safe integration, and no new injection vectors or LLM safety issues. This enhancement improves the user experience by preventing premature timeouts due to human interaction delays.
Summary
This PR ensures that subagent timeout budgets only account for active processing time by pausing the timeout when the agent is waiting for user confirmation of a tool call.
Details
DeadlineTimerutility inpackages/core/src/utils/deadlineTimer.tsto manage pauseable/resumable timeouts.onWaitingForConfirmationhook toSchedulerto track when it enters and exits an idle state (waiting for user input).DeadlineTimerintoLocalAgentExecutorto accurately track agent execution time, excluding human interaction time.DeadlineTimerand the scheduler's notification logic.Related Issues
N/A
How to Validate
npm test -w @google/gemini-cli-core -- src/utils/deadlineTimer.test.ts src/scheduler/scheduler_waiting_callback.test.tsPre-Merge Checklist