It can happen anytime. But usually the attoney will have a chance to face the DA on the pre-trial day, it's likely you will get it on that day.
There will be a plea bargain, but the negotiation is the hard part.
It's always good to talk with the attorney ahead of time about the potential bargains you could get and the strategy to negotiate it, and what is your bottom line. BTW, you also need immigration lawyer when it comes to the bottom line.