Virginia Gov.-elect Ralph Northam, left, and Gov. Terry McAuliffe detail their legislative agenda at the Capitol in Richmond. “We have a unique opportunity to work in a bipartisan way and do some great things for the commonwealth of Virginia,” said Northam. (Steve Helber/AP)

Virginia’s General Assembly gavels into session Wednesday with Republicans virtually assured of holding on to power in both chambers by the slimmest majorities and a new Democratic governor waiting in the wings.

All eyes will be on the House of Delegates for any last-minute machinations, with Democrats still contesting Republican victories in two races, disputes that could upend the GOP’s 51-to-49 majority.

On Tuesday, Democrats and Republicans were seeking to hash out a deal that would make for a smooth opening day, but nothing had been worked out by early evening. Even barring a last-minute agreement, Republicans seemed certain to get Del. M. Kirkland Cox (R-Colonial Heights) installed as speaker.

Cox, a retired government teacher who has served in the House since 1990, will succeed Speaker William J. Howell (R-Stafford), who announced last year that he would not seek reelection after 30 years, 15 as speaker.

Republicans crowned Cox speaker-in-waiting nearly a year ago, lauding him as a hands-on fiscal and social conservative with a pragmatic streak. The move was meant to unify the party heading into the 2017 elections.

But Cox’s ascent was nearly derailed by a blue wave in November that was widely seen as a reaction to President Trump. As they won statewide races for governor, lieutenant governor and attorney general, Democrats also picked up 15 House seats, nearly erasing the GOP’s 63-to-34 majority.

Legislators started returning to Richmond on Tuesday after weeks of headline-grabbing upheaval over the two disputed House elections, one of them a tie decided last week when the winner’s name was drawn from a bowl. The two contested Republican victors are expected to be seated Wednesday unless the Democrat who lost the drawing asks for a recount before lawmakers are sworn in.

Even if that race remains in limbo, Republicans would have a 50-to-49 majority on opening day.

Delegates and senators will reconvene just days before the governorship passes from one Democrat to another, from Gov. Terry McAuliffe to Lt. Gov. Ralph Northam. Temporary bleachers installed outside the Capitol for Saturday’s inauguration stood as can’t-miss proof of the pending transfer of power.

In a joint news conference in the governor’s ceremonial Capitol office Tuesday, McAuliffe and Northam unveiled bills they would like to see passed by the House and Senate. The upper chamber was not up for election in November; Republicans have a 21-to-19 advantage there.

The outgoing and incoming governors called for Medicaid expansion, universal background checks for gun purchases, early voting, a carbon-reduction program, a ban on the personal use of campaign funds, a “borrowers’ bill of rights” for student loans, a rollback of certain abortion restrictions and criminal justice changes that would boost the felony-theft threshold from $200 — tied with New Jersey for the nation’s lowest — to $1,000.

McAuliffe, a longtime fundraiser for Bill and Hillary Clinton before running for governor, struck a partisan tone. While noting that the Republican-led General Assembly had cooperated with him on economic development, transportation and education, he highlighted his role as a “brick wall” against conservative social legislation, touting the state record he set for gubernatorial vetoes.

“We did have a few vetoes over the course of the last four years, 120 to be exact, to make sure that we will not tolerate any prejudice against women, discrimination against LGBT members, hurt our environment or roll back voting rights,” he said.

Northam, a pediatric neurologist and moderate Democrat who represented Virginia’s rural Eastern Shore in the state Senate, hit a more conciliatory note. He called the plans “a start” and said he would “look forward to a good debate” with the legislature. He elaborated on some of the plans in ways that could appeal to Republicans, noting that a Medicaid expansion could help address the opioid crisis and give a financial boost to rural hospitals.

“As you know, we have a very tight makeup in both the House and the Senate, so I believe in Virginia we have a unique opportunity to work in a bipartisan way and do some great things for the commonwealth of Virginia,” said Northam, who for the first three days of the session will preside over the Senate in his role as outgoing lieutenant governor. He will yield the gavel to Lt. Gov.-elect Justin Fairfax (D) after their swearings-in Saturday.

At the same time, Northam noted that hefty Democratic gains in the House and his own nine-point win over Republican Ed Gillespie give his party a popular mandate.

“These are issues that we ran on in 2017, and as you all know, on the seventh of November, Virginia spoke,” he said.

Cox is trying to rebrand in the Trump era and amid a decade-long statewide GOP losing streak by playing up “kitchen table issues,” such as a measure to recognize out-of-state teaching licenses for the spouses of military personnel stationed in Virginia. He’s spoken out against sexual harassment and backed plans to offer generous paid parental leave for state employees.

Among the 1,200 bills filed so far, there is a notable dearth of hot-button social legislation from Republicans. Not a single antiabortion bill had been filed as of late Tuesday.

“Over the coming weeks we will continue to roll out a robust agenda to help better the lives of the people we serve,” said Cox spokesman Parker Slaybaugh.

Democrats, eager to capi­tal­ize on their wins, have bills that would raise the minimum wage; strip the now-defunct ban on same-sex marriage from the state constitution and code; and require private insurance plans to cover abortions in cases of rape, incest or when the pregnancy threatens the life of the mother. (Religious employers would be exempt.)

Republican David E. Yancey (R-Newport News), who won one of the contested House races, is expected to be sworn in when the legislature convenes. A judicial panel determined that his race in the 94th District against Democrat Shelly Simonds was a tie, which was broken in Yancey’s favor last week by a lottery. Simonds was still considering whether to request a second recount. She has until Jan. 16 to decide.

Cox has said that, historically, a delegate would not be seated while a recount was underway. The comment left the door open to seating Yancey if Simonds did not request the recount before the start of the session, even if state law affords Simonds more time to make a decision.

“He has a certificate, so I intend to seat and swear him in tomorrow,” said House Clerk G. Paul Nardo, referring to the State Board of Elections’ certification of Yancey’s win.

In the other contest, in House District 28, 147 voters were given the wrong ballots in a race won by 73 votes. Voters who said they were denied the chance to cast ballots for Democrat Joshua Cole sued and asked a federal appeals court to unseat Republican Robert Thomas. Barring last-minute action from the court, Thomas is expected to be seated Wednesday.