Isn't the end of the humanity also the end of capitalism?
Do you expect competing AIs to give up on private ownership of the means of production and using them for profit?
And vice versa.
It'll turn into some starwars robot slave trading, Capitalism will be fine!
Not necessarily! In "Saturn's Children" by Stross, humanity managed to wipe itself out, but post-humans (evolved from former, ahem, entertainment androids) are doing just fine across the Solar System. There's a plot point where one of them discovers that some corporation back on Earth inherited full property rights to her body due to an old pre-human-extinction EULA, and she'll be recycled for parts if she ever sets foot in their jurisdiction (I'm paraphrasing from memory).