According to what you said, if it is possible to end the lawsuit, it is ok to terminate the contract due to the refund of fees or the agreement in the agency contract. For example, the charges in the later period of the contract, or the automatic performance of the contract after the case is withdrawn, will lead to the termination of the agreement;
3. Corresponding to the termination of the agreement is the refund of lawyer's fees, and some lawyers sign the termination agreement with the parties in order not to invoice or to avoid tax after invoicing.