This post discusses the May 28 episode of “Silicon Valley,” “Customer Service,” in detail.

Right before I sat down to watch this episode of “Silicon Valley” on Thursday, the news broke that T.J. Miller, who has played the stoned, grandiose incubator operator on the series for four years, wouldn’t be returning for its fifth season. This strikes me as a shame: Erlich is a great character, a man of Rabelaisian excess and Quixote-like self-delusion, a man clad in sandals and cargo pants who, despite it all, regularly hits genuinely poignant notes. Erlich drives me nuts, just as he regularly makes the occupants of his incubator absolutely batty, but I also can’t imagine the show without him. And given Gavin Belson’s (Matt Ross) spirit quest, if he doesn’t return to the show either, “Silicon Valley” is going to be down two of its best sources of prickly tension.

All of this is, I suppose, a long way of saying I was grateful for this Erlich-centric episode of “Silicon Valley,” which was also a relatively strong episode after a couple of weeks of developments that seemed as though they were undoing some of the more promising set-ups from the early season.

And “Customer Service” hit all the best Erlich-y notes. I giggled through his attempts at adopting “an adage!” and his grumbling about not being “allowed to have a seizure” as part of a sales pitch. Miller’s ability to make Erlich ridiculous without rendering him utterly intolerable or pathetic has always been an impressive bit of comedic balancing. When it became clear to him that, despite his claim to have “tons of lots of things” going on, he was actually bored out of his mind, I absolutely howled through his pitch to Laurie Bream (Suzanne Cryer) and Monica Hall (Amanda Crew) that they should take him on as an associate.

“I’m saying I very much respect what you’re doing here, almost revere it. I wanted to offer my services as an associate, and I will not phone it in,” Erlich declared. “I’ll be the first one here at 10:30 a.m., and the last one to leave a smidge after 4. I’ll of course need an office, an attractive personal assistant, paternity leave if that goes well, and an umbrella insurance policy if that does not go well. What do you say? I’d like a job, dears.”

His utter conviction that this was a reasonable proposition sold the speech in a way no other actor could have done. And the fact that, in his dejection and day-old muffins, Erlich’s cranky defiance won him the respect of virtual reality innovator Keenan Feldspar (Haley Joel Osment, who is making a little career for himself playing this sort of disheveled bro), was a delightful twist. This is Silicon Valley we’re talking about, after all. It belongs to the weirdos, as Richard (Thomas Middleditch) argued last week, and the delusionally bold.

Elsewhere in this episode, I appreciated how “Silicon Valley” managed to turn Richard’s pitch to Erlich’s old enemy, Dan Melcher (Jake Broder) from a cliche into a surprise. At every step of the way, this plot took a different turn than it might have on another show. It was Richard, not Erlich, who ended up sleeping with Dan’s fiancée. Rather than breaking the couple up, the fact that Richard was bad in bed actually brought them closer together. And rather than scotching the deal, that one-night stand was the thing that cemented it. The plot was perfectly calibrated to put Richard, who is at his most amusing when he’s anxious, through the wringer without actually ruining the prospects for his new company.

I will say that at this point in the series’ run, I’m wondering how long it makes sense for “Silicon Valley” to last. The show has a flexible premise: There’s no reason it wouldn’t take Richard a long time to achieve genuine, breakout success, and there would be plenty of material for the series to explore if and when he actually gets there. But with Miller’s impending departure and the way the show set up and then backed away from some interesting themes this weekend, I wonder whether it might be smart for series creators Mike Judge and Alec Berg to think about designing an endgame. I’ll miss “Silicon Valley” when it’s gone, but I also don’t want to have the sad experience of seeing it become attenuated, either.