IF THERE IS a God of politics, He's not a very Agreeable Fellow. Just ask Jimmy Carter. Almost exactly one year ago, as an ungrateful nation sat in the sweltering fumes of an apparently endless gas line and listened to itself being harangued about some weird affliction called "malaise," the political betting was that if Teddy Kennedy got into the Democratic race, it would all be over for Jimmy Carter. Well, he did and it wasn't. In fact, the big political event of this past year was probably the trouncing of Sen. Kennedy in the primaries and the deflation of the durable myth of his invincibility as a candidate any time he chose to run. But Mr. Carter, typicaly, emerges from this important and unexpected triumph in rather worse political condition than when he went in. Life isn't fair -- as he himself, memorably, once said.

But there is more. Here is a president daily getting a rap for being "too political" whose campaign at the moment resembles a disaster area, a man simultaneously perceived as being 1) a devilishly clever and cynical political conniver in office who minutely calibrates all his official acts to the partisan needs of getting reelected, and 2) a hopeless klunk at making anything happen or even knowing what is going on. And -- yes -- there is more yet. Because Sen. Kennedy won't get out, but insists on organizing a challenge at the convention, Jimmy Carter has now become unexpectedly vulnerable to claims and pressures of the politically extortionate kind.

Some Democratic mayors who supported Mr. Carter against Ted Kennedy, for example, are now developing pre-convention "doubts" that they need to have assuaged by administration grants and offerings to their cities. But just as the continuing Kennedy campaign has helped to put the president in this bind, so it will profit from whatever his response is: if the president declines to yield to the mayors' supplications, it will be received as yet another hardhearted failure of (get out your violins) liberalism. If, on the other hand, he accedes to the pressures and authorizes some additional aid to the cities, it will of course be taken as prima facie evidence of his cynical use of White House power and goodies to buy the office.

Is there no justice? The answer, of course, where political things are concerned, is no. So the first thing to do about Jimmy Carter is not to feel sorry for him. After all, it is in the nature of politics, first, that there are no innocent victims; and, second, every misfortune is also an opportunity for the politician with the audacity and strength to seize it. Jimmy Carter, so far, has made quite a hash of the burden of running against Sen. Kennedy on the left and former governor Reagan on the right at the same time. Much of his government's spasmodic approach to budget making, -slashing and -revising has reflected this; and so does the present turmoil and confusion as the president and his people decide how much to propitiate the Kennedy forces at the convention and how much to try to preempt the Reagan arguments. The Kennedy people are urging him to reaffirm as party dogma not just the better aspects of Democratic liberalism but also those outdated and properly discredited elements of it that have helped to create the Reagan strength. Mr. Carter would be as ill advised to do this as he would be to try to come on in fact as the Reagan "clone" that Sen. Kennedy has already charged him with being.

A really good -- and wise -- politician would see the Kennedy-Reagan vise as an opportunity: a heavensent, ready-made political "middle" to command, and, taking up his station there, he would resist chasing off in either direction or both at once every time he was assaulted. Can Jimmy Carter do this? Can he -- after three bobbly years -- create and assert a plausible and strong and attractive political and programmatic identity of his own -- stick with it? The way in which his administration responds to the squalors of the me-first tax cut competition will be one test, and a large one. So will be response to the inevitble demands that he back off various well-taken policy stands in order to pick up the allegiance of this interest group and that. Actually, he can't win by scavenging or scrounging n this classical manner. What he needs politically above all to prevail now is to persuade voters that there is a solid, sensible presidential persona there -- a presence, a reality, a leader, something that lasts.

The Carter people's luck has run out. So has the president's margin for inconstacy and foul-up. But his opportunity hasn't. It's the Last Chance Cafe.This will be the summer that tells all.