async def METHOD_NAME(amodel, task_id: str, ws: Websocket) -> Optional[AsyncTaskStatus]:
    task = await _check_task_status(amodel, task_id)
    if task:
        await ws.send(json.dumps(task.to_dict()))
    else:
        await ws.close(reason=f'task {task_id} not found')
    return task