-
Notifications
You must be signed in to change notification settings - Fork 0
feat(tui): fire-and-forget async subagent tasks #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @IgorWarzocha, 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 significantly enhances the agent's capability by introducing asynchronous execution for subagent tasks. This allows the main agent to continue its work while subtasks run in the background, improving efficiency and responsiveness. The user interface has been updated to provide clear visibility into the status and outcomes of these background tasks, ensuring a seamless user experience. Additionally, the system now intelligently manages session creation and deletion in the context of these new asynchronous workflows. Highlights
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.
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 introduces a significant new feature: asynchronous, fire-and-forget subagent tasks. The changes are comprehensive, spanning backend logic for task management, TUI components for displaying task status and results, and configuration options.
My review focuses on the implementation of the async flow and the new UI components. The core logic for async tasks, including concurrency limiting and completion notifications, is well-implemented. The UI additions, such as the background task list in the sidebar and toast notifications, provide good visibility into running tasks.
I've identified a few areas for improvement, primarily related to code duplication and type safety. There's an opportunity to refactor duplicated handleClick logic into a reusable hook. I also found some confusing error handling logic in the async task implementation that could be simplified. Finally, strengthening some types would improve maintainability.
Overall, this is a solid implementation of a complex feature. Addressing the suggested refactorings will enhance the code's robustness and clarity.
|
/gemini review the current state of the pr and suggest improvements to the code against the standards of the rest of the repo (if any). |
|
/gemini summary suggest a more comprehensive pr description, up do date with the current state |
There was a problem hiding this 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 introduces a significant and well-implemented feature for running subagent tasks asynchronously. The changes span across tool definitions, session management, TUI components, and configuration, all of which appear robust and thoughtfully designed. The core logic for fire-and-forget tasks, including progress updates and completion notifications, is solid. The TUI enhancements, such as the new background tasks section in the sidebar and completion toasts, will greatly improve user experience. The prompt engineering updates are also excellent, providing clear instructions to the LLM on how to use the new async capabilities. I have one suggestion to improve type safety.
There was a problem hiding this 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 introduces a significant new feature for running subagent tasks asynchronously. The implementation is comprehensive, covering core logic, UI updates for task tracking, configuration options, and permission handling. My review includes a few suggestions to improve code efficiency, type safety, and maintainability in the new logic.
d5c5da6 to
5d278d8
Compare
Summary of Changes
This pull request significantly enhances the agent's capability by introducing asynchronous execution for subagent tasks. This allows the main agent to continue its work while subtasks run in the background, improving efficiency and responsiveness. The user interface has been updated to provide clear visibility into the status and outcomes of these background tasks, ensuring a seamless user experience. Additionally, the system now intelligently manages session creation and deletion in the context of these new asynchronous workflows, and provides new configuration options for fine-grained control.
Highlights
async_task_limit,async_task_permissions) have been added to control the maximum number of concurrent asynchronous background tasks and their specific permissions.Changelog
message.part.updatedevent handling for improved clarity.Identifierimport.SubtaskReminderMessagecomponent to display subtask summaries within user messages.isSubtaskReminder,readTaskSummary,useSubagentNavigation, etc.).UserMessageandAssistantMessagecomponents to correctly render and handle subtask parts.SubtaskPartCompcomponent for displaying individual subtask statuses.PART_MAPPINGto includesubtaskparts.InlineToolto accept and handleSubtaskParttypes.task_asyncpermission rule.async_task_limitandasync_task_permissionsto the experimental configuration.runningChildrenfunction to retrieve currently busy or retrying child sessions.SubtaskParttype withsubagentSessionID,status,error, andsummaryfields.buildSubtaskSystemTextto generate system messages for subtask completions/errors.toModelMessageto insert system messages for subtask status updates.SessionPrompt.promptto only process pending subtasks.taskToolAgentsSysteminto the system prompt to inform the agent about async subagent sessions.taskToolAgentsSystemand related helper functions for managing async task information in the system prompt.TaskMetadatatype for session metadata.TaskToolinput schema to includeasyncandnameparameters.task_asyncand enforcedasync_task_limitfor concurrent tasks.asyncPermissions.async: falseis explicitly set for synchronous tasks in metadata.PartandSubtaskPartInputtype definitions to include new fields for subagent session ID, status, error, and summary.async_task_limittoConfig.experimentaltype.