WASHINGTON — Days after he was appointed special counsel, Robert S. Mueller III visited the Capitol to meet with members of the Senate Judiciary Committee, which was conducting its own Russia investigation and needed to coordinate with his. Senator Charles E. Grassley, Republican of Iowa and the committee’s chairman, came with a wisecrack.

You did well keeping the country safe as F.B.I. director, he told Mr. Mueller at the end of the meeting, a senator in the room recalled. But you never answered mail from us, Mr. Grassley said of a Congress that conducts much of its business on paper.

Mr. Mueller laughed. Just keep sending those letters, he replied.

The lighthearted exchange hinted at a tension that has made Mr. Mueller a reluctant witness for two highly anticipated House hearings on the Russia investigation on Wednesday. Over decades of appearances before Congress, Mr. Mueller showed little patience for politics, and he grew weary of the partisanship that came with legislative oversight, according to interviews with former colleagues, law enforcement officials and lawmakers.

[Update: 19 questions we have for Mueller ahead of his testimony before Congress.]

A review of dozens of hours of his hearings — Mr. Mueller has appeared before Congress 88 times dating back to 1990, according to the Senate Historical Office, among the most of any official ever — offers insight into what kind of witness he will be this week. He was by turns forbidding and protective of the F.B.I.’s mission, yet sympathetic to Congress’s obligation to monitor the bureau’s transformation from a crime-fighting agency into a centerpiece of the government’s post-Sept. 11 counterterrorism apparatus.