Keep the analyst's last answer when the voice runner moves to another engine

A runner retired by an engine switch ends its in-flight writes but leaves the shared follow-up memory for the next engine's runner; ending the voice conversation still forgets it.
This commit is contained in:
German Khokhlov committed 2026-11-03 19:41:12 +04:00
1 parent 8e1a3bab3e
commit c34a2c38fc
4 files changed
+45 -4

No files matched your search

+8 -3
View File
@@ -1554,10 +1554,15 @@ export function createGevActionRunner({
conversation++;
analystEngine?.reset();
};
/** Voice was removed: nothing may run or write again. */
runVoiceAction.dispose = () => {
/**
* Voice was removed, or this runner's globe left (`keepMemory`: a host
* that shares the analyst's memory with the next runner keeps the last
* answer): nothing may run or write again.
*/
runVoiceAction.dispose = ({ keepMemory = false } = {}) => {
if (disposed) return;
runVoiceAction.resetConversation();
conversation++;
if (!keepMemory) analystEngine?.reset();
disposed = true;
};
return runVoiceAction;