Skip to main content

Module progress_watcher

Module progress_watcher 

Source
Expand description

Pushed per-agent progress: the agent’s current todo checklist and the tool it is running right now, published as an agent:progress MuxEvent so the Swarm pane can list them under the agent’s name.

Sibling of super::activity_watcher, and deliberately a separate loop: that one spends a Haiku call per agent to write an English one-liner and is throttled accordingly. This one only reads NEW bytes of a block’s output file and parses JSON, so it costs nothing per tick and can run far more often — which is the point, since a checklist that lags 20s behind the agent is worse than no checklist.

Why the backend and not the frontend: agent-document-store already holds every tool call, but only for panes that are currently MOUNTED. The Swarm pane’s whole value is seeing agents you are not looking at, so the data has to come from the same place the shell/cron/summary rows come from.

Why state is carried across ticks (reagent P1 on PR #2952): the checklist cannot be rebuilt from a fixed tail window. TodoWrite-style calls are immune — one call carries the whole list — but the vocabulary AgentMux actually ships against (TaskCreate/TaskUpdate) describes ONE item per call, so reconstructing the list needs every still-open task’s original TaskCreate to be inside the window. A verbose Bash or a large Read pushes those out within seconds, and the task would then vanish from the checklist while still open, silently. So each block keeps an accumulated [BlockState] and each tick only consumes the bytes appended since the last one.

Modules§

codex_plan
Codex’s plan as an agent’s checklist, for the progress watcher (SPEC_WARDEN_KANBAN_2026_10_20.md §6.12).

Structs§

AgentProgress
What we currently believe about one agent.
RecentFile
One file an agent changed, as its tool call named it.
TodoItem
One checklist entry as the Swarm renders it.
WatchedWork
What the watcher currently knows about one block, for readers outside the sweep loop.

Constants§

EVENT_AGENT_PROGRESS
MAX_RECENT_FILES
Most recent files kept per block, distinct paths, newest first.

Functions§

run_agent_progress_loop
Run the progress sweep loop. Never returns.
watched_work
Read access to the watcher’s state for one block: its checklist, current tool and recent files. None until the watcher has swept it once.