On the eve of what the President calls one of his most difficult decision days only a half-dozen or so people knew which way Jimmy Carter was going to go on the controversial B-1 bomber.

And even as he went on national TV in mid-morning to announce his decision, leaders in the House, including Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.), had not been informed about what action the President was taking.

Carter's decision came with stunning surprise in a capital that thought it had divined the answer, and was wrong. His decision to discontinue production of the $100 million plane was one that cut across the most sensitive political nerve ends of Washington - from peace and environmental lobbyists and arms contractors, Pentagon civilian planners and generals, to Capitol Hill liberals and conservatives.

Reaction was swift, and predictably strongly divided. The range went from the charge of "rank amateurism" by Republican leaders to praise for "courage" in "a historic event" from Sen. George McGovern (D-S.D.) of the often-critical Democratic left wing.

The key to Carter's decision remains somewhat murky. One of the most confusing aspects has to do with a House vote Tuesday to go ahead with the production of five of the big bombers. That vote, in turn, had been taken as a sign that Carter had changed his mind from his presidential campaign days after experiencing the realities of the White House.

House Appropriations Committee Chairman George H. Mahon (D-Tex.) said Tuesday he thought the President was going ahead. When he learned of Carter's decision yesterday, Mahon reacted with a rephrasing of the familiar, the President proposes, but the Congress disposes language.

"The President has the right to make recommendations," he said, "but under the Constitution, Congress has the responsibility for the defense of the country."

A different kind of action had come earlier from another powerful Democrat, Senate Majority Leader Robert C. Byrd (D-W.Va.).

Last weekend Byrd sent Carter a private four-page letter stating his strong opposition to the B-1. His concluding paragraph read:

"With the B-1 we are being asked to gamble a massive amount of public funds - tens of billions of dollars - on the B-1's being effective (and invulnerable) through the 1990s. The investment is simply too great to take that gamble. In the final analysis, it is a question of the best allocation of our resources. Spending $100 billion or more on the B-1 in the years ahead is not the best use of public funds. There are less expensive and more credible military alternatives and many unmet domestic needs for which the money would be better spent."

What weight Bryd's letter carried is not known at this writing.

It is known, though, that Carter relied more heavily on one person - his Defense Secretary, Harold Brown. The President and Brown conferred dozens of times about the B-1.

Some six weeks ago Brown sent Carter a series of papers with options he called "militarily sustainable." These included building the B-1: arming the present B-52 bomber fleet with cruise missiles, and converting civilian transports like the Boeing 747 to cruise missile launchers.

On June 1, the President received a package of graphs and charts and Pentagon analyses marked "secret" and "eyes only." These Defense Department papers made the rounds of Carter's White House, from his national security office, headed by Zbigniew Brzezinski, to his budget office, headed by Bert Lance.

For the President, the last three weeks were the most intensive times of study. Twice, he left his Oval office in mid-afternoon to devote full time to assessing the B-1 issue. Last weekend he devoted more review and thought to the issue while at his presidential retreat at Camp David.

On Monday he informed Brown that he was not leaning toward production of the bomber, Brown returned to the Pentagon. On Wednesday he delivered the essence of the positions outlined by the President at his news conference yesterday. In the meantime, Brown had commissioned an in-house study of his own. The conclusion: B-52s with cruise missiles would be good enough for the 1980s.

By midweek only a few others knew of the President's decision. These included Vice President Mondale and Carter's two key aides, Hamilton Jordan and Jody Powell.

Once announced, the decision began drawing a drumfire of praise and criticism. Of all the words uttered, perhaps the strongest were those of Rep. Robert K. Dornan (R-Calif.).

"They're breaking open the vodka bottles in Moscow," he said.

Dornan had other reasons to speak passionately. He represents the district where Rockwell International's B-1 division is located.