Tesla on Thursday reached an agreement to settle a class-action lawsuit with buyers of its Model S and Model X cars who alleged that the company’s assisted-driving Autopilot system was “essentially unusable and demonstrably dangerous.” No further details of the agreement, announced in a filing in San Jose federal court late Thursday, were available.