Skip to content

Commit 174fdb7

Browse files
byapparovclaude
andcommitted
refactor(tool): remove the built-in todo tooling (#182)
Delete todowrite/todoread and everything that only existed for them: the tool, its descriptions, the session Todo store and its drizzle table declaration, the legacy JSON todo migration, the ACP todo-to-plan mapping, the run/github renderers, the subagent denies, and the #164 headless gating together with HeadlessRun, which has no other consumer. TodoWrite mentions are removed from the anthropic base prompt, and two unused prompt files that referenced the todo tool are deleted. Compatibility: - `tools`/`permission` keys naming todowrite/todoread still load (the permission schema's catchall accepts them) and change no offered tool. - The `todo` table and legacy `storage/todo/*.json` files are left in place and ignored; the table stays in the database, as `workspace` did. - `aictrl run --continue` on a session whose history has todowrite tool parts replays that history and runs another turn. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent cd736e2 commit 174fdb7

25 files changed

Lines changed: 188 additions & 1088 deletions

‎README.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ and [JSON event reference](EVENTS.md).
7070

7171
In headless mode, Aictrl automatically rejects all interactive permission requests (like `question` or `plan_enter`), ensuring your pipelines never hang.
7272

73-
`aictrl run` does not offer the `todowrite` tool: its definition adds about 2.4k tokens to
74-
every request, and a one-shot run has nobody following a todo list. To track a plan, instruct
75-
the agent to keep one in a file.
76-
7773
### CI/CD Integration
7874

7975
Set `AICTRL_HEADLESS=true` in your environment to force headless behavior even in pseudo-TTYs.

‎packages/cli/README.md‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ Provider failures and stream timeouts retain **1**; SIGINT/SIGTERM retain
9696

9797
In headless mode, Aictrl automatically rejects permissions that would otherwise prompt a user.
9898

99-
`aictrl run` does not offer the `todowrite` tool: its definition adds about 2.4k tokens to
100-
every request, and a one-shot run has nobody following a todo list. To track a plan, instruct
101-
the agent to keep one in a file.
102-
10399
## Configuration
104100

105101
Aictrl reads config from `.aictrl/` (project) or `~/.config/aictrl/` (global).

‎packages/cli/src/acp/agent.ts‎

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
type LoadSessionRequest,
1616
type NewSessionRequest,
1717
type PermissionOption,
18-
type PlanEntry,
1918
type PromptRequest,
2019
type ResumeSessionRequest,
2120
type ResumeSessionResponse,
@@ -39,8 +38,6 @@ import { Agent as AgentModule } from "../agent/agent"
3938
import { Installation } from "@/installation"
4039
import { MessageV2 } from "@/session/message-v2"
4140
import { Config } from "@/config/config"
42-
import { Todo } from "@/session/todo"
43-
import { z } from "zod"
4441
import { LoadAPIKeyError } from "ai"
4542
import type { AssistantMessage, Event, AictrlClient, SessionMessageResponse, ToolPart } from "@aictrl/sdk/v2"
4643
import { applyPatch } from "diff"
@@ -364,33 +361,6 @@ export namespace ACP {
364361
})
365362
}
366363

367-
if (part.tool === "todowrite") {
368-
const parsedTodos = z.array(Todo.Info).safeParse(JSON.parse(part.state.output))
369-
if (parsedTodos.success) {
370-
await this.connection
371-
.sessionUpdate({
372-
sessionId,
373-
update: {
374-
sessionUpdate: "plan",
375-
entries: parsedTodos.data.map((todo) => {
376-
const status: PlanEntry["status"] =
377-
todo.status === "cancelled" ? "completed" : (todo.status as PlanEntry["status"])
378-
return {
379-
priority: "medium",
380-
status,
381-
content: todo.content,
382-
}
383-
}),
384-
},
385-
})
386-
.catch((error) => {
387-
log.error("failed to send session update for todo", { error })
388-
})
389-
} else {
390-
log.error("failed to parse todo output", { error: parsedTodos.error })
391-
}
392-
}
393-
394364
await this.connection
395365
.sessionUpdate({
396366
sessionId,
@@ -879,33 +849,6 @@ export namespace ACP {
879849
})
880850
}
881851

