Agent window opens on startup when it's turned off

There are many ongoing threads about this. I suggest we consolidate them into the following!