`write-handoff` writes a document for a session that does not exist yet. This is that session: it finds the document, loads it, and clears it so the same stale state is never picked up twice.