Pedroia and Red Sox have agreed in principle on extension