I had an annoying chatgpt-shell bug where sometimes the compose buffer's svg header would disappear while text was streaming into the Emacs buffer. There are a number of things that could have gone rogue when streaming and post-processing buffer text, so I wasn't quite sure where to start narrowing things down. I had a feeling I could maybe use something like after-change-functions hook to monitor changes, but that only tells me about the text modified. I wanted to know which of my functions ...