It broke in a flat section where I wasn't applying much power.
I had a bike that did that a lot. After some reluctance, the dealer rebuilt the wheel by hand, and no more spokes broke. A wheel that hasn't been properly set up (which can happen with new bikes) will put stress on one or more spokes which will eventually snap. Simply replacing the broken spoke and retensioning adjacent ones won't solve the basic issue and may transfer excess tension to other spokes.
I suggest a rebuild by hand at least.