mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-28 05:55:17 -07:00
Apply new style to Todos (#11607)
This commit is contained in:
committed by
GitHub
parent
16f5f767b2
commit
519bd57e55
@@ -14,6 +14,13 @@ import {
|
||||
} from './tools.js';
|
||||
import { WRITE_TODOS_TOOL_NAME } from './tool-names.js';
|
||||
|
||||
const TODO_STATUSES = [
|
||||
'pending',
|
||||
'in_progress',
|
||||
'completed',
|
||||
'cancelled',
|
||||
] as const;
|
||||
|
||||
// Inspired by langchain/deepagents.
|
||||
export const WRITE_TODOS_DESCRIPTION = `This tool can help you list out the current subtasks that are required to be completed for a given user request. The list of subtasks helps you keep track of the current task, organize complex queries and help ensure that you don't miss any steps. With this list, the user can also see the current progress you are making in executing a given task.
|
||||
|
||||
@@ -152,7 +159,7 @@ export class WriteTodosTool extends BaseDeclarativeTool<
|
||||
status: {
|
||||
type: 'string',
|
||||
description: 'The current status of the task.',
|
||||
enum: ['pending', 'in_progress', 'completed'],
|
||||
enum: TODO_STATUSES,
|
||||
},
|
||||
},
|
||||
required: ['description', 'status'],
|
||||
@@ -179,8 +186,8 @@ export class WriteTodosTool extends BaseDeclarativeTool<
|
||||
if (typeof todo.description !== 'string' || !todo.description.trim()) {
|
||||
return 'Each todo must have a non-empty description string';
|
||||
}
|
||||
if (!['pending', 'in_progress', 'completed'].includes(todo.status)) {
|
||||
return 'Each todo must have a valid status (pending, in_progress, or completed)';
|
||||
if (!TODO_STATUSES.includes(todo.status)) {
|
||||
return `Each todo must have a valid status (${TODO_STATUSES.join(', ')})`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user