Later in the episode, when Jaime hears the news of what's happening down south, he decides to leave Brienne and go back to King's Landing.
If we look back at the scene where Jaime learns what's going on — which is when he seems to decide to leave — it suggests two possibilities.
On the other hand, Sansa smugly suggests that Cersei is definitely dead as a result of her attack on Dany — which could be what spurs Jaime to action.
If that were the case, it would mean one of the most interesting character arcs on the show really was for nothing.