Track write/edit tool paths per turn, refresh the open preview on tool_complete and after preservePreview loadDir on stream done, without closing preview for unrelated responses or wiping unsaved local edits.
Background file-tree refresh after a response must not call clearPreview(); preserve the open preview while still reloading the directory listing.