Agent::PerformNewPrimitiveAction now acquires the necessary resources before completing the action