We find a simple analytic solution in open string field theory which, in the on-shell limit, generates a tower of higher-spin vertex operators in bosonic string theory. The solution is related to irregular off-shell vertex operators for Gaiotto states. The wave functions for the irregular vertex operators are described by equations following from the cubic effective action for generalized rolling tachyons, indicating that the evolution from flat to collective higher-spin background in string field theory occurs according to cosmological pattern. We discuss the relation between nonlocalities of the rolling tachyon action and those of higher-spin interactions.