The government technically ran out of money this morning as Congress failed to enact a stopgap funding bill for the new fiscal year, which began at midnight.

But government workers were told to come to work anyway, on the theory that an acceptable spending bill would be sent to the president sometime today.

House-Senate conferees reached agreement last night on a resolution to keep the government in business through Dec. 17 -- long enough for Congress to go home for the election, then return to work on the regular appropriations bills for goverment agencies, only one of which it has passed so far.

In theory, the government cannot legally operate without the continuing resolution that has not been passed. Last year the government did shut down for a day, at considerable cost, because the president and Congress were arguing over the terms of such a resolution.

But this year they seem in agreement, and "the general rule of thumb is that folks should come into work and receive their instructions there," said Pat Korten, spokesman for the Office of Personnel Management. The instructions, he acknowledged, might be to go through the motions of "tidying up their desks" and closing out whatever work remains. "But if the House and Senate are in session and it looks like a vote is close, you can be sure we're going to drag our heels on sending people home."

The continuing resolution would preserve the current pay cap for senior federal employes.

The conferees also agreed to:

* Let the Pentagon spend at an annual rate of $228.7 billion, a compromise in what was the thorniest item on the conference agenda. That is considerably more than the 1982 level of $205 billion provided for in the House bill, and somewhat less than the $233.4 million the Senate wanted to spend. The Senate had already cut Reagan's request by $8.7 billion.

* Postpone procurement funds for the MX missile, for which the administration has yet to decide on a basing mode, and for one of two nuclear carriers.

A last-minute telephone call from Secretary of Defense Caspar W. Weinberger to Sen. Ted Stevens (R-Alaska), pleading for the nuclear carrier funding, nearly derailed the agreement on defense. However, after an impassioned plea, Stevens acceded to House members' insistence that the carrier be delayed until the House Appropriations Committee could consider the issue in December.

* Accept the House figure of $9.78 billion for foreign aid, continuing funding at 1982 levels, including a level of aid for Israel that gives $50 million more in direct grants than Reagan has requested for 1983.

* Fund the Labor, Education and Health and Human Services departments generally at 1982 levels, dropping Senate amendments to increase funds for jobs for the elderly from $277 million to $296 million and to increase vocational education money by $50 million.

* Amend language in a Senate provision to prohibit Legal Services Corp. funds from being spent to represent aliens, to lobby members of Congress, or to defend class-action suits. The new version, however, was unavailable last night as the appropriations subcommittee staff met to draft the final language.

While the House had reported a generally "clean" version of the bill, maintaining 1982 spending levels and turning aside efforts to attach special interest amendments, the Senate added about 100 amendments to its version.

Senate conference chairman Mark O. Hatfield (D-Ore.) told conferees he had "dropped" 50 amendments on his way through the Rotunda to the cramped appropriations meeting room on the House side of the Capitol.

"I admit we probably added a lot of garbage in it," he said.

Nonetheless, working not only towards the midnight deadline of the fiscal new year, but with an eye towards finishing before the Democrats' annual fund-raising dinner and a White House barbecue last night, the House conferees accepted many of the Senate's decorative additions.

For example, they agreed to:

* Spend $190,000 for a Native Hawaiians Study Commission.

Exempt the import of steam from customs duty -- thus saving a Maine pulp and paper manufacturer, Fraser Inc., from paying $1 million in duties for piping steam from Canada to the United States.

* Permit the government to spend up to $85 million for stockpiling copper, a compromise between senators from copper-producing states who wanted to mandate the purchase, and the House, which opposed earmarking funds for copper.

When several senators argued that the stockpiling was needed to save the ailing copper industry, Rep. Sidney R. Yates (D-Ill.) countered, "Why not buy $60 million worth of automobiles?"

The conferees also accepted a Senate amendment to authorize the secretary of the treasury to regulate the import of steel mill products in order to strengthen the administration's hand in negotiating anti-dumping agreements with European nations. House conferees had opposed such amendments, arguing that they amounted to legislating in an appropriations bill, but the steel caucus, which includes members of Congress from steel-producing states, lobbied for the anti-dumping provision.

Both the steel amendment and a Senate amendment to restrict the import of coffee from certain nations -- a provision consumers argue would raise the price of coffee -- were opposed by the House Ways and Means Committee. Conferees agreed to extend the coffee import restrictions only until Dec. 17, when the bill expires.