In an action wherein a judgment or other consequential relief is sought, the costs shall not be affected by the making or refusal of any determination; but in an action for a determination only, under this chapter, costs shall be wholly in the discretion of the court.
Mass. Gen. Laws ch. 231A, § 7