Skip to content

feat (core): Implement tracker related SI changes#19964

Merged
anj-s merged 32 commits intomainfrom
u/anj/task-tracker-phase-3
Mar 6, 2026
Merged

feat (core): Implement tracker related SI changes#19964
anj-s merged 32 commits intomainfrom
u/anj/task-tracker-phase-3

Conversation

@anj-s
Copy link
Copy Markdown
Contributor

@anj-s anj-s commented Feb 22, 2026

This PR implements Phase 3 of the Task Tracker feature, focusing on:

  • Tracker service refinements
  • Prompt provider updates for tracker integration
  • System prompt snippet updates

Closes #19943

anj-s added 22 commits February 18, 2026 12:03
- 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
@anj-s anj-s requested a review from a team as a code owner February 22, 2026 20:56
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli bot commented Feb 22, 2026

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!

@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 22, 2026
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli bot commented Feb 22, 2026

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 Fixes #123 or Related to #123), it will be automatically reopened.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details on supported keywords and how linking works, please refer to the GitHub Documentation on linking pull requests to issues.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli bot closed this Feb 22, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Task Tracker Integration: Integrated the task tracker enablement status into the prompt provider, allowing the system to dynamically include task management protocols based on configuration.
  • System Prompt Updates: Updated system prompt snippets (snippets.ts and snippets.legacy.ts) to include new task tracker tool names and a comprehensive 'TASK MANAGEMENT PROTOCOL' section, which is conditionally rendered when the task tracker is enabled.
  • Tracker Service Refinement: Cleaned up the TrackerService by removing a debug console.log statement, improving code hygiene.
Changelog
  • packages/core/src/prompts/promptProvider.ts
    • Updated the PromptProvider to pass the taskTracker enablement status to the system prompt options.
  • packages/core/src/prompts/snippets.legacy.ts
    • Imported new task tracker tool names (TRACKER_CREATE_TASK_TOOL_NAME, TRACKER_LIST_TASKS_TOOL_NAME, TRACKER_UPDATE_TASK_TOOL_NAME).
    • Added taskTracker property to the SystemPromptOptions interface.
    • Implemented conditional rendering for the renderTaskTracker function within the system prompt.
    • Defined the renderTaskTracker function, which generates the 'TASK MANAGEMENT PROTOCOL' text, outlining rules for task creation, atomicity, plan integration, verification, state management, and dependency handling.
  • packages/core/src/prompts/snippets.ts
    • Imported new task tracker tool names (TRACKER_CREATE_TASK_TOOL_NAME, TRACKER_LIST_TASKS_TOOL_NAME, TRACKER_UPDATE_TASK_TOOL_NAME).
    • Added taskTracker property to the SystemPromptOptions interface.
    • Implemented conditional rendering for the renderTaskTracker function within the system prompt.
    • Defined the renderTaskTracker function, which generates the 'TASK MANAGEMENT PROTOCOL' text, outlining rules for task creation, atomicity, plan integration, verification, state management, and dependency handling.
  • packages/core/src/services/trackerService.ts
    • Removed a debug console.log statement from the constructor.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@anj-s anj-s reopened this Feb 22, 2026
@anj-s anj-s marked this pull request as draft February 22, 2026 20:57
Base automatically changed from u/anj/task-tracker-phase-2 to main March 4, 2026 01:00
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 4, 2026

Size Change: +3.19 kB (+0.01%)

Total Size: 26 MB

Filename Size Change
./bundle/gemini.js 25.5 MB +3.19 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B
./bundle/sandbox-macos-permissive-open.sb 890 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB
./bundle/sandbox-macos-strict-open.sb 4.82 kB
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB

compressed-size-action

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anj-s anj-s marked this pull request as ready for review March 6, 2026 00:17
@anj-s anj-s added this pull request to the merge queue Mar 6, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 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.

Comment on lines 609 to +614
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').`;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
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
  1. 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.

Comment on lines +231 to +236
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,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The tracker-related tool names are duplicated in the ALL_BUILTIN_TOOL_NAMES array. They are already present on lines 222-227 and are being added again here. This duplication should be removed.

Merged via the queue into main with commit a8f5073 Mar 6, 2026
46 of 47 checks passed
@anj-s anj-s deleted the u/anj/task-tracker-phase-3 branch March 6, 2026 00:29
struckoff pushed a commit to struckoff/gemini-cli that referenced this pull request Mar 6, 2026
kunal-10-cloud pushed a commit to kunal-10-cloud/gemini-cli that referenced this pull request Mar 12, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
yashodipmore pushed a commit to yashodipmore/geemi-cli that referenced this pull request Mar 21, 2026
SUNDRAM07 pushed a commit to SUNDRAM07/gemini-cli that referenced this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update SI to enable the tracker for certain tasks

3 participants