Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b5db5d3
feat(core): implement task tracker foundation and service (Phase 1)
anj-s Feb 18, 2026
f737126
feat(core,cli): implement task tracker tools and feature flag (Phase 2)
anj-s Feb 18, 2026
448af0a
chore(core): improve ID generation and add runtime task validation
anj-s Feb 18, 2026
2d6ee8f
fix: address code review comments from bot in trackerService.ts
anj-s Feb 18, 2026
9618f8f
Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-pha…
anj-s Feb 18, 2026
6a24077
docs: update implementation plan for Phase 2
anj-s Feb 19, 2026
ae96477
feat(tracker): move tracker storage to project temp directory
anj-s Feb 19, 2026
91e7881
Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-pha…
anj-s Feb 19, 2026
e6b68e7
feat(tracker): integrate dynamic storage path in Config and tools
anj-s Feb 19, 2026
ba73124
feat(tracker): simplify tracker storage path
anj-s Feb 19, 2026
e32d8a2
Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-pha…
anj-s Feb 19, 2026
1e743ea
feat(tracker): update config to use simplified tracker path
anj-s Feb 19, 2026
23194dd
feat(tracker): restore session-specific nested storage path
anj-s Feb 19, 2026
de0ce2c
Merge branch 'u/anj/task-tracker-phase-1' into u/anj/task-tracker-pha…
anj-s Feb 19, 2026
eed1ca6
feat(tracker): restore nested tracker path in Config
anj-s Feb 19, 2026
eb33db5
feat(tracker): simplify tracker storage path and flatten directory st…
anj-s Feb 19, 2026
daf9da2
fix(tracker): lazily initialize tracker directory
anj-s Feb 22, 2026
41cf395
chore(tracker): remove plans configuration directory from git tracking
anj-s Feb 22, 2026
fc298e3
remove .gitignore changes
anj-s Feb 22, 2026
30fe8ff
remove .gitignore changes
anj-s Feb 22, 2026
5d31761
si changes: task tracker prep implementation
anj-s Feb 22, 2026
53755c5
si changes
anj-s Feb 22, 2026
ed8a773
wip temp settings change
anj-s Feb 25, 2026
aa1803f
feat(core): trigger task tracker based on complexity rather than form…
anj-s Feb 25, 2026
f76d73e
lint fix
anj-s Mar 4, 2026
34788a7
prompt changes
anj-s Mar 5, 2026
3d89cc5
remove old tool name
anj-s Mar 5, 2026
f5b6028
wip
anj-s Mar 5, 2026
c1252b4
Merge branch 'main' into u/anj/task-tracker-phase-3
anj-s Mar 5, 2026
776c8aa
wip
anj-s Mar 5, 2026
273deb6
Merge branch 'main' into u/anj/task-tracker-phase-3
anj-s Mar 5, 2026
ed7ecde
revert svg files that should not be modified
anj-s Mar 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/core/src/prompts/promptProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export class PromptProvider {
}),
isPlanMode,
),
taskTracker: config.isTrackerEnabled(),
operationalGuidelines: this.withSection(
'operationalGuidelines',
() => ({
Expand Down
23 changes: 23 additions & 0 deletions packages/core/src/prompts/snippets.legacy.ts
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.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ import {
SHELL_TOOL_NAME,
WRITE_FILE_TOOL_NAME,
WRITE_TODOS_TOOL_NAME,
TRACKER_CREATE_TASK_TOOL_NAME,
TRACKER_LIST_TASKS_TOOL_NAME,
TRACKER_UPDATE_TASK_TOOL_NAME,
} from '../tools/tool-names.js';

// --- Options Structs ---
Expand All @@ -30,6 +33,7 @@ export interface SystemPromptOptions {
hookContext?: boolean;
primaryWorkflows?: PrimaryWorkflowsOptions;
planningWorkflow?: PlanningWorkflowOptions;
taskTracker?: boolean;
operationalGuidelines?: OperationalGuidelinesOptions;
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
Expand Down Expand Up @@ -113,6 +117,8 @@ ${
: renderPrimaryWorkflows(options.primaryWorkflows)
}

${options.taskTracker ? renderTaskTracker() : ''}

${renderOperationalGuidelines(options.operationalGuidelines)}

${renderInteractiveYoloMode(options.interactiveYoloMode)}
Expand Down Expand Up @@ -388,6 +394,23 @@ ${trimmed}
return `\n---\n\n<loaded_context>\n${sections.join('\n')}\n</loaded_context>`;
}

export function renderTaskTracker(): string {
const trackerCreate = `\`${TRACKER_CREATE_TASK_TOOL_NAME}\``;
const trackerList = `\`${TRACKER_LIST_TASKS_TOOL_NAME}\``;
const trackerUpdate = `\`${TRACKER_UPDATE_TASK_TOOL_NAME}\``;

return `
# TASK MANAGEMENT PROTOCOL
You are operating with a persistent file-based task tracking system located at \`.tracker/tasks/\`. You must adhere to the following rules:

1. **NO IN-MEMORY LISTS**: Do not maintain a mental list of tasks or write markdown checkboxes in the chat. Use the provided tools (${trackerCreate}, ${trackerList}, ${trackerUpdate}) for all state management.
2. **ATOMICITY**: If a user request involves multiple steps (e.g., "Refactor the backend") or represents a complex task, you must first break this into discrete entries using ${trackerCreate} before writing any code.
3. **PLAN MODE INTEGRATION**: If you construct or are following a documented plan (e.g., in Plan Mode), use the tracker to represent the granular execution state of that plan. Maintain a bidirectional understanding between the plan document and the task graph.
4. **VERIFICATION**: Before marking a task as complete, verify the work is actually done (e.g., run the test, check the file existence).
5. **STATE OVER CHAT**: If the user says "I think we finished that," but the tool says it is 'pending', trust the tool--or verify explicitly before updating.
6. **DEPENDENCY MANAGEMENT**: Respect task topology. Never attempt to execute a task if its dependencies are not marked as 'closed'. If you are blocked, focus only on the leaf nodes of the task graph.`.trim();
}

export function renderPlanningWorkflow(
options?: PlanningWorkflowOptions,
): string {
Expand Down
24 changes: 24 additions & 0 deletions packages/core/src/prompts/snippets.ts
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.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ import {
READ_FILE_PARAM_END_LINE,
SHELL_PARAM_IS_BACKGROUND,
EDIT_PARAM_OLD_STRING,
TRACKER_CREATE_TASK_TOOL_NAME,
TRACKER_LIST_TASKS_TOOL_NAME,
TRACKER_UPDATE_TASK_TOOL_NAME,
} from '../tools/tool-names.js';
import type { HierarchicalMemory } from '../config/memory.js';
import { DEFAULT_CONTEXT_FILENAME } from '../tools/memoryTool.js';
Expand All @@ -41,6 +44,7 @@ export interface SystemPromptOptions {
hookContext?: boolean;
primaryWorkflows?: PrimaryWorkflowsOptions;
planningWorkflow?: PlanningWorkflowOptions;
taskTracker?: boolean;
operationalGuidelines?: OperationalGuidelinesOptions;
sandbox?: SandboxMode;
interactiveYoloMode?: boolean;
Expand Down Expand Up @@ -120,6 +124,8 @@ ${
: renderPrimaryWorkflows(options.primaryWorkflows)
}

${options.taskTracker ? renderTaskTracker() : ''}

${renderOperationalGuidelines(options.operationalGuidelines)}

${renderInteractiveYoloMode(options.interactiveYoloMode)}
Expand Down Expand Up @@ -464,6 +470,24 @@ ${trimmed}
return `\n---\n\n<loaded_context>\n${sections.join('\n')}\n</loaded_context>`;
}

export function renderTaskTracker(): string {
const trackerCreate = formatToolName(TRACKER_CREATE_TASK_TOOL_NAME);
const trackerList = formatToolName(TRACKER_LIST_TASKS_TOOL_NAME);
const trackerUpdate = formatToolName(TRACKER_UPDATE_TASK_TOOL_NAME);

return `
# TASK MANAGEMENT PROTOCOL
You are operating with a persistent file-based task tracking system located at \`.tracker/tasks/\`. You must adhere to the following rules:

1. **NO IN-MEMORY LISTS**: Do not maintain a mental list of tasks or write markdown checkboxes in the chat. Use the provided tools (${trackerCreate}, ${trackerList}, ${trackerUpdate}) for all state management.
2. **IMMEDIATE DECOMPOSITION**: Upon receiving a task, evaluate its functional complexity and scope. If the request involves more than a single atomic modification, or necessitates research before execution, you MUST immediately decompose it into discrete entries using ${trackerCreate}.
3. **IGNORE FORMATTING BIAS**: Trigger the protocol based on the **objective complexity** of the goal, regardless of whether the user provided a structured list or a single block of text/paragraph. "Paragraph-style" goals that imply multiple actions are multi-step projects and MUST be tracked.
4. **PLAN MODE INTEGRATION**: If you construct or are following a documented plan (e.g., in Plan Mode), use the tracker to represent the granular execution state of that plan. Maintain a bidirectional understanding between the plan document and the task graph.
5. **VERIFICATION**: Before marking a task as complete, verify the work is actually done (e.g., run the test, check the file existence).
6. **STATE OVER CHAT**: If the user says "I think we finished that," but the tool says it is 'pending', trust the tool--or verify explicitly before updating.
7. **DEPENDENCY MANAGEMENT**: Respect task topology. Never attempt to execute a task if its dependencies are not marked as 'closed'. If you are blocked, focus only on the leaf nodes of the task graph.`.trim();
}

export function renderPlanningWorkflow(
options?: PlanningWorkflowOptions,
): string {
Expand Down
21 changes: 14 additions & 7 deletions packages/core/src/tools/tool-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@ export const LS_TOOL_NAME_LEGACY = 'list_directory'; // Just to be safe if anyth

export const EDIT_TOOL_NAMES = new Set([EDIT_TOOL_NAME, WRITE_FILE_TOOL_NAME]);

export const TRACKER_CREATE_TASK_TOOL_NAME = 'tracker_create_task';
export const TRACKER_UPDATE_TASK_TOOL_NAME = 'tracker_update_task';
export const TRACKER_GET_TASK_TOOL_NAME = 'tracker_get_task';
export const TRACKER_LIST_TASKS_TOOL_NAME = 'tracker_list_tasks';
export const TRACKER_ADD_DEPENDENCY_TOOL_NAME = 'tracker_add_dependency';
export const TRACKER_VISUALIZE_TOOL_NAME = 'tracker_visualize';

// Tool Display Names
export const WRITE_FILE_DISPLAY_NAME = 'WriteFile';
export const EDIT_DISPLAY_NAME = 'Edit';
export const ASK_USER_DISPLAY_NAME = 'Ask User';
export const READ_FILE_DISPLAY_NAME = 'ReadFile';
export const GLOB_DISPLAY_NAME = 'FindFiles';
export const TRACKER_INIT_TOOL_NAME = 'tracker_init';
export const TRACKER_CREATE_TASK_TOOL_NAME = 'tracker_create_task';
export const TRACKER_UPDATE_TASK_TOOL_NAME = 'tracker_update_task';
export const TRACKER_GET_TASK_TOOL_NAME = 'tracker_get_task';
export const TRACKER_LIST_TASKS_TOOL_NAME = 'tracker_list_tasks';
export const TRACKER_ADD_DEPENDENCY_TOOL_NAME = 'tracker_add_dependency';
export const TRACKER_VISUALIZE_TOOL_NAME = 'tracker_visualize';

/**
* Mapping of legacy tool names to their current names.
Expand Down Expand Up @@ -229,6 +229,13 @@ export const ALL_BUILTIN_TOOL_NAMES = [
GET_INTERNAL_DOCS_TOOL_NAME,
ENTER_PLAN_MODE_TOOL_NAME,
EXIT_PLAN_MODE_TOOL_NAME,
TRACKER_INIT_TOOL_NAME,
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,
Comment on lines +231 to +236
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.

] as const;

/**
Expand Down
Loading