I think 4 months perfectly ok. This was about 5 months after I got my GC I went back to the country where I came from, and I stayed about 5 and half months there. When I come back the immigration officer Chinese looking lady asked me why I stayed this long. I said I had some private work. she did not like my answer and threatened me if she wants, she can get my green card back and sent me back if she wants. And more she told me if I want to stay in USA stay here and if you want to stay in Sri Lanka stay there and don't come back.
She can say that and get my green card coz at that time I didn't had much ties to the USA. But since you are her husband living in USA, I think they cant turn her back. Coz after the above incident I stayed about 1 year developed my ties with USA and went back to Sri Lanka and stayed there about 4 months every year (just to pass the winter season in USA) and I had no issues no questions asked by anyone.