feat(coding-agent): added details field to TodoItem for storing implementation specifics

- Added optional `details` field to TodoItem type for storing implementation specifics, file paths, and edge cases.
- Enhanced todo item display to show multi-line details with automatic indentation in interactive and reminder modes.
- Updated eager-todo system prompt to enforce separation of short task content (5-10 words) from detailed implementation information.
- Extended TodoWriteTool to support creating and updating tasks with details field via add_task and update operations.
- Added comprehensive test coverage for details field handling across todo operations (replace, add_task, update).
This commit is contained in:
can1357
2026-03-11 00:56:54 +01:00
parent 6535e9ce7e
commit 1a5bbc3e51
9 changed files with 146 additions and 15 deletions
@@ -34,7 +34,14 @@ export class TodoReminderComponent extends Container {
this.#box.addChild(new Text(header, 0, 0));
this.#box.addChild(new Spacer(1));
const todoList = this.todos.map(t => ` ${theme.checkbox.unchecked} ${t.content}`).join("\n");
const todoList = this.todos
.map(t => {
const line = ` ${theme.checkbox.unchecked} ${t.content}`;
if (!t.details) return line;
const detailLines = t.details.split("\n").map(l => ` ${l}`);
return [line, ...detailLines].join("\n");
})
.join("\n");
this.#box.addChild(new Text(theme.italic(todoList), 0, 0));
}
}
@@ -506,8 +506,12 @@ export class InteractiveMode implements InteractiveModeContext {
switch (todo.status) {
case "completed":
return theme.fg("success", `${prefix}${checkbox.checked} ${chalk.strikethrough(todo.content)}`);
case "in_progress":
return theme.fg("accent", `${prefix}${checkbox.unchecked} ${todo.content}`);
case "in_progress": {
const main = theme.fg("accent", `${prefix}${checkbox.unchecked} ${todo.content}`);
if (!todo.details) return main;
const detailLines = todo.details.split("\n").map(line => theme.fg("dim", `${prefix} ${line}`));
return [main, ...detailLines].join("\n");
}
case "abandoned":
return theme.fg("error", `${prefix}${checkbox.unchecked} ${chalk.strikethrough(todo.content)}`);
default:
+1
View File
@@ -40,6 +40,7 @@ export type TodoItem = {
id: string;
content: string;
status: TodoStatus;
details?: string;
};
export type TodoPhase = {