···218218 }
219219 });
220220221221+ // Clear traceparent on history restore so cached pages don't reuse a stale trace
222222+ document.body.addEventListener('htmx:historyRestore', function() {
223223+ document.body.removeAttribute('hx-headers');
224224+ });
225225+221226 // Clean up styles before taking history snapshot
222227 document.body.addEventListener('htmx:beforeHistorySave', function(evt) {
223228 // Remove all transition classes and styles from elements being cached