Say you put a credit spread on but the option buyer decides to exercise their option early. What does the broker do, will they also auto close the other side of the spread trade or do you have to do that yourself? What if there is a time difference say I couldn't get to my screen to do that until later in the day ..
...so you'd end up short[long] 100 shares (assuming an equity call[put] spread) and long 1 call[put].
Typically when you are assigned early on one leg of a spread, it is not necessarily a bad thing. Your long options will cover your risk. If this happens on the call side just before the stock goes ex dividend, you will owe the dividend and if the stock is hard to borrow you may owe hard to borrow fees until you cover. If you have the money to cover the margin for your new stock position and its not one of the above situations, all is good. If you don't have the money, the broker will issue a margin call and may liquidate the entire position. Best to talk to them early morning after the exercise. You don't want them to just cover part of the position, you would want to take off your stock position and your option position at the same time to reduce your risk. They may allow you to do this yourself.