add debug logs for PR/SAGA interaction, fix port for get_pwd