There's not many pests you will need to deal with when growing mushrooms. But there are 2 nasty bugs to look out for, especially if you grow them outside.
There are only two main mushroom pests that will wreak havoc on your mushrooms. The Phorid fly and the Sciarid Fly (aka fungus gnat). Both of these flies will lay eggs in the holes of the bags. After the eggs hatch, the larvae roam inside the substrate and quickly devour the mycelium inside. Eventually eating through the stem of the mushroom they emerge as flying adults via tiny pinprick looking holes, out the top.
What to look for
1. The phorid fly
looks similar to a fruit fly or sandfly. It is often seen around the soil of damp pot plants. Its larvae are tiny white wiggling maggots, Sometimes they are hard to see without a magnifying glass. More info en.wikipedia.org/wiki/Phoridae
2. The scarid fly
Has long legs and a slender body so looks more like a mosquito. Its maggots are much larger so generally easier to spot. They are white, plump and often with a blackhead.
If you have the bags inside, these pests are not usually a problem unless you have pot plants already infested, or a problem in the garden outside the window. If you are growing outside you have a high chance of meeting them. More info en.wikipedia.org/wiki/Sciaridae
Signs: How to tell if you have them
You may notice the larvae crawling out of the mushrooms after harvest (or inside the bag near the holes). If you put the harvested mushrooms inside a plastic container and in the fridge, the cold will usually drive them out and you will see them in the container.
You may see what looks like pinpricks on the cap. This is where the adult fly has emerged.
The stem of the mushroom will be weak and crumbly (as they tunnel through). The stem may be so weakened that the mushrooms will just fall off and look rotten.
If badly infected (older bag) you may notice the otherwise healthy white mycelium become thin and patchy, signs that it has been eaten.
If slugs the caps will look like something's been eating them
What should I do if I see them?
We use yellow sticky fly traps that you can buy from garden centres or hardware stores. These will catch the adult flies, breaking their breeding cycle. The traps are useful, and they provide a good indicator of having a problem or how big the problem is. If you are inclined to use sprays, use organic ones containing Pyrethrum. These are more for management before you have a problem, as they may not cure a massive infestation.
Before cooking the mushrooms, soak them for a while in a bowl of salty water, this will encourage the little fellas to wriggle on out.
What if I accidentally eat them?
Firstly, don't panic, they may look gross but are not harmful... to us at least. They have happily been munching on a diet of mushrooms inside an essentially sterile environment. They are very common inside wild foraged mushrooms. In the future, they may even end up on the plate as a form of future protein.
Less of a problem, unless it's growing outside, are snails and slugs. They seem to seek out mushrooms and devour entire clusters overnight.
Note: Although it is still possible, I have not seen any evidence of rodents, chooks/ducks (or our little pig) showing any interest in eating our mushrooms.