mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-12 07:01:09 -07:00
Enable write_todo tool and fix output function schema (#12905)
This commit is contained in:
@@ -480,8 +480,8 @@ their corresponding top-level category object in your `settings.json` file.
|
|||||||
#### `useWriteTodos`
|
#### `useWriteTodos`
|
||||||
|
|
||||||
- **`useWriteTodos`** (boolean):
|
- **`useWriteTodos`** (boolean):
|
||||||
- **Description:** Enable the write_todos_list tool.
|
- **Description:** Enable the write_todos tool.
|
||||||
- **Default:** `false`
|
- **Default:** `true`
|
||||||
|
|
||||||
#### `security`
|
#### `security`
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
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
|
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
|
### Arguments
|
||||||
|
|
||||||
@@ -49,8 +50,8 @@ write_todos({
|
|||||||
|
|
||||||
## Important notes
|
## Important notes
|
||||||
|
|
||||||
- **Enabling:** This tool is disabled by default. To use it, you must enable it
|
- **Enabling:** This tool is enabled by default. You can disable it in your
|
||||||
in your `settings.json` file by setting `"useWriteTodos": true`.
|
`settings.json` file by setting `"useWriteTodos": false`.
|
||||||
|
|
||||||
- **Intended Use:** This tool is primarily used by the agent for complex,
|
- **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.
|
multi-turn tasks. It is generally not used for simple, single-turn questions.
|
||||||
|
|||||||
@@ -1080,8 +1080,8 @@ const SETTINGS_SCHEMA = {
|
|||||||
label: 'Use WriteTodos',
|
label: 'Use WriteTodos',
|
||||||
category: 'Advanced',
|
category: 'Advanced',
|
||||||
requiresRestart: false,
|
requiresRestart: false,
|
||||||
default: false,
|
default: true,
|
||||||
description: 'Enable the write_todos_list tool.',
|
description: 'Enable the write_todos tool.',
|
||||||
showInDialog: false,
|
showInDialog: false,
|
||||||
},
|
},
|
||||||
security: {
|
security: {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ const createTodoHistoryItem = (todos: Todo[]): HistoryItem =>
|
|||||||
id: '1',
|
id: '1',
|
||||||
tools: [
|
tools: [
|
||||||
{
|
{
|
||||||
name: 'write_todos_list',
|
name: 'write_todos',
|
||||||
callId: 'tool-1',
|
callId: 'tool-1',
|
||||||
status: ToolCallStatus.Success,
|
status: ToolCallStatus.Success,
|
||||||
resultDisplay: {
|
resultDisplay: {
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ export const INFORMATIVE_TIPS = [
|
|||||||
'Set the number of lines to keep when truncating outputs (/settings)...',
|
'Set the number of lines to keep when truncating outputs (/settings)...',
|
||||||
'Enable policy-based tool confirmation via message bus (/settings)...',
|
'Enable policy-based tool confirmation via message bus (/settings)...',
|
||||||
'Enable smart-edit tool for more precise editing (/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 model routing based on complexity (/settings)...',
|
||||||
'Enable experimental subagents for task delegation (/settings)...',
|
'Enable experimental subagents for task delegation (/settings)...',
|
||||||
//Settings tips end here
|
//Settings tips end here
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ export class Config {
|
|||||||
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
params.truncateToolOutputLines ?? DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES;
|
||||||
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
this.enableToolOutputTruncation = params.enableToolOutputTruncation ?? true;
|
||||||
this.useSmartEdit = params.useSmartEdit ?? true;
|
this.useSmartEdit = params.useSmartEdit ?? true;
|
||||||
this.useWriteTodos = params.useWriteTodos ?? false;
|
this.useWriteTodos = params.useWriteTodos ?? true;
|
||||||
this.initialUseModelRouter = params.useModelRouter ?? false;
|
this.initialUseModelRouter = params.useModelRouter ?? false;
|
||||||
this.useModelRouter = this.initialUseModelRouter;
|
this.useModelRouter = this.initialUseModelRouter;
|
||||||
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
this.disableModelRouterForAuth = params.disableModelRouterForAuth ?? [];
|
||||||
|
|||||||
@@ -173,14 +173,48 @@ export class WriteTodosTool extends BaseDeclarativeTool<
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ['description', 'status'],
|
required: ['description', 'status'],
|
||||||
|
additionalProperties: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
required: ['todos'],
|
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(
|
protected override validateToolParamValues(
|
||||||
params: WriteTodosToolParams,
|
params: WriteTodosToolParams,
|
||||||
): string | null {
|
): string | null {
|
||||||
|
|||||||
@@ -990,9 +990,9 @@
|
|||||||
},
|
},
|
||||||
"useWriteTodos": {
|
"useWriteTodos": {
|
||||||
"title": "Use WriteTodos",
|
"title": "Use WriteTodos",
|
||||||
"description": "Enable the write_todos_list tool.",
|
"description": "Enable the write_todos tool.",
|
||||||
"markdownDescription": "Enable the write_todos_list tool.\n\n- Category: `Advanced`\n- Requires restart: `no`\n- Default: `false`",
|
"markdownDescription": "Enable the write_todos tool.\n\n- Category: `Advanced`\n- Requires restart: `no`\n- Default: `true`",
|
||||||
"default": false,
|
"default": true,
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
"security": {
|
"security": {
|
||||||
|
|||||||
Reference in New Issue
Block a user