refact agent string