; or (BB) a magistrate judge. (bb) Parties included in settlement discussions The settlement discussions described in item (aa) shall include each— (AA) plaintiff; (BB) defendant agency; and (CC) intervenor. ; (2) by striking paragraph (4) and inserting the following: (4) Litigation costs (A) In general Except as provided in subparagraph (B), the court, in issuing any final order in any suit brought under paragraph (1), may award costs of litigation (including reasonable attorney and expert witness fees) to any party, whenever the court determines such award is appropriate. (B) Covered settlement (i) Consent decrees The court shall not award costs of litigation in any proposed covered settlement that is a consent decree. (ii) Other covered settlements (I) In general For a proposed covered settlement other than a consent decree, the court shall ensure that the covered settlement does not include payment to any plaintiff for the costs of litigation. (II) Motions The court shall not grant any motion, including a motion to dismiss, based on the proposed covered settlement described in subclause (I) if the covered settlement includes payment to any plaintiff for the costs of litigation.