diff --git a/docs/get-started/configuration.md b/docs/get-started/configuration.md index 3bcc989366..fabf7e036d 100644 --- a/docs/get-started/configuration.md +++ b/docs/get-started/configuration.md @@ -480,8 +480,8 @@ their corresponding top-level category object in your `settings.json` file. #### `useWriteTodos` - **`useWriteTodos`** (boolean): - - **Description:** Enable the write_todos_list tool. - - **Default:** `false` + - **Description:** Enable the write_todos tool. + - **Default:** `true` #### `security` diff --git a/docs/tools/todos.md b/docs/tools/todos.md index b345094412..4c11482089 100644 --- a/docs/tools/todos.md +++ b/docs/tools/todos.md @@ -6,7 +6,8 @@ This document describes the `write_todos` tool for the Gemini CLI. The `write_todos` tool allows the Gemini agent to create and manage a list of subtasks for complex user requests. This provides you, the user, with greater -visibility into the agent's plan and its current progress. +visibility into the agent's plan and its current progress. It also helps with +alignment where the agent is less likely to lose track of its current goal. ### Arguments @@ -49,8 +50,8 @@ write_todos({ ## Important notes -- **Enabling:** This tool is disabled by default. To use it, you must enable it - in your `settings.json` file by setting `"useWriteTodos": true`. +- **Enabling:** This tool is enabled by default. You can disable it in your + `settings.json` file by setting `"useWriteTodos": false`. - **Intended Use:** This tool is primarily used by the agent for complex, multi-turn tasks. It is generally not used for simple, single-turn questions. diff --git a/packages/cli/src/config/settingsSchema.ts b/packages/cli/src/config/settingsSchema.ts index 6aa047d8b5..0a715906de 100644 --- a/packages/cli/src/config/settingsSchema.ts +++ b/packages/cli/src/config/settingsSchema.ts @@ -1080,8 +1080,8 @@ const SETTINGS_SCHEMA = { label: 'Use WriteTodos', category: 'Advanced', requiresRestart: false, - default: false, - description: 'Enable the write_todos_list tool.', + default: true, + description: 'Enable the write_todos tool.', showInDialog: false, }, security: { diff --git a/packages/cli/src/ui/components/messages/Todo.test.tsx b/packages/cli/src/ui/components/messages/Todo.test.tsx index 85ea38750f..6d2906dfcb 100644 --- a/packages/cli/src/ui/components/messages/Todo.test.tsx +++ b/packages/cli/src/ui/components/messages/Todo.test.tsx @@ -20,7 +20,7 @@ const createTodoHistoryItem = (todos: Todo[]): HistoryItem => id: '1', tools: [ { - name: 'write_todos_list', + name: 'write_todos', callId: 'tool-1', status: ToolCallStatus.Success, resultDisplay: { diff --git a/packages/cli/src/ui/hooks/usePhraseCycler.ts b/packages/cli/src/ui/hooks/usePhraseCycler.ts index 33a0cb40e0..c1132859c7 100644 --- a/packages/cli/src/ui/hooks/usePhraseCycler.ts +++ b/packages/cli/src/ui/hooks/usePhraseCycler.ts @@ -200,7 +200,7 @@ export const INFORMATIVE_TIPS = [ 'Set the number of lines to keep when truncating outputs (/settings)...', 'Enable policy-based tool confirmation via message bus (/settings)...', 'Enable smart-edit tool for more precise editing (/settings)...', - 'Enable write_todos_list tool to generate task lists (/settings)...', + 'Enable write_todos tool to generate task lists (/settings)...', 'Enable model routing based on complexity (/settings)...', 'Enable experimental subagents for task delegation (/settings)...', //Settings tips end here diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 96e4a118b9..b72bf2d9ca 100644 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -514,7 +514,7 @@ export class Config { params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES; this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true; this.useSmartEdit = params.useSmartEdit ?? true; - this.useWriteTodos = params.useWriteTodos ?? false; + this.useWriteTodos = params.useWriteTodos ?? true; this.initialUseModelRouter = params.useModelRouter ?? false; this.useModelRouter = this.initialUseModelRouter; this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? []; diff --git a/packages/core/src/tools/write-todos.ts b/packages/core/src/tools/write-todos.ts index deb2dd0578..40e2874bdd 100644 --- a/packages/core/src/tools/write-todos.ts +++ b/packages/core/src/tools/write-todos.ts @@ -173,14 +173,48 @@ export class WriteTodosTool extends BaseDeclarativeTool< }, }, required: ['description', 'status'], + additionalProperties: false, }, }, }, required: ['todos'], + additionalProperties: false, }, ); } + override get schema() { + return { + name: this.name, + description: this.description, + parametersJsonSchema: this.parameterSchema, + responseJsonSchema: { + type: 'object', + properties: { + todos: { + type: 'array', + items: { + type: 'object', + properties: { + description: { + type: 'string', + }, + status: { + type: 'string', + enum: TODO_STATUSES, + }, + }, + required: ['description', 'status'], + additionalProperties: false, + }, + }, + }, + required: ['todos'], + additionalProperties: false, + }, + }; + } + protected override validateToolParamValues( params: WriteTodosToolParams, ): string | null { diff --git a/schemas/settings.schema.json b/schemas/settings.schema.json index 0b1ef39d22..fb60e226a2 100644 --- a/schemas/settings.schema.json +++ b/schemas/settings.schema.json @@ -990,9 +990,9 @@ }, "useWriteTodos": { "title": "Use WriteTodos", - "description": "Enable the write_todos_list tool.", - "markdownDescription": "Enable the write_todos_list tool.\n\n- Category: `Advanced`\n- Requires restart: `no`\n- Default: `false`", - "default": false, + "description": "Enable the write_todos tool.", + "markdownDescription": "Enable the write_todos tool.\n\n- Category: `Advanced`\n- Requires restart: `no`\n- Default: `true`", + "default": true, "type": "boolean" }, "security": {