refactor: enhance write_todos tool and system prompt

- Updated the write_todos tool to include an optional description field for todo items, improving task detail management.
- Enhanced the system prompt with clearer guidelines on using the write_todos tool, including refined usage patterns and examples for various user scenarios.
- Improved UI components to support the new description feature, ensuring better visibility of task details during planning and execution.
- Streamlined the code for better readability and maintainability, aligning with recent refactoring efforts.
This commit is contained in:
Anish Sarkar 2025-12-26 19:24:32 +05:30
parent ebc04f590e
commit 8a3ab3dfac
5 changed files with 197 additions and 235 deletions

View file

@ -172,10 +172,15 @@ export const Plan: FC<PlanProps> = ({
].filter(Boolean) as Action[];
}, [responseActions]);
// Get default expanded items (in_progress items with descriptions)
const defaultExpandedIds = useMemo(() => {
return todos.filter((t) => t.description && t.status === "in_progress").map((t) => t.id);
}, [todos]);
const TodoList: FC<{ items: PlanTodo[] }> = ({ items }) => {
if (hasDescriptions) {
return (
<Accordion type="single" collapsible className="w-full">
<Accordion type="multiple" defaultValue={defaultExpandedIds} className="w-full">
{items.map((todo) => (
<TodoItem key={todo.id} todo={todo} isStreaming={isStreaming} />
))}