On Atlantis, Teyla talks about a Seer, Davos, who is one of the Vedeenan. McKay is skeptical but Teyla wants to consult him to see if he can help her find her people. Sam grants her permission and Sheppard takes his team to the planet where they find the Vedeenan waiting for them.
Woolsey arrives at Atlantis for Sam's three-month evaluation, admitting that bureaucratic intervention hasn't always been a good idea. They're interrupted when they get an unauthorized gate opening and a report that a particular Wraith wants to meet with Sheppard.
Their escort, Linara, explains to Sheppard that Davos is her father and he preserved them against the Wraith. They meet with Davos who informs them he can show them what he sees, and takes a reluctant Rodney's hand. Rodney gets a vision of them being surrounded by an armed party.
Sheppard returns to Atlantis where Sam tells him that the Wraith leader who allied with Sheppard wants a meeting. Sheppard suggests they agree to the meeting, but Woolsey is leery. Sheppard's team goes to the meeting and they find themselves at the place from Rodney's vision. The Wraith leader and his men surround them, but Sheppard has two cloaked Puddle Jumpers in reserve. Meanwhile, Dr. Keller tends to the ailing Davos and says he has the equivalent of lymphatic cancer and Sam tells her to bring the seer back to Atlantis for treatment.
Sheppard brings the Wraith leader back to Atlantis and confine him, and he explains he requires their help. He wants to know McKay's base code used to program the Replicators, and he says that they are now annihilating human worlds to eliminate the Wraith food supply.
They send a MALP to the planet that the Wraith leader says was annihilated, and confirm the destruction. Meanwhile, Keller scans Davos, who admits he can't see his own future. McKay worries that they caused the devastation, and says they should shut down the code. The Wraith has the original code they used to deactivate the Wraith, and if they work together they can shut down the Replicators again. Woolsey warns against it and contacts his superiors.
Sam talks to Sheppard about what they should do, while Keller confirms that Davos displays signs of advanced mental development that confirms he has a genetic quirk that grants him the ability to see the future. She talks to Davos who offers her a vision of the future: the Replicators destroying Atlantis.
Woolsey advises them not to trust the Wraith, believing the vision means the Wraith and Replicators will ally against them. Sheppard wonders if the Wraith Leader can be trusted, but they're interrupted when they detect a Hive ship heading directly for the cloaked Atlantis. Sheppard talks t the Wraith Leader, who reveals he has an implanted subspace tracker and that the ship has the code necessary for them to begin their work.
Rodney warns that he can't develop the shutdown code on his own without having the original code. Meanwhile, Teyla talks to Davos, and he admits that he knows his death is coming soon. He confirms that Teyla is pregnant and she takes him to see Sam, but he collapses and when she touches him she gets a vision of a future where Sheppard fires Ancient drones on the Hive ship.
Woolsey believes the vision confirms his approach, and Sheppard suggests they play along and then betray the Wraith once they get the new shutdown code. However, if they don't destroy it quickly enough, it may send a message to the other Wraith. Sam and a reluctant Woolsey go to see the Wraith and lay out the terms of their agreement. The Wraith Leader agrees to their terms and confirms he plans to leverage his victory to restore his former power, and they'll work out their issues later.
The Hive ships arrives and transmits the base code, and McKay and the Wraith work together. Rodney determines that not all of the code is present and they track another Hive ship heading for Atlantis. They interrogate the Wraith Leader who says he knows nothing of it, but admits he held back part of the code as insurance. Rodney figures that a rival Wraith faction suspects something is up and is coming to investigate. The Wraith suggests they cloak the city. Rodney warns that they'll lose shields and vulnerable to destruction.
Sam goes to see Davos, who admits he's never been wrong and is unable to avoid the future. He does note that his visions can be misinterpreted and the future is dependent on the few people at Atlantis. Sam talks to Sheppard, who thinks they have too much information and says that the people of Atlantis trust her.
Sam agrees to trust their Wraith and cloaks the city, although Woolsey notes that they'll have no time to switch back to shields. Woolsey insists on staying despite the danger, while Sheppard prepares the drones. Meanwhile, Davos passes away in the lab as Keller and Linara look on.
The second Hive ship arrives and the two ships communicate back and forth… and then arm weapons. Sheppard prepares to fire weapons but Sam holds him off against Woolsey's advice. Woolsey tries to take command but Sam shuts him down, and McKay confirms the two ships are firing on each other. Both ships are destroyed.
Linara is concerned that without her father, she wont' know the future but Teyla tries to reassure her. Keller suggests that Teyla will have to tell the others sometime. Woolsey departs after wondering how Sam knew the Wraith would turn on each other. She admits she doesn't, and he admits he won't include their disagreement in the report. Sam is left to wonder if her vision will come true… eventually.