Li Yuan led his two sons, Li Shimin, the king of Qin, and Li Yuanji, the king of Qi, to Renzhi Palace to escape the summer.
Zhang Jieyu said that Li Shimin gave the good land that Li Yuan gave her father to the king of Huai'an. This annoyed Li Yuan, who felt that Li Shimin had offended his authority. He angrily called Li Shimin to question about it. Under Li Shimin's explanation and persuasion, Li Yuan finally forgave Li Shimin.
Li Yuanji knew that Li Shimin had a special preference for war horses, so he deliberately found a fierce horse and let Li Shimin test ride. Li Shimin was really not afraid and tamed the fierce horse. Li Yuanji and Zhang Jieyu secretly framed Li Shimin, making Li Yuan suspicious of Li Shimin.
In order to expand his own power, Li Jiancheng secretly sent people to transport 200 pieces of armor to Yang Wengan in Gyeongju, which was discovered by Li Shimin's subordinates, and instigated General Lang and the lieutenant who were in charge of transporting the armor to report the matter directly to Inzhi Palace to Li Yuan.
Under Li Yuan's questioning, Li Jiancheng simply told the truth that he had made this decision in order to prevent Li Shimin. Just when Li Yuan's attitude eased somewhat, news suddenly came that Yang Wengan of Gyeongju had rebelled. Li Yuan was furious, put the prince in prison, and urgently summoned Li Shimin to escort him. Li Shimin hurried to Gyeongju to quell the rebellion.