Toyota Repair: 96 corolla rough cold startup, failure code, 7afe


Question
Ive noticed in the past month that when starting cold theres a very rough/vibrating idle. Once warmed up it goes away (mostly). It always ran like a top before this. Its a '96 corolla 7AFE engine with 170K/auto tran.
Also, the check engine light has been coming on and off for about 3 months now (usually stays on a day or 2 then goes off for a varied amount of time). When I took it to Autozone to pull the code it showed bank 1 O2 sensor bad. With the light going on and off like it is, would it really be the O2 sensor? or could it be something else making the O2 sensor code to report? Could the O2 sensor be the problem with the rough cold starts? Thx for your time  

Answer
The idle vibration could be caused by a collapsed motor mount, normally the one on the front of the engine causes this.
I'm not entirely sure whether the engine has a misfire or not from how you are describing the vibration, a vibration can be felt in the steering wheel and the entire car and it's frequency is much higher than an engine misfire, a misfire can trigger an O2 sensor failure code, you need to find out if the engine has a misfire before replacing the O2 sensor.