feat(tasks): adopt canonical task statuses

This commit is contained in:
2026-05-26 01:32:50 +02:00
parent da5aee6e38
commit 38835e9e79
61 changed files with 692 additions and 342 deletions

View File

@@ -129,8 +129,8 @@ def resource_blocking_decisions() -> str:
@mcp.resource("state://tasks/blocked")
def resource_blocked_tasks() -> str:
"""All tasks with status=blocked."""
return json.dumps(_get("/tasks", {"status": "blocked"}), indent=2)
"""All tasks with status=wait. Legacy resource name kept for compatibility."""
return json.dumps(_get("/tasks", {"status": "wait"}), indent=2)
# ---------------------------------------------------------------------------
@@ -142,7 +142,7 @@ def get_state_summary() -> str:
"""Primary orientation tool. Call at the start of every session.
Returns a full snapshot: topic/workstream/task/decision totals, blocking
decisions, blocked tasks, open workstreams, and the 20 most recent events.
decisions, waiting tasks, open workstreams, and the 20 most recent events.
NOTE: This response is large (~10k tokens). When working inside a single
registered domain repo, use get_domain_summary(domain_slug) instead —
@@ -315,7 +315,7 @@ def list_tasks(workstream_id: str, status: str | None = None) -> str:
Args:
workstream_id: UUID of the workstream (required).
status: Optional filter — todo | in_progress | blocked | done | cancelled.
status: Optional filter — wait | todo | progress | done | cancel.
Returns [{id, title, status, priority, assignee, due_date, needs_human}] for every
matching task. Use this to look up task UUIDs before calling update_task_status,
@@ -326,8 +326,8 @@ def list_tasks(workstream_id: str, status: str | None = None) -> str:
@mcp.tool()
def list_blocked_tasks(workstream_id: str | None = None) -> str:
"""List all tasks with status=blocked, optionally filtered by workstream_id."""
return json.dumps(_get("/tasks", {"status": "blocked", "workstream_id": workstream_id}), indent=2)
"""List all waiting tasks, optionally filtered by workstream_id."""
return json.dumps(_get("/tasks", {"status": "wait", "workstream_id": workstream_id}), indent=2)
@mcp.tool()
@@ -512,7 +512,7 @@ def update_task_status(
agent: Optional[str] = None,
session_id: Optional[str] = None,
) -> str:
"""Update a task's status. blocking_reason is required when status='blocked'.
"""Update a task's status. Canonical status values are wait/todo/progress/done/cancel.
When status='done', always records a token event using the best available data:
Tier 1 (best): pass tokens_in + tokens_out — exact counts from the session
@@ -526,8 +526,8 @@ def update_task_status(
Args:
task_id: UUID of the task
status: todo | in_progress | blocked | done | cancelled
blocking_reason: required when status=blocked
status: wait | todo | progress | done | cancel
blocking_reason: optional wait-condition detail
tokens_in: exact input token count for this task (Tier 1)
tokens_out: exact output token count for this task (Tier 1)
workplan_tokens_in: total input tokens for the whole workplan (Tier 2)