Either Tails or one of the Freedom Fighters/Restoration. The AI was based off Sonic, making him closer really to Chaos Sonic within how he is similar but OFF. When Sonic returns, Metal snaps as he experiences an existential crisis of sorts. Yada-yada, Metal becomes Scourge