Fix uri parser in agentFromSession