A novel approach to repair non-idempotent-outcome tests with an LLM-based agent