“And Joshua went that night.” This is Joshua and his army. Many times only the leader is mentioned when it means the leader and those with him. The king of Ai is watching, and sees Joshua move his camp, supposedly getting ready to attack Ai in the morning.
“of the valley.” The valley, not the “ravine” between Joshua and Ai. In Israel, the “valley” can be a bottom and can be quite flat, in fact, the Hebrew word can even mean “plain.” It seems that Joshua moved from behind the protection of the ravine to the north to the flat valley to the east of Ai, as if to make an attack on Ai. It is clear that when Joshua faked his retreat, he faced and fled east (Josh. 8:14-15).