MCPcopy
hub / github.com/dataelement/Clawith / add_task_log

Function add_task_log

backend/app/api/tasks.py:137–149  ·  view source on GitHub ↗

Add a progress log entry to a task.

(
    agent_id: uuid.UUID,
    task_id: uuid.UUID,
    data: TaskLogCreate,
    current_user: User = Depends(get_current_user),
    db: AsyncSession = Depends(get_db),
)

Source from the content-addressed store, hash-verified

135
136@router.post("/{task_id}/logs", response_model=TaskLogOut, status_code=status.HTTP_201_CREATED)
137async def add_task_log(
138 agent_id: uuid.UUID,
139 task_id: uuid.UUID,
140 data: TaskLogCreate,
141 current_user: User = Depends(get_current_user),
142 db: AsyncSession = Depends(get_db),
143):
144 """Add a progress log entry to a task."""
145 await check_agent_access(db, current_user, agent_id)
146 log = TaskLog(task_id=task_id, content=data.content)
147 db.add(log)
148 await db.flush()
149 return TaskLogOut.model_validate(log)
150
151
152@router.post("/{task_id}/trigger")

Callers

nothing calls this directly

Calls 5

check_agent_accessFunction · 0.90
TaskLogClass · 0.90
model_validateMethod · 0.80
addMethod · 0.45
flushMethod · 0.45

Tested by

no test coverage detected