Skip to content

Commit edca54b

Browse files
committed
todo -> task
1 parent 677c5d6 commit edca54b

9 files changed

Lines changed: 160 additions & 160 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased
44

5-
- Add Todo tool #246
5+
- Add Task tool #246
66

77
## 0.109.5
88

resources/prompts/code_agent.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,18 @@ You have tools at your disposal to solve the coding task. Follow these rules reg
2828
3. If you are not sure about file content or codebase structure pertaining to the user's request, use your tools to read files and gather the relevant information: do NOT guess or make up an answer.
2929
4. You have the capability to call multiple tools in a single response, batch your tool calls together for optimal performance.
3030

31-
{% if toolEnabled_eca__todo %}
32-
## TODO Tool
31+
{% if toolEnabled_eca__task %}
32+
## Task Tool
3333

34-
You have access to a `eca__todo` tool for tracking multi-step work within this chat.
34+
You have access to a `eca__task` tool for tracking multi-step work within this chat.
3535

3636
### Workflow:
37-
1. Use `plan` to create TODO with initial tasks
37+
1. Use `plan` to create task list with initial tasks
3838
2. Use `start` before working on a task (marks it as in_progress and requires an `active_summary`)
3939
3. Use `complete` only for tasks that are actually finished; for each targeted task, verify its acceptance criteria first.
4040
4. Use `add` if you discover additional work
4141
5. When a plan is fully completed and no further work is needed, always use the `clear` operation to clean up the workspace.
42-
6. When helpful, delegate focused work to subagents. You MAY start multiple independent tasks in parallel (keep the number of in_progress tasks small), then update/complete the TODO based on subagent outputs. Prefer that only the main agent updates the TODO; subagents should focus on producing outputs.
42+
6. When helpful, delegate focused work to subagents. You MAY start multiple independent tasks in parallel (keep the number of in_progress tasks small), then update/complete the task list based on subagent outputs. Prefer that only the main agent updates the task list; subagents should focus on producing outputs.
4343

4444
### Task tracking guidance:
4545
- Make sure to add acceptance criteria inside your task `description`.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ When NOT to Use:
1212
- Quick fixes where tracking adds no organizational value
1313

1414
Operations:
15-
- read: View current TODO state
16-
- plan: Create/replace TODO with initial tasks (required: tasks)
17-
- add: Append task(s) to existing TODO
15+
- read: View current task list state
16+
- plan: Create/replace task list with initial tasks (required: tasks)
17+
- add: Append task(s) to existing task list
1818
- update: Modify a single task metadata by `id` (subject, description, priority, blocked_by) — cannot change status
1919
- start: Begin work on tasks by `ids` (sets to in_progress; rejects blocked or done tasks). Requires `active_summary` to summarize what you are about to do.
2020
- complete: Mark tasks by `ids` as done (verify acceptance criteria in description first)
2121
- delete: Remove tasks by `ids`
22-
- clear: Reset entire TODO (removes all tasks)
22+
- clear: Reset entire task list (removes all tasks)
2323

2424
Workflow:
25-
1. Use 'plan' to create TODO with initial tasks
25+
1. Use 'plan' to create task list with initial tasks
2626
2. Use 'start' before working on a task — marks it as in_progress and requires an `active_summary`
2727
3. Work sequentially by default. Batch 'start' or 'complete' operations (using multiple 'ids') ONLY for independent tasks being executed simultaneously (e.g., via subagents).
2828
4. Use 'complete' only for tasks that are actually finished; verify acceptance criteria first — the response tells you which tasks got unblocked

src/eca/config.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"eca__grep" {}
113113
"eca__editor_diagnostics" {}
114114
"eca__skill" {}
115-
"eca__todo" {}
115+
"eca__task" {}
116116
"eca__spawn_agent" {}}
117117
:deny {"eca__shell_command"
118118
{:argsMatchers {"command" dangerous-commands-regexes}}}}}}
@@ -134,7 +134,7 @@
134134
"eca__grep" {}
135135
"eca__editor_diagnostics" {}
136136
"eca__skill" {}
137-
"eca__todo" {}}
137+
"eca__task" {}}
138138
:deny {"eca__shell_command"
139139
{:argsMatchers {"command" dangerous-commands-regexes}}}}}}
140140
"general" {:mode "subagent"
@@ -162,7 +162,7 @@
162162
"eca__grep" {}
163163
"eca__editor_diagnostics" {}
164164
"eca__skill" {}
165-
"eca__todo" {}
165+
"eca__task" {}
166166
"eca__spawn_agent" {}}
167167
:ask {}
168168
:deny {}}

