 In 604, Emperor Wen died and was succeeded by Yang Guang (as Emperor Yang).Yuwen Shiji's activities early in Emperor Yang's reign were unclear.He was friendly with the general Li Yuan the Duke of Tang, and was said to have discussed much about military matters with Li Yuan.