The worry the Pentagon had and increasingly has is not over ISIS, it is over that large parts of Afghanistan, like Iraq and Syria already have, will fall into the Iranian sphere. Iran already is strongly present and expanding its influence in all these three countries and is delighted by the US chasing after small bands of mad Sunni Jihadis rather than after them, the strategic regional enemy.
The end game in Afghanistan should have been reduced either by Bush or Obama I to the capture or killing of Osama bin Laden, the US should have no game in the actual politics of Afghanistan because it is futile. It should simply maintain the intelligence and military capabilities to interfere whenever another globally dangerous group like Al Qaeda makes camp in Afghanistan. The US cannot define a realistic victory in Afghanistan other than keeping the Pashtun (Taliban) out of power. When you realize that there are more than twice as many Pashtun in Pakistan as there are in Afghanistan, then it becomes clear that there is no victory that doesn’t include the Pashtun. But the Pashtun won’t talk and can and will wait this out as has been customary in the region for thousands of years, ask Alexander, ask the Russians. Eventually egos fall and some future US President will need to pull the plug. But not anytime soon, the cost of the Afghan war is limited and probably less costly than retreat. It has significant benefits too, it allows for scenarios, materiel and commanders to be battle tested.
By the way, Trump took full ownership the moment he assumed the Presidency. He can blame whomever for the predicament he’s in but that merely further illustrates his gross incompetence.