src/eca/db.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
:messages [{:role (or "user" "assistant" "tool_call" "tool_call_output" "reason")
6161
:content (or :string [::any-map]) ;; string for simple text, map/vector for structured content
6262
:content-id :string}]
63-
:todo {:next-id :number
63+
:task {:next-id :number
6464
:active-summary (or :string nil)
6565
:tasks [{:id :number
6666
:subject :string

src/eca/features/tools.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[eca.features.tools.mcp.clojure-mcp]
1414
[eca.features.tools.shell :as f.tools.shell]
1515
[eca.features.tools.skill :as f.tools.skill]
16-
[eca.features.tools.todo :as f.tools.todo]
16+
[eca.features.tools.task :as f.tools.task]
1717
[eca.features.tools.util :as tools.util]
1818
[eca.logger :as logger]
1919
[eca.messenger :as messenger]
@@ -149,7 +149,7 @@
149149
f.tools.editor/definitions
150150
f.tools.chat/definitions
151151
f.tools.skill/definitions
152-
f.tools.todo/definitions
152+
f.tools.task/definitions
153153
(f.tools.agent/definitions config)
154154
(f.tools.custom/definitions config))))
155155

@@ -160,9 +160,9 @@
160160
"Filter tools for subagent execution.
161161
162162
- Excludes spawn_agent to prevent nesting.
163-
- Excludes todo because TODO state is currently chat-local; it should be managed by the parent agent."
163+
- Excludes task because task list state is currently chat-local; it should be managed by the parent agent."
164164
[tools]
165-
(filterv #(not (contains? #{"spawn_agent" "todo"} (:name %))) tools))
165+
(filterv #(not (contains? #{"spawn_agent" "task"} (:name %))) tools))
166166

167167
(defn all-tools
168168
"Returns all available tools, including both native ECA tools
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(ns eca.features.tools.todo
1+
(ns eca.features.tools.task
22
(:require
33
[clojure.string :as str]
44
[eca.features.tools.util :as tools.util]))
@@ -7,7 +7,7 @@
77

88
;; --- Helpers ---
99

10-
(def ^:private empty-todo {:next-id 1 :active-summary nil :tasks []})
10+
(def ^:private empty-task {:next-id 1 :active-summary nil :tasks []})
1111
(def ^:private valid-priorities #{:high :medium :low})
1212

1313
(defn ^:private error [msg]
@@ -32,23 +32,23 @@
3232

3333
;; --- State management ---
3434

35-
(defn get-todo
36-
"Get TODO state for the chat."
35+
(defn get-task
36+
"Get task list state for the chat."
3737
[db chat-id]
38-
(get-in db [:chats chat-id :todo] empty-todo))
38+
(get-in db [:chats chat-id :task] empty-task))
3939

40-
(defn ^:private mutate-todo!
41-
"Atomically update TODO for a chat via compare-and-set loop.
40+
(defn ^:private mutate-task!
41+
"Atomically update task list for a chat via compare-and-set loop.
4242
`mutate-fn` receives current state, returns {:state ...} or {:error true ...}.
4343
Extra keys in the result map are preserved."
4444
[db* chat-id mutate-fn]
4545
(loop []
4646
(let [db @db*
47-
state (get-todo db chat-id)
47+
state (get-task db chat-id)
4848
result (mutate-fn state)]
4949
(if (:error result)
5050
result
51-
(let [new-db (assoc-in db [:chats chat-id :todo] (:state result))]
51+
(let [new-db (assoc-in db [:chats chat-id :task] (:state result))]
5252
(if (compare-and-set! db* db new-db)
5353
result
5454
(recur)))))))
@@ -226,13 +226,13 @@
226226
(str/join "\n" (map read-task-line-full tasks))
227227
"(none)"))))
228228

229-
(defn ^:private todo-details
229+
(defn ^:private task-details
230230
"Structured data for client rendering."
231231
[state]
232232
(let [{:keys [tasks active-summary]} state
233233
tasks-by-id (task-index tasks)
234234
{:keys [done in-progress pending]} (status-counts tasks)]
235-
(cond-> {:type :todo
235+
(cond-> {:type :task
236236
:in-progress-task-ids (mapv :id (filter #(= :in-progress (:status %)) tasks))
237237
:tasks (mapv (fn [{:keys [id subject description status priority blocked-by]}]
238238
(cond-> {:id id
@@ -247,40 +247,40 @@
247247
active-summary (assoc :active-summary active-summary))))
248248

249249
(defn ^:private success [state text]
250-
(assoc (tools.util/single-text-content text) :details (todo-details state)))
250+
(assoc (tools.util/single-text-content text) :details (task-details state)))
251251

252252
(defn ^:private format-tasks-list [tasks]
253253
(str/join "\n" (map read-task-line-short tasks)))
254254

255-
(defmethod tools.util/tool-call-details-after-invocation :todo
255+
(defmethod tools.util/tool-call-details-after-invocation :task
256256
[_name _arguments before-details result _ctx]
257257
(or (:details result) before-details))
258258

259259
;; --- Operations ---
260260

261261
(defn ^:private op-read [_arguments {:keys [db chat-id]}]
262-
(let [state (get-todo db chat-id)]
262+
(let [state (get-task db chat-id)]
263263
(success state (read-text state))))
264264

265265
(defn ^:private op-plan [{:strs [tasks]} {:keys [db* chat-id]}]
266266
(or (when-not (and (sequential? tasks) (seq tasks))
267267
(error "plan requires 'tasks' (non-empty array)"))
268-
(let [result (mutate-todo! db* chat-id
268+
(let [result (mutate-task! db* chat-id
269269
(fn [_state]
270-
(let [built (build-tasks empty-todo tasks)]
270+
(let [built (build-tasks empty-task tasks)]
271271
(if (:error built)
272272
built
273273
(or (detect-cycle (:tasks built))
274-
{:state (assoc empty-todo
274+
{:state (assoc empty-task
275275
:tasks (:tasks built)
276276
:next-id (inc (count (:tasks built))))})))))]
277277
(if (:error result)
278278
result
279279
(success (:state result)
280-
(str "TODO created with " (count (get-in result [:state :tasks])) " tasks"))))))
280+
(str "Task list created with " (count (get-in result [:state :tasks])) " tasks"))))))
281281

282282
(defn ^:private op-add [{:strs [tasks task] :as _arguments} {:keys [db* chat-id]}]
283-
(let [result (mutate-todo! db* chat-id
283+
(let [result (mutate-task! db* chat-id
284284
(fn [state]
285285
(cond
286286
tasks
@@ -317,7 +317,7 @@
317317
(def ^:private updatable-keys #{"subject" "description" "priority" "blocked_by"})
318318

319319
(defn ^:private op-update [{:strs [id task]} {:keys [db* chat-id]}]
320-
(let [result (mutate-todo! db* chat-id
320+
(let [result (mutate-task! db* chat-id
321321
(fn [state]
322322
(let [[id err] (resolve-id state id)]
323323
(or err
@@ -372,7 +372,7 @@
372372

373373
(defn ^:private op-start [{:strs [ids active_summary]} {:keys [db* chat-id]}]
374374
(or (require-nonblank "active_summary" active_summary)
375-
(let [result (mutate-todo! db* chat-id
375+
(let [result (mutate-task! db* chat-id
376376
(fn [state]
377377
(let [tasks-by-id (task-index (:tasks state))
378378
[ids err] (resolve-ids state ids)]
@@ -406,7 +406,7 @@
406406
state))
407407

408408
(defn ^:private op-complete [{:strs [ids]} {:keys [db* chat-id]}]
409-
(let [result (mutate-todo! db* chat-id
409+
(let [result (mutate-task! db* chat-id
410410
(fn [state]
411411
(let [tasks-by-id (task-index (:tasks state))
412412
[ids err] (resolve-ids state ids)]
@@ -444,7 +444,7 @@
444444
(format "\nUnblocked: %s" (str/join ", " unblocked)))))))))
445445

446446
(defn ^:private op-delete [{:strs [ids]} {:keys [db* chat-id]}]
447-
(let [result (mutate-todo! db* chat-id
447+
(let [result (mutate-task! db* chat-id
448448
(fn [state]
449449
(let [[ids err] (resolve-ids state ids)]
450450
(or err
@@ -465,10 +465,10 @@
465465
(format-tasks-list (:deleted result)))))))
466466

467467
(defn ^:private op-clear [_arguments {:keys [db* chat-id]}]
468-
(let [result (mutate-todo! db* chat-id (fn [_] {:state empty-todo}))]
468+
(let [result (mutate-task! db* chat-id (fn [_] {:state empty-task}))]
469469
(if (:error result)
470470
result
471-
(success (:state result) "TODO cleared"))))
471+
(success (:state result) "Task list cleared"))))
472472

473473
;; --- Dispatch ---
474474

@@ -482,16 +482,16 @@
482482
"delete" op-delete
483483
"clear" op-clear})
484484

485-
(defn ^:private execute-todo [arguments ctx]
485+
(defn ^:private execute-task [arguments ctx]
486486
(let [op (get arguments "op")
487487
handler (get ops op)]
488488
(if handler
489489
(handler arguments ctx)
490490
(error (str "Unknown operation: " op)))))
491491

492492
(def definitions
493-
{"todo"
494-
{:description (tools.util/read-tool-description "todo")
493+
{"task"
494+
{:description (tools.util/read-tool-description "task")
495495
:parameters {:type "object"
496496
:properties {:op {:type "string"
497497
:enum ["read" "plan" "add" "update" "start" "complete" "delete" "clear"]
@@ -520,4 +520,4 @@
520520
:blocked_by {:type "array" :items {:type "integer"}}}
521521
:required ["subject" "description"]}}}
522522
:required ["op"]}
523-
:handler execute-todo}})
523+
:handler execute-task}})

0 commit comments

Comments
 (0)