Lee and Hikosaka show how animals overcome challenges and ultimately achieve goals. They find that LHb and PAG neurons encode prediction errors and the continuity of reward expectancy, with tonic PAG activity sustaining reward expectancy despite prediction errors.