Modify psagent and add some test bench for the psagent