MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / complete_task

Method complete_task

core/planner_v2.py:204–226  ·  view source on GitHub ↗

Mark a task as completed.

(self, task_id: int, result: str)

Source from the content-addressed store, hash-verified

202 return True
203
204 def complete_task(self, task_id: int, result: str) -> bool:
205 """Mark a task as completed."""
206 task = self._tasks.get(task_id)
207 if not task:
208 return False
209
210 task.status = TaskStatus.DONE
211 task.result = result
212 task.completed_at = int(time.time())
213
214 # Update database
215 self.state.complete_task(task_id, result)
216
217 success(f"Planner: completed task {task_id}")
218
219 # Log in episodic memory
220 self.state.log_action("task_completed", f"Task {task_id}: {result[:100]}")
221
222 # Clear current task if this was it
223 if self._current_task and self._current_task.id == task_id:
224 self._current_task = None
225
226 return True
227
228 def fail_task(self, task_id: int, error_msg: str) -> bool:
229 """

Callers

nothing calls this directly

Calls 3

successFunction · 0.90
getMethod · 0.45
log_actionMethod · 0.45

Tested by

no test coverage detected