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

Function complete_task

s15_agent_teams/code.py:125–138  ·  view source on GitHub ↗
(task_id: str)

Source from the content-addressed store, hash-verified

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