I think it will depend in large part to how Wentz's health is coming along. If he will be fully ready to go by the beginning of the season, I could see the Eagles trading Foles for a top (1st or 2nd round) draft pick. There are a lot of teams out there who would love to have someone like Foles, and I'm sure he'd love to go somewhere where he will for sure be a starter.
Otherwise, The Eagles would be better off keeping Foles and having him be the starter at the beginning of next year until Carson Wentz is fully 100% and ready to go.