Work items

This page defines the current contract for WorkItem runtime behavior: lifecycle, focus, readiness, planning, blocking, and completion semantics.

Last verified: 2026-05-26 against src/types.rs WorkItemRecord, WorkItemState, WorkItemPlanStatus, WorkItemReadiness, WorkItemSchedulingState, and the tool implementations in src/tool/tools/{create,update,pick,list,get,complete}_work_item.rs and src/tool/tools/wait_for.rs.

Source RFCs

Core model

A WorkItem is a durable objective record owned by an agent. It tracks:

FieldPurpose
objectiveShort human-readable target (required)
stateOpen or Completed
plan_statusdraft, ready, or needs_input
plan_artifactPath to the durable plan.md artifact in agent home
todo_listProgress checklist snapshot
blocked_byHuman-readable wait/blocker description for display
recheck_atLegacy fallback deadline for blocked re-evaluation
recheck_consumed_atMarker that the current recheck reminder was delivered
result_summaryCompletion summary (optional)

The Rust enum WorkItemPlanStatus uses PascalCase variants (Draft, Ready, NeedsInput), but all tool input/output uses snake_case (draft, ready, needs_input).

Lifecycle states

                    CreateWorkItem
                          │
                          ▼
                    ┌──────────┐
                    │   Open   │
                    └────┬─────┘
                         │
            ┌────────────┼────────────┐
            ▼            ▼            ▼
       plan_status    plan_status   plan_status
        = Draft       = Ready       = NeedsInput
            │            │               │
            └────────────┼───────────────┘
                         │
                    CompleteWorkItem
                         │
                         ▼
                    ┌───────────┐
                    │ Completed │
                    └───────────┘

Key contract:

Readiness and scheduling

WorkItem readiness is derived from state, plan_status, blocked_by, and active wait state:

WorkItemSchedulingStateCondition
RunnableOpen, plan not NeedsInput, no blocker, no active wait
WaitingOperatorplan_status=NeedsInput or active operator wait
WaitingTaskActive wait on a task result
WaitingExternalActive wait on an external event
WaitingTimerActive wait on a timer
WaitingSystemActive wait on a system tick
Blockedblocked_by is set
Completedstate=Completed

WorkItemReadiness is the reduced view used by scheduler and user display:

WorkItemReadinessMaps from
RunnableWorkItemSchedulingState::Runnable
WaitingForOperatorWorkItemSchedulingState::WaitingOperator
BlockedAll other non-completed scheduling states
CompletedWorkItemSchedulingState::Completed

Key contract:

Focus and current work

An agent has at most one current WorkItem (current_work_item_id). The current WorkItem is the focus for the current turn:

Tool surface

ToolPurpose
CreateWorkItemCreate a new open WorkItem with objective, optional plan seed, and todo_list
UpdateWorkItemMutate objective, plan_status, todo_list
PickWorkItemSet current focus to an existing open WorkItem
GetWorkItemRead a single WorkItem with plan preview
ListWorkItemsQuery with filters: all, open, completed, current, queued, blocked, waiting_for_operator, runnable
CompleteWorkItemMark complete; same-round assistant text is promoted as the completion report
WaitForAttach a task, external, or operator wait to the current WorkItem and yield

Key contract:

Plan artifact

Each WorkItem has an optional plan_artifact pointing to a plan.md file in the agent's home directory (work-items/<id>/plan.md). The plan artifact:

Known gaps