Li Jiancheng
There were allegations that Yang Wengan () was raising troops for Li Jiancheng—who was left in charge of the capital while Emperor Gaozu was away in his summer palace—to stage a coup for the throne. Whether Li Jiancheng was actually involved is still disputed among historians. Yang Wengan was the regional commander of Qingzhou in Gansu and a former guard of Li Jiancheng at the East Palace. The plot was disclosed to the authorities, so Li Jiancheng was summoned from Chang'an and Yang Wengan was summoned from his garrison post. Li Jiancheng went to seek forgiveness against the advice of a subordinate to seize the throne. In contrast, Yang Wengan raised his troops and rebelled in the 6th month of 624. Emperor Gaozu sent Li Shimin to put down the rebellion, but Yang's own subordinates killed him after the imperial forces arrived at the scene. Emperor Gaozu initially offered Li Shimin the position of heir apparent in light of Yang's rebellion. However, Li Jiancheng's supporters, Li Yuanji, the palace ladies, and Minister Feng Deyi interceded to clear Li Jiancheng from the affair. Thus, Emperor Gaozu allowed Li Jiancheng to remain the heir apparent, but exiled some of Li Jiancheng's advisors and at least one member of Li Shimin's staff.