@agnishc/edb-todo

extensionmaintained

Pi extension: structured task list with live widget and system-prompt injection to prevent goal drift

by · v0.21.1 · published 3d ago

$ pi install npm:@agnishc/edb-todo
downloads/mo
0
stars
17
last push
3d ago
open issues
1

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

3.9K downloads · last 12 weeks (weekly)

README

@agnishc/edb-todo

A Pi CLI extension that gives the agent a structured task list to prevent goal drift — the tendency for agents to lose track of the original plan as context grows and tool calls accumulate.

Features

  • 6 LLM toolsTaskCreate, TaskList, TaskGet, TaskUpdate, TaskOutput, TaskStop — matching pi-tasks behavior
  • Persistent widget — live task list above the editor with animated spinner (✳✽), elapsed time, and blocked-by hints
  • File-backed storage — memory / session / project scope with file locking and atomic writes
  • Dependency management — bidirectional blocks / blockedBy edges with cycle detection
  • Auto-clear completed tasks — configurable: never / on_list_complete / on_task_complete
  • System-reminder injection — periodic nudges when task tools haven't been used recently
  • Settings panel/todos → ⚙ Settings (task storage + auto-clear, saved to tasks-config.json)
  • Priority system — high / medium / low with color coding (Red / Yellow / Dim)
  • Versioned in-process RPC — optional capability used by Subagents V2 without exposing task-file paths to children

How it works

  1. The agent uses TaskCreate to plan multi-step work as a structured task list
  2. Before every agent turn, active tasks are injected into the system prompt
  3. A live widget above the editor shows tasks with status icons and elapsed time for active tasks
  4. Tasks persist to disk per-session (or project-wide) and survive session resume
  5. Completed tasks remain visible until auto-cleared or manually removed

Tools

TaskCreate

Create a structured task. Used proactively for complex multi-step work.

ParameterTypeRequiredDescription
contentstringBrief actionable title in imperative form
descriptionstringDetailed context and acceptance criteria
priorityhigh | medium | lowDefault: medium
activeFormstringSpinner text when in_progress (e.g., "Running tests")
metadataobjectArbitrary key-value pairs

TaskList

List all tasks sorted by status (pending first, then in_progress, then completed) and ID.

Returns each task's id, content, status, priority, and open blockedBy entries.

TaskGet

Get full details for a specific task by ID — including description, dependencies, and metadata.

ParameterTypeDescription
idstringThe task ID

TaskUpdate

Update task fields, status, and dependencies.

ParameterTypeDescription
idstringTask ID (required)
statuspending | in_progress | completed | deletedNew status (deleted permanently removes)
contentstringNew title
descriptionstringNew description
priorityhigh | medium | lowNew priority
activeFormstringSpinner text
ownerstringAgent/owner name
metadataobjectShallow merge (set key to null to delete)
addBlocksstring[]Task IDs this task blocks
addBlockedBystring[]Task IDs that block this task

Setting status: "deleted" permanently removes the task and cleans up all dependency edges.

Dependencies are bidirectional — addBlocks: ["t2"] on task t1 also adds blockedBy: ["t1"] to task t2.

TaskOutput

Retrieve output from a running or completed background task process.

ParameterTypeDefaultDescription
task_idstringTask ID (required)
blockbooleantrueWait for completion
timeoutnumber30000Max wait time in ms (max 600000)

TaskStop

Stop a running background task process. Sends SIGTERM, waits 5 seconds, then SIGKILL. Marks the task as cancelled.

ParameterTypeDescription
task_idstringTask ID to stop

Task lifecycle

pending → in_progress → completed
                      → cancelled
                      → deleted  (permanently removed)

Dependency management

# Task t2 cannot start until t1 is completed
TaskUpdate { id: "t2", addBlockedBy: ["t1"] }

Edges are bidirectional. The widget and TaskList show open blockers inline (› blocked by #t1). Cycles and self-dependencies are rejected before the task file is changed.

Task storage

Configured via /todos → ⚙ Settings or the PI_TODO environment variable:

ModeFileBehaviour
memory(none)In-memory only — tasks lost when session ends
session (default)<cwd>/.pi/tasks/tasks-<sessionId>.jsonPer-session, survives resume
project<cwd>/.pi/tasks/tasks.jsonShared across all sessions in the project

Settings are saved to <cwd>/.pi/tasks-config.json.

Environment variable override

VariableValueBehaviour
PI_TODOoffIn-memory only (CI/automation)
PI_TODOsprint-1Named shared list at ~/.pi/tasks/sprint-1.json
PI_TODO/abs/path.jsonExplicit absolute file path

Auto-clear completed tasks

ModeBehaviour
neverCompleted tasks stay visible until manually cleared
on_list_complete (default)Cleared after all tasks complete and a few idle turns pass
on_task_completeEach task cleared individually a few turns after completion

Widget

Persistent task list rendered above the editor:

● 4 tasks (1 done, 1 in progress, 2 open)
  ✔ Design the API
  ✳ Implementing auth…  (42s)
  ◻ Write tests  › blocked by #t2
  ◻ Update docs
IconMeaning
Completed (strikethrough + dim)
In-progress
/Animated spinner — actively executing (shows elapsed time)
Pending

/todos command

/todos  — open the interactive task manager

Menu options:

  • View all tasks — select a task to start / complete / delete it
  • Clear completed — remove all completed tasks
  • Clear all — remove all tasks
  • ⚙ Settings — configure task storage and auto-clear

Install

pi install npm:@agnishc/edb-todo

License

MIT © Agnish Chakraborty