feat (core): Implement tracker related SI changes#19964
Conversation
- Use cryptographically secure ID generation with node:crypto - Implement runtime validation for JSON parsing using Zod - Optimize circular dependency validation to avoid N+1 file reads
|
Hi @anj-s, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
|
Hi there! Thank you for your contribution to Gemini CLI. To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md. This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding How to link an issue: Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello @anj-s, 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 completes Phase 3 of the Task Tracker feature by enhancing the core prompt generation logic to incorporate task management protocols. It ensures that the AI agent is aware of and adheres to a structured task tracking system, promoting more robust and consistent task execution. The changes primarily involve updating prompt providers and snippets to dynamically include task tracker guidelines and tool references, alongside minor service refinements. 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.19 kB (+0.01%) Total Size: 26 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
we're not updating legacy prompts: https://github.com/google-gemini/gemini-cli/blob/a5fd5d0b9fcafcc2eb1cc92e8e6405716dbb103f/GEMINI.md#development-conventions
Legacy Snippets: packages/core/src/prompts/snippets.legacy.ts is a snapshot of an older system prompt. Avoid changing the prompting verbiage to preserve its historical behavior; however, structural changes to ensure compilation or simplify the code are permitted.
There was a problem hiding this comment.
There was a problem hiding this comment.
Code Review
This pull request introduces support for a task tracker by updating the system prompt to include a TASK MANAGEMENT PROTOCOL when the feature is enabled. The changes span prompt providers, snippets, and associated tests. I've found a critical logic error in packages/core/src/prompts/snippets.ts where new logic is unreachable, and a high-severity issue in packages/core/src/tools/tool-names.ts with duplicated tool name constants. I've provided suggestions to fix both issues. The suggested fix for the unreachable code also incorporates a guideline for instructing agents on plan deviations.
| if (options.approvedPlan) { | ||
| return `2. **Strategy:** An approved plan is available for this task. Treat this file as your single source of truth. You MUST read this file before proceeding. If you discover new requirements or need to change the approach, confirm with the user and update this plan file to reflect the updated design decisions or discovered requirements. Once all implementation and verification steps are finished, provide a **final summary** of the work completed against the plan and offer clear **next steps** to the user (e.g., 'Open a pull request').`; | ||
| } | ||
| if (options.approvedPlan && options.taskTracker) { | ||
| return `2. **Strategy:** An approved plan is available for this task. Treat this file as your single source of truth and invoke the task tracker tool to create tasks for this plan. You MUST read this file before proceeding. If you discover new requirements or need to change the approach, confirm with the user and update this plan file to reflect the updated design decisions or discovered requirements. Make sure to update the tracker task list based on this updated plan. Once all implementation and verification steps are finished, provide a **final summary** of the work completed against the plan and offer clear **next steps** to the user (e.g., 'Open a pull request').`; | ||
| } |
There was a problem hiding this comment.
The new if (options.approvedPlan && options.taskTracker) block is unreachable because the preceding if (options.approvedPlan) block will always execute first and return, preventing the new logic from ever being evaluated. To fix this, the logic should be nested or reordered to check for the more specific condition first. Additionally, the suggested instruction for deviations from the approved plan explicitly tells the agent to confirm changes with the user, which aligns with repository guidelines.
| if (options.approvedPlan) { | |
| return `2. **Strategy:** An approved plan is available for this task. Treat this file as your single source of truth. You MUST read this file before proceeding. If you discover new requirements or need to change the approach, confirm with the user and update this plan file to reflect the updated design decisions or discovered requirements. Once all implementation and verification steps are finished, provide a **final summary** of the work completed against the plan and offer clear **next steps** to the user (e.g., 'Open a pull request').`; | |
| } | |
| if (options.approvedPlan && options.taskTracker) { | |
| return `2. **Strategy:** An approved plan is available for this task. Treat this file as your single source of truth and invoke the task tracker tool to create tasks for this plan. You MUST read this file before proceeding. If you discover new requirements or need to change the approach, confirm with the user and update this plan file to reflect the updated design decisions or discovered requirements. Make sure to update the tracker task list based on this updated plan. Once all implementation and verification steps are finished, provide a **final summary** of the work completed against the plan and offer clear **next steps** to the user (e.g., 'Open a pull request').`; | |
| } | |
| if (options.approvedPlan) { | |
| if (options.taskTracker) { | |
| return `2. **Strategy:** An approved plan is available for this task. Treat this file as your single source of truth and invoke the task tracker tool to create tasks for this plan. You MUST read this file before proceeding. If you discover new requirements or need to change the approach, confirm with the user and update this plan file to reflect the updated design decisions or discovered requirements. Make sure to update the tracker task list based on this updated plan. Once all implementation and verification steps are finished, provide a **final summary** of the work completed against the plan and offer clear **next steps** to the user (e.g., 'Open a pull request').`; | |
| } | |
| return `2. **Strategy:** An approved plan is available for this task. Treat this file as your single source of truth. You MUST read this file before proceeding. If you discover new requirements or need to change the approach, confirm with the user and update this plan file to reflect the updated design decisions or discovered requirements. Once all implementation and verification steps are finished, provide a **final summary** of the work completed against the plan and offer clear **next steps** to the user (e.g., 'Open a pull request').`; | |
| } |
References
- When instructing an agent to follow an approved plan, if deviations are necessary, prefer explicitly telling the agent to confirm changes with the user rather than providing a general reminder to adhere to safety guidelines.
| TRACKER_CREATE_TASK_TOOL_NAME, | ||
| TRACKER_UPDATE_TASK_TOOL_NAME, | ||
| TRACKER_GET_TASK_TOOL_NAME, | ||
| TRACKER_LIST_TASKS_TOOL_NAME, | ||
| TRACKER_ADD_DEPENDENCY_TOOL_NAME, | ||
| TRACKER_VISUALIZE_TOOL_NAME, |
This PR implements Phase 3 of the Task Tracker feature, focusing on:
Closes #19943