MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / complete_agent_task

Function complete_agent_task

src/tasks/local_agent.py:277–291  ·  view source on GitHub ↗

Flip status to ``completed``, stash the final text, schedule eviction.

(
    task_id: str,
    *,
    result_text: str,
    registry: "RuntimeTaskRegistry",
)

Source from the content-addressed store, hash-verified

275
276
277def complete_agent_task(
278 task_id: str,
279 *,
280 result_text: str,
281 registry: "RuntimeTaskRegistry",
282) -> None:
283 """Flip status to ``completed``, stash the final text, schedule eviction."""
284 def _complete(prev: TaskStateBase) -> TaskStateBase:
285 if not isinstance(prev, LocalAgentTaskState):
286 return prev
287 if is_terminal_task_status(prev.status):
288 return prev
289 return _terminal_replace(prev, status="completed", result_text=result_text)
290
291 registry.update(task_id, _complete)
292
293
294def fail_agent_task(

Calls 1

updateMethod · 0.45