Unfortunately, you do have to give away the ending. Like CrazyWriter said, it's hard (feels like you're ruining the surprise of a really cool Christmas gift) but they need to know how it ends. On the plus side, think of it in this fashion. The agent knows the ending, but the surprise isn't completely revealed. They would need to read it to know how you executed the resolution. Sort of like saying, "In an intense skirmish, the Hero overpowers the Villain in a duel." Okay, the agent knows that the good guy won, but he doesn't know the fine print of it until the story is read. Know what I mean? That's the consolation I receive when I send out my work.