882-
if (part.tool === "todowrite") {
883-
const parsedTodos = z.array(Todo.Info).safeParse(JSON.parse(part.state.output))
884-
if (parsedTodos.success) {
885-
await this.connection
886-
.sessionUpdate({
887-
sessionId,
888-
update: {
889-
sessionUpdate: "plan",
890-
entries: parsedTodos.data.map((todo) => {
891-
const status: PlanEntry["status"] =
892-
todo.status === "cancelled" ? "completed" : (todo.status as PlanEntry["status"])
893-
return {
894-
priority: "medium",
895-
status,
896-
content: todo.content,
897-
}
898-
}),
899-
},
900-
})
901-
.catch((err) => {
902-
log.error("failed to send session update for todo", { error: err })
903-
})
904-
} else {
905-
log.error("failed to parse todo output", { error: parsedTodos.error })
906-
}
907-
}
908-
909852
await this.connection
910853
.sessionUpdate({
911854
sessionId,

‎packages/cli/src/agent/agent.ts‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,7 @@ export namespace Agent {
122122
general: {
123123
name: "general",
124124
description: `General-purpose agent for researching complex questions and executing multi-step tasks. Use this agent to execute multiple units of work in parallel.`,
125-
permission: PermissionNext.merge(
126-
defaults,
127-
PermissionNext.fromConfig({
128-
todoread: "deny",
129-
todowrite: "deny",
130-
}),
131-
user,
132-
),
125+
permission: PermissionNext.merge(defaults, user),
133126
options: {},
134127
mode: "subagent",
135128
native: true,

‎packages/cli/src/cli/cmd/agent.ts‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@ import type { Argv } from "yargs"
1414

1515
type AgentMode = "all" | "primary" | "subagent"
1616

17-
const AVAILABLE_TOOLS = [
18-
"bash",
19-
"read",
20-
"write",
21-
"edit",
22-
"list",
23-
"glob",
24-
"grep",
25-
"webfetch",
26-
"task",
27-
"todowrite",
28-
"todoread",
29-
]
17+
const AVAILABLE_TOOLS = ["bash", "read", "write", "edit", "list", "glob", "grep", "webfetch", "task"]
3018

3119
const AgentCreateCommand = cmd({
3220
command: "create",

‎packages/cli/src/cli/cmd/run.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import { WebSearchTool } from "../../tool/websearch"
3939
import { TaskTool } from "../../tool/task"
4040
import { SkillTool } from "../../tool/skill"
4141
import { BashTool } from "../../tool/bash"
42-
import { TodoWriteTool } from "../../tool/todo"
4342
import { Locale } from "../../util/locale"
4443
import { Log } from "../../util/log"
4544
import { Shutdown } from "../shutdown"
@@ -286,16 +285,6 @@ function bash(info: ToolProps<typeof BashTool>) {
286285
)
287286
}
288287

289-
function todo(info: ToolProps<typeof TodoWriteTool>) {
290-
block(
291-
{
292-
icon: "#",
293-
title: "Todos",
294-
},
295-
info.input.todos.map((item) => `${item.status === "completed" ? "[x]" : "[ ]"} ${item.content}`).join("\n"),
296-
)
297-
}
298-
299288
function normalizePath(input?: string) {
300289
if (!input) return ""
301290
if (path.isAbsolute(input)) return path.relative(process.cwd(), input) || "."
@@ -568,7 +557,6 @@ export const RunCommand = cmd({
568557
if (part.tool === "codesearch") return codesearch(props<typeof CodeSearchTool>(part))
569558
if (part.tool === "websearch") return websearch(props<typeof WebSearchTool>(part))
570559
if (part.tool === "task") return task(props<typeof TaskTool>(part))
571-
if (part.tool === "todowrite") return todo(props<typeof TodoWriteTool>(part))
572560
if (part.tool === "skill") return skill(props<typeof SkillTool>(part))
573561
return fallback(part)
574562
} catch {

‎packages/cli/src/config/config.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,6 @@ export namespace Config {
628628
bash: PermissionRule.optional(),
629629
task: PermissionRule.optional(),
630630
external_directory: PermissionRule.optional(),
631-
todowrite: PermissionAction.optional(),
632-
todoread: PermissionAction.optional(),
633631
question: PermissionAction.optional(),
634632
webfetch: PermissionAction.optional(),
635633
websearch: PermissionAction.optional(),

‎packages/cli/src/session/prompt/anthropic-20250930.txt‎

Lines changed: 0 additions & 166 deletions
This file was deleted.

0 commit comments

Comments
 (0)