Fix: Agent connection error handling