I put it here because that was where we called `getRelatedDocuments()` in the old code, which is what used to clear out the previous set of related documents. But you're right that it makes more sense in `unloadAgents()`.

Another option is just to do it in `reconnect()`, which is a more specific fix since that really only seems to be called from the save code. Would that make more sense?

Mostly I was worried that `closeDocuments()` did other things besides close the related docs. But now that I'm specifically only closing those docs I'm not as worried about it.