In 618, news arrived at You Prefecture that Emperor Yang had been killed in a coup at Jiangdu (江都, in modern Yangzhou, Jiangsu) led by the general Yuwen Huaji. Yuwen sent messengers to Luo Yi suggesting that he submit to the new regime that Yuwen led after Yuwen declared Emperor Yang's nephew Yang Hao the Prince of Qin emperor. Luo, although he himself had rebelled against Emperor Yang, stated, "I am still a Sui subject." He executed Yuwen's messengers and then also rejected overtures from agrarian rulers Dou Jiande the Prince of Xia and Gao Kaidao the Prince of Yan. Instead, apparently with Wen Yanbo's advocacy, he decided to submit to another former Sui general, Li Yuan, who had also rebelled against Emperor Yang in 617 but who by now had taken over the western parts of the empire and established Tang Dynasty at Chang'an as its Emperor Gaozu. Emperor Gaozu accepted Luo's submission and created him the Prince of Yan, granting him the imperial clan name of Li (and he thereafter became known as Li Yi) and making him the commandant at You Prefecture. As Wen had supported Li Yi's decision to submit, Emperor Gaozu made Wen the secretary general of You Prefecture and created him the Duke of Xihe, and soon summoned him to Chang'an to serve as a "Zhongshu Sheren" (中書舍人), a mid-level official at the legislative bureau (by this point renamed 中書省, "Zhongshu Sheng"). At that time, Wen Yanbo's older brother Wen Daya served as the deputy head of the legislative bureau, and the two brothers lived close by. This was considered an unusual honor. When Goguryeo offered tributes to Emperor Gaozu, Emperor Gaozu considered declining the tributes and not treating Goguryeo as a subject but as an equal (to endear himself to Goguryeo's King Yeongnyu). Wen Yanbo opposed, stating: