SpaceX has agreed to testify before the New York City Council about AI safety after missing an earlier hearing and facing the prospect of court enforcement.