The Quảng Nguyên chieftain Lưu Ký launched an unexpected attack against Yongzhou in 1075, which was repelled by the Song's Vietnamese officer Nùng Trí Hội in charge of Guihua. Shenzong then sought to cement an alliance with the "Five Clans" of northern Guangnan by issuing an edict which would standardize their once irregular tribute missions to visit Kaifeng now every five years. Shenzong had officials sent from the capital to supervise militiamen in naval training exercises. Shenzong then ordered that all merchants were to cease trade with the subjects of Đại Việt, a further indication of heightened hostility that prompted the Vietnamese court under Lý Nhân Tông (r. 1072–1127) to prepare for war.