Car has about 185K on it and pulls a P0138 code every time it rains. Sometimes it even happens if it's very damp. I'm thinking maybe there is a short but I'm curious if this is common on this model or similar Toyotas.
Update and resolve: A new downstream O2 sensor fixed the problem.
There's quite a few things that might cause that.
Being that rain / dampness cause the code to pop up. Check the oxygen sensor connection. Disconnect it, look for broken parts and corrosion. Spray a water displacement on it (electrical cleanser, WD40, etc. Make sure it's tight going back together.
Go "upstream" through the wiring, check for damage, wires that might be burnt from hot exhaust. Think, have you ran over anything sometime before this started.
If that all fails, you can try a new oxygen sensor.
If everything checks out and new sensor doesn't solve the issue either. Then could be main computer. That you would want verified by a knowledgeable mechanic as they are expensive.