agent uses threadsafe fsm