Composer Stephen Sondheim's first attempt at an opening number was titled "Happy Endings." Then he wrote "Love is in the Air", which seemed to make everyone happy. Except Sondheim. About a month before rehearsals started, he started to feel it was the wrong opening number because it didn't tell the audience what the show was going to be like and he wrote "Invocation" to replace it. George Abbott, the show's director, didn't like "Invocation" so "Love Is in the Air" remained as the opening number when the show opened to an unenthusiastic reception in New Haven and then a disastrous reception in Washington, D.C.
During the Washington run, Jerome Robbins, who at one time had been slated to direct the show, was asked to help out. After seeing the show, Robbins told them that everything was fine but the opening number led the audience to have the wrong expectations of what the show was to be like. Sondheim wrote "Comedy Tonight", and Robbins staged it. Robbins did a good deal of restaging elsewhere as well, which he would eventually detail in a letter to the show's producer, Hal Prince, in which he demanded additional royalties for his work on the show.
As soon as "Comedy Tonight" went into the show — at the first preview in New York — audiences responded with uproarious laughter to the same lines and situations that earlier audiences had greeted with silence.