House Majority Leader Eric Cantor (R-Va.) gives his concession speech after a shocking upset to tea party favorite David Brat. (NBC 12 Richmond)

Midnight had long since passed, but the lights were still on at the Capitol, where House Republicans were already planning — and tensely arguing about — how to move ahead amid the chaos of House Majority Leader Eric Cantor’s stunning primary loss.

The most immediate question is whether a humbled Cantor will step down from his powerful post or try to hold on to it for the remainder of the year. That decision will determine whether there will be a potentially divisive leadership race in the coming weeks or whether that will be postponed until after the midterm elections.

In the immediate aftermath of Cantor’s defeat, camps inside the GOP were divided, with some Cantor allies urging him to stay on and help guide the party until November, while many of his critics privately warned that if he does not resign from his post they will promptly move against him.

Associates of House Speaker John A. Boehner (R-Ohio) said they were telling him to quickly declare that he will stay in his position for another term and that he would like Cantor to stay on as majority leader through the end of the year, making the argument that unity and stability are critical for a House GOP in crisis.

Others close to Boehner predicted that he may say little definitive in the days ahead about his own political future as he waits to hear from House Republicans about how they would like to proceed and whether conservatives, encouraged by professor David Brat’s upset in Virginia’s 7th Congressional District, decide to target him in an effort to elect an entirely new slate of House leaders.

House Speaker John Boehner, left, (R-Ohio), stands with House Majority Leader Eric Cantor (R-Va.) during a news conference at the Capitol June 10, 2014 in Washington. Boehner and Cantor spoke to the media after attending a closed meeting with House Republicans. Later in the day, Cantor lost in a primary election against David Brat. (Mark Wilson/Getty Images)

House Majority Whip Kevin McCarthy (R-Calif.), an easygoing Californian and former recruiter of conservative candidates, is best positioned to take Cantor’s place, regardless of when he leaves. McCarthy has a deep well of support and a light managing style that has won favor with the conference’s younger and more independent members. He was a co-author of “A Pledge to America,” the GOP’s 2010 election manifesto and seen as an able communicator. But his at times rocky experience on the floor, where he has seen some major votes fail after being whipped and some conservatives unhappy with his tactics, has raised questions about his leadership.

One possible rival to McCarthy for majority leader is Rep. Jeb Hensarling (R-Tex.), the chairman of the Financial Services Committee, who is a favorite of tea party activists and known in the House for his clashes with Boehner, Cantor, and McCarthy. On Tuesday, conservative leaders such as L. Brent Bozell III were asking him to consider jumping in to the race for majority leader and possibly challenging Boehner for the speakership. Hensarling, a taciturn operator, does not have an extensive network inside the House but as a former member of the leadership and a committee chair, he has the resume that could win support from hardliners and from some centrists.

Other names being floated include Rep. Jim Jordan (R-Ohio), Rep. Cathy McMorris-Rodgers (R-Wash), and Rep. Pete Sessions (R-Tex.), a former chairman of the National Republican Congressional Committee. Sessions, who has been a political foe of McCarthy in the past — challenging him for the whip position in 2010 — is seen as most eager to take on McCarthy and with many allies of Boehner in his camp, he could be formidable. Jordan, a former chairman of the Republican Study Committee, is seen as a backup conservative favorite only if Hensarling chooses not to run, and McMorris-Rodgers, one of the GOP’s most prominent women, wants to be in the mix.

Rep. Peter Roskam (R-Ill.), currently the chief deputy whip, is a McCarthy ally and is not expected to run against him for majority leader, with his eye being on the whip post, perhaps running with McCarthy or as a McCarthy acolyte. But if McCarthy starts to see his votes slip away, he may decide to not link himself to a whip candidate, perhaps assuring red state conservatives that they will be able to take that slot.

Rep. Paul Ryan (R-Wis.), the budget committee chairman and former vice-presidential nominee, is said to be avoiding the leadership scramble, preferring to focus on his expected move to chair the Ways and Means Committee next year or on a potential 2016 presidential campaign. When reached late Tuesday, sources close to him said any speculation about a leadership run was off-base, although one of his close friends said he will still be pressured to jump in.

For months, the running assumption on Capitol Hill has been that the only leadership race in the House GOP could be for majority whip, should Boehner retire, Cantor ascend, and McCarthy take Cantor’s spot.

Roskam and Rep. Steve Scalise (R-La.) had been quietly talking to colleagues about pursuing the whip job in such a scenario, but other than sporadic hints about their interest, actual campaigning has been nonexistent.

Now they, like the rest of the House caucus, will have to decide what to do when the fallout from Cantor’s loss starts to play out.