With Mosul the last major city to be invaded, ISIS is expected to soon have little to no remaining territory. US officials have made clear that this won’t impact their deployment to Iraq, and talks are now said to be ongoing to cement that as a reality.
After the last US occupation, Iraq was eager to be rid of as many of the occupation troops as possible. This time, the US is arguing that any situation which doesn’t include an open-ended US military presence will end up with a new insurgency cropping up, and US officials are insisting that the Iraqis agree.
Of course, the expectation is that as soon as ISIS loses all its territory it will just go back to being an insurgency anyhow, and the presence of US troops isn’t going to impact that at any rate, beyond whatever agreements are made to have them involved in defending sensitive targets.
Ongoing talks are mostly centered on what form the permanent US deployment will take, and if the Bush-era talks are to be any indicator, the focus is likely to be on ensuring that US forces have absolute legal immunity for anything they do in Iraq.