mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
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:
1 parent
8e1a3bab3e
commit
c34a2c38fc
4 files changed
+45
-4
No files matched your search
@@ -352,3 +352,35 @@ test('the cloud prompt states precedence and caveat speech once', () => {
|
||||
/"approximately"\/"roughly" for a tool number/,
|
||||
);
|
||||
});
|
||||
|
||||
test('an engine switch keeps the last answer for a follow-up on the next engine', async () => {
|
||||
const { createSceneRunner } = await import('./sceneRunner.js');
|
||||
const analystMemory = { lastResult: null };
|
||||
const layerEnabledAt = new Map();
|
||||
const run = createSceneRunner({
|
||||
build: () =>
|
||||
harness({ runnerOptions: { analystMemory, layerEnabledAt } }).runner,
|
||||
});
|
||||
run.attach({ engine: { kind: 'cesium' } });
|
||||
const first = await run('analyst_query', {
|
||||
layers: ['flights'],
|
||||
scope: { kind: 'anywhere' },
|
||||
});
|
||||
assert.equal(first.ok, true);
|
||||
// The real runner of the outgoing engine is disposed by the switch.
|
||||
run.detach();
|
||||
run.attach({ engine: { kind: 'navara' } });
|
||||
const followUp = await run('analyst_query', {
|
||||
layers: ['flights'],
|
||||
followUp: true,
|
||||
});
|
||||
assert.equal(followUp.ok, true, JSON.stringify(followUp));
|
||||
assert.equal(followUp.engine, 'navara');
|
||||
// The session ending still forgets it.
|
||||
run.resetConversation();
|
||||
const afterReset = await run('analyst_query', {
|
||||
layers: ['flights'],
|
||||
followUp: true,
|
||||
});
|
||||
assert.equal(afterReset.code, 'NO_RESULT_CONTEXT');
|
||||
});
|
||||
Reference in new issue
Block a user