To seal the joint I would recommend Compriband HPE or an equivalent (based on its intended use, not a promotion). Basically it's a pre-compressed impregnated foam strip that expands to fill the space. It tends to have a wide range of usable thicknesses and will continue to expand and compress as necessary into the future as the wood shrinks and expands. It's permeable to water vapour, but not to water so will prevent rain ingress while allowing the joint to breathe which should prevent condensation within the joint.

Its intended use is sealing the joint between the windows and the frame in timber frame (stud frame) buildings.

As others have pointed out, traditional infill materials tend to be more breatheable than modern ones. I've seen new constructions here (Normandy, France) using cellular concrete blocks (? Béton cellulaire in French). TBH I'm not sure that many builders actually care enough about the longevity of the building to worry about it and repairs are often made with cement mortar instead of lime.

I've been giving the matter some thought recently and hope to have more suggestions soon.