'Silicon Valley' season 4 episode 4 spoilers: Richard tries to work with Gavin; Gilfoyle worries about Dinesh's new relationship

Promotional image for "Silicon Valley" season 4.Facebook/siliconHBO

Erlich (T.J. Miller) takes matters into his own hands in the upcoming episode of "Silicon Valley" season 4.

Titled "Teambuilding Exercise," next week's episode will see Richard (Thomas Middleditch) figure out a way to work with Gavin (Matt Ross).  According to the official synopsis, Jared (Zach Woods) begins to worry about the company's future when Richard reaches out to an unlikely ally. Worried about Jian-Yang's (Jimmy O. Yang) commitment to the development of his app, Erlich decides to take action and get things done on his own. Meanwhile, Dinesh's (Kumail Nanjiani) latest dalliance forces Gilfoyle (Martin Starr) to be stricter when it comes to security. He later thinks about putting his pride aside for a new job.

HBO has released a new sneak peek for the episode. It opens with Richard having a conversation with Gavin. Richard is forced to work with his archenemy after learning that he owns the patent for a project he wants to pursue. "It's a license, so if you just sign there by the Post-it note, then you will never see me again," Richard tells Gavin. "Are you joking?" the latter responds.

Richard tells Jared about his encounter with his enemy, and he seems to be very supportive of his friend. Jared goes on to tell Richard that he is willing to do anything just to keep Gavin out of their project.

Cartermatt notes that Jared is determined to help Richard because he does not like the idea of working with Gavin. Gilfoyle is aware that Dinesh's new girlfriend is a skilled hacker, so he is concerned that their relationship might affect their project. Dinesh is a compulsive liar and if his relationship goes wrong, there is a huge chance that his girlfriend will get revenge by using her hacking expertise.

The fourth season of "Silicon Valley" airs every Sunday at 10 p.m. EDT on HBO.