ConnectOnionConnectOnion

TodoList

Task tracking tool for agents to manage complex, multi-step tasks.

Installation

main.py
1from connectonion import TodoList 2 3todo = TodoList()

Why Use TodoList?

  • Track progress on complex tasks with multiple steps
  • Show users what the agent is working on
  • Organize multi-step workflows
  • Prevent forgetting steps in complex tasks

When to Use

Use when:

  • • Task requires 3+ distinct steps
  • • User provides multiple tasks
  • • Task requires careful planning
  • • You want to show progress

Don't use when:

  • • Task is trivial (1-2 simple steps)
  • • Task is purely conversational

API

add(content, active_form)

Add a new pending task.

main.py
1todo.add("Fix authentication bug", "Fixing authentication bug") 2todo.add("Run tests", "Running tests") 3todo.add("Update docs", "Updating docs")

start(content)

Mark a task as in_progress. Only one task can be in_progress at a time.

main.py
1todo.start("Fix authentication bug") 2# Shows: ◐ Fixing authentication bug

complete(content)

Mark a task as completed.

main.py
1todo.complete("Fix authentication bug") 2# Shows: ● Fix authentication bug

remove(content)

Remove a task from the list.

main.py
1todo.remove("Update docs")

list()

Get all todos as text.

main.py
1print(todo.list()) 2# ○ Fix authentication bug 3# ◐ Running tests 4# ● Update docs

Task States

IconStatusDescription
pendingNot yet started
in_progressCurrently working on
completedFinished

Visual Display

When tasks change, TodoList shows a panel:

╭─── Tasks (1/3) ───────────────────────────────╮
│ ● Fix authentication bug │
│ ◐ Running tests │
│ ○ Update docs │
╰────────────────────────────────────────────────╯

Use with Agent

main.py
1from connectonion import Agent, TodoList 2 3todo = TodoList() 4agent = Agent("worker", tools=[todo]) 5 6agent.input(""" 7Implement user authentication: 81. Create User model 92. Add login endpoint 103. Add logout endpoint 114. Write tests 12""") 13 14# Agent will: 15# 1. Add all tasks to todo list 16# 2. Start each task before working on it 17# 3. Complete each task when done 18# 4. Show progress throughout

Best Practices

Task Naming

Use both forms:

main.py
1todo.add("Fix authentication bug", "Fixing authentication bug") 2# ^-- content ^-- active_form

One In-Progress at a Time

Only one task should be in_progress. Complete current before starting next.

main.py
1todo.add("Task A", "Doing A") 2todo.add("Task B", "Doing B") 3 4todo.start("Task A") 5todo.start("Task B") # Error: Another task is in progress 6todo.complete("Task A") 7todo.start("Task B") # Now works

Mark Complete Immediately

Complete tasks as soon as done, don't batch.