def _get_available_agent(self) -> Any:
        """
        Finds an available agent either from the graph default or from any task node.
        
        Returns:
            An agent that can be used for execution, or None if none is found
        """
        # First check if we have a default agent
        if self.default_agent is not None:
            return self.default_agent
        
        # If no default agent, check all task nodes for an agent
        for node in self.nodes:
            if isinstance(node, TaskNode) and node.task.agent is not None:
                return node.task.agent
        
        # No agent found
        return None

        Finds an available agent either from the graph default or from any task node.
        
        Returns:
            An agent that can be used for execution, or None if none is found
        
src/upsonic/client/graph.py