Enable write_todo tool and fix output function schema (#12905)

This commit is contained in:
anj-s
2025-11-12 10:18:15 -08:00
committed by GitHub
parent 540f60696a
commit 7ec78452ec
8 changed files with 48 additions and 13 deletions

View File

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

View File

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

View File

@@ -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: {

View File

@@ -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: {

View File

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

View File

@@ -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 ?? [];

View File

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

View File

@@ -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": {