Why does my agent fail on the server with a "Error loading USE or USELSX module" error?
If this works fine on the client when you run the agent manually, you have probably included a references to a NotesUI class in your library. Remove all references to NotesUI classes and the agent should run.