(CNN) -- Senate leaders on Wednesday worked out a deal to reopen the government and avoid a potential U.S. default as soon as midnight, sources told CNN's Dana Bash and Ted Barrett.
Formal announcement of the agreement will come at 12 noon ET on the Senate floor, a Republican Senate aide told Bash.
Republican leaders convened the Senate's full GOP caucus in the morning, and Sen. Kelly Ayotte of New Hampshire said on her way in that the announcement would be coming.
"I understand that they've come to an agreement but I'm going to let the leader announce that," Ayotte said.
Exact details of the Senate plan were not known. Nor was it clear how the Senate and House would proceed in considering the measure.
Both chambers would have to take special steps to get the legislation passed and to President Barack Obama's desk before the government's ability to borrow money expires on Thursday.
Legislators dropped hints on their way home on Tuesday that Senate Majority Leader Harry Reid and his Republican counterpart, Mitch McConnell, would quickly finalize an agreement in the works all week.
U.S. stocks opened sharply higher on expectations Washington would end its partisan fiscal impasse. The benchmark Dow Jones Industrial Average jumped 200 points.
According to sources, the Senate deal under discussion would reopen the government, funding it until January 15. It would also raise the debt limit until February 7 to avert a possible default on U.S. debt obligations for the first time.
It also would set up budget negotiations between the House and Senate for a long-term spending plan, and would include a provision to strengthen verification measures for people seeking government subsidies under Obama's signature health care reforms.
The focus shifted to the Senate after House Republicans failed on Tuesday to come up with a plan their majority could support, stymied again by demands from tea party conservatives for outcomes unacceptable to Obama and Senate Democrats, as well as some fellow Republicans.
It remained unclear if the congressional tea party wing led by Sen. Ted Cruz of Texas would continue efforts to force its demands into a congressional deal, perhaps by trying to filibuster or otherwise delay Senate action.
"It's up to him. I would hope he wouldn't," Ayotte, who represents New Hampshire, told CNN's "New Day." "Senators can cause to you run out the clock, but what's he trying to gain at this point? I would hope that whatever comes forward, that we would allow a vote on it as soon as possible."
Cruz, despite being in the Senate, is credited with spearheading the House Republican effort to attach amendments that would dismantle or defund the health care reforms known as Obamacare to previous proposals intended to end the shutdown.
All were rejected by the Democratic-led Senate, and Obama also pledged to veto them, meaning there was no chance they ever would have succeeded.
Ayotte called the tactic of tying Obamacare to the shutdown legislation "an ill-conceived strategy from the beginning, not a winning strategy."
However, Republican Rep. Steve King of Iowa advocated continued brinksmanship to try to change Obamacare, which conservatives detest as a big-government overreach.
"If we're not willing to take a stand now, then when will we take this stand?" he told CNN's "New Day," adding that if "the conservative Republican plan had been implemented five years ago, say at the inception of what is now the Obama presidency, we would have far less debt and deficit."
Despite warnings by Obama and economists that a U.S. default would spike interest rates and could have catastrophic impacts at home and abroad, King said he's not too concerned if the government passes Thursday's deadline to raise the borrowing limit.
"It's just a date they picked on the calendar," he said, adding that the government will still be able to pay the interest on its debt. "I'm more concerned about market reaction than I am of default itself."
Thursday marks the day the Treasury Department will run out of special accounting maneuvers to keep the nation under the legal borrowing limit. From that point on, it will have to pay the country's incoming bills and other legal obligations with an estimated $30 billion in cash, plus whatever daily revenue comes in.
The expectation is that the Treasury will be able to pay bills in full for a short time after Thursday, but exactly how long remains unclear. According to the best outside estimates, the first day the government will run short of cash could come between October 22 and November 1.
Officials warn that an unknown is whether creditors such as foreign countries that traditionally roll over their U.S. bond holdings could decide to instead cash out, creating a potentially major payout that the government would lack funds to fulfill.
A top GOP Senate aide said Wednesday that leaders in that chamber remain "optimistic an agreement can be reached," the same tone sounded Tuesday after lawmakers called it a night around 10 p.m. Senate staffers burned midnight oil to draft a framework bill.
A break from tradition
If the Senate passes an agreement, House Speaker John Boehner will probably face the decision of whether to allow a vote that he knows can only pass with virtually all Democrats and only a few of his fellow Republicans supporting it.
That would break a Republican tradition known as the Hastert rule. The informal tenet, named after former House Speaker Dennis Hastert, says that the House speaker does not introduce legislation unless a majority of Republicans say they will vote for it first.
It has served to keep proposals off the floor, even if they have the prospect of passing via the votes of Democrats combined with those of some moderate Republicans.
House Republicans have expected Boehner to uphold the rule, which asserts the party's interests in the chamber, and he has pledged to do so. However, Boehner has previously allowed votes on measures lacking full Republican support at times of similar brinksmanship, such as the fiscal cliff negotiations in late December and early January that raised tax rates on wealth Americans.
"I believe that John Boehner will likely be in a position, where he will have to essentially pass the bill that is negotiated between Sens. McConnell and Reid," said Republican Rep. Charlie Dent of Pennsylvania, who added that he would vote for the Senate plan.
About 20 Republicans would have to back the Senate plan for it to pass, assuming that virtually all of the chamber's 200 Democrats also would support it.
Even so, it could take a day or two more for a deal to make it through the legislative process. By then, the nation will have run out of borrowing authority.
While tax revenues will continue to stream in, that money will be enough to pay only part of the government's obligations over time. The impact is unclear in the immediate short term, but over days and weeks, it would mean that government officials would have to pick and choose which bills to pay and which to leave for another day.
The prospect of the U.S. government running out of money to pay its bills and, eventually, finding it difficult to make payments on the debt itself, has economists around the world prophesying dire consequences.
Mutual funds, which are not allowed to hold defaulted securities, may have to dump masses of U.S. treasuries.
Ratings agency Fitch fired a warning shot Tuesday that it may downgrade the country's AAA credit rating to AA+ over the political brinksmanship and bickering in Washington that have brought the government to this point.
That could help raise interest rates on U.S. debt, putting the country deeper into the red.
Rating agency Standard & Poor's cut the U.S. credit rating from AAA to AA+ after the 2011 debt ceiling crisis. Moody's still has the U.S. rated AAA.
Investors around the world appeared to be sitting on the sidelines Wednesday waiting out the day's debate.
Asian markets ended with mixed results, European markets were down slightly Friday afternoon and U.S. stock futures -- frequently taken as an indicator for how U.S. markets will open -- were up marginally before trading began Wednesday.
Some scholars have suggested that the 14th Amendment to the Constitution gives Obama an emergency brake to stop the default by ignoring what Congress does and borrowing in spite of having reached the debt ceiling.
Section 4 of the amendment states: "The validity of the public debt of the United States, authorized by law, including debts incurred for payment of pensions and bounties for services in suppressing insurrection or rebellion, shall not be questioned."
Obama has rejected such claims, the Congressional Research Service has said. And other scholars say that by invoking the 14th Amendment in this way, the President would risk breaking other laws.
But the same scholars who say this say they believe that section 4 was formulated to keep politicians from holding the debt hostage in order to impose their political will on the natio
Disarray among House Republicans caused confusion on Tuesday, with Boehner having to pull a proposed agreement from the floor because conservatives found it too weak.
The House proposal dropped some provisions on Obamacare but prohibited federal subsidies to the President and his administration officials as well as federal lawmakers and their staff receiving health insurance through the Affordable Care Act programs.
It also would have forbidden the Treasury from taking what it calls extraordinary measures to prevent the federal government from defaulting as cash runs low, in effect requiring hard deadlines to extend the federal debt ceiling.
House Democrats opposed the GOP proposal, which meant it couldn't pass without support from the 40 or so tea party conservatives, who wanted more spending cuts.
"It just kicks the can down the road another six weeks or two months," said Rep. Joe Barton, R-Texas.
Time running out
Obama will meet Wednesday with Treasury Secretary Jack Lew, who has been looking for creative ways to cover U.S. financial obligations as the debt ceiling comes down.
On Tuesday, Obama called for House Republicans to "do what's right" by reopening government and ensuring the United States can pay its bills. "We don't have a lot of time," he said.
But he acknowledged Boehner's difficulty in getting his fellow House Republicans on the same page.
"Negotiating with me isn't necessarily good for the extreme faction in his caucus," Obama said, referring to the tea party and its conservative allies. "It weakens him, so there have been repeated situations where we have agreements. Then he goes back, and it turns out that he can't control his caucus."