Keep an active voice session through engine switches

The page creates the voice once; each engine attachment only gives it that scene's action runner, pointer canvas and annotation events. Calls made during a switch wait for the incoming engine and are refused with ENGINE_SWITCHING when none attaches in time; results name the engine that answered, and the session hears engine-changed after a switch. The analyst's follow-up memory and layer enable times outlive one engine's runner. scripts/qa-voice-engine-switch.mjs drives a fake microphone and Realtime transport through the switches.
This commit is contained in:
German Khokhlov committed 2026-11-03 17:20:40 +04:00
1 parent 35ed499ae4
commit 05578c61b9
13 files changed
+998 -139

No files matched your search

+6 -1
View File
@@ -44,7 +44,7 @@ const session = createSessionDiagnostics(() => {
navigation: style?._navigation,
placeSearch: style?.placeSearch,
dataManager: components.data?.dataManager,
voice: components.tools?.voiceCommands,
voice: layerSession.voice?.commands ?? components.tools?.voiceCommands,
annotations: components.tools?.annotations,
geoImport: window.__gevGeoImport,
drawTool: window.__gevDrawTool,
@@ -171,8 +171,13 @@ async function settle() {
components.controls.styleManager.shareLinkManager?.resumeNavigation?.();
}
// Voice calls made while the engines switch wait for the next engine
// (src/voice/sceneRunner.js); a settled switch lets them look again.
layerSession.switching = () => engineSwitch?.state().busy === true;
function present() {
const { kind, busy } = engineSwitch.state();
if (!busy) layerSession.voice?.runner.wake();
display.presentGlobeEngine({ kind, busy, select });
for (const button of loading.querySelectorAll('.engine-switch-retry button'))
button.disabled = busy;