MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / complete_task

Function complete_task

s12_task_system/code.py:126–139  ·  view source on GitHub ↗
(task_id: str)

Source from the content-addressed store, hash-verified

124
125
126def complete_task(task_id: str) -> str:
127 task = load_task(task_id)
128 if task.status != "in_progress":
129 return f"Task {task_id} is {task.status}, cannot complete"
130 task.status = "completed"
131 save_task(task)
132 unblocked = [t.subject for t in list_tasks()
133 if t.status == "pending" and t.blockedBy and can_start(t.id)]
134 print(f" \033[32m[complete] {task.subject} ✓\033[0m")
135 msg = f"Completed {task.id} ({task.subject})"
136 if unblocked:
137 msg += f"\nUnblocked: {', '.join(unblocked)}"
138 print(f" \033[33m[unblocked] {', '.join(unblocked)}\033[0m")
139 return msg
140
141
142# ── Prompt Assembly (from s10, synced) ──

Callers 1

run_complete_taskFunction · 0.70

Calls 4

load_taskFunction · 0.70
save_taskFunction · 0.70
list_tasksFunction · 0.70
can_startFunction · 0.70

Tested by

no test coverage detected