+18
-2
@@ -7,7 +7,7 @@ import assert from 'node:assert/strict';
|
||||
import { VoiceStateMachine } from '../daemon/voice-state.js';
|
||||
import { QvacScheduler } from '../daemon/qvac-scheduler.js';
|
||||
import { JarvisDaemon } from '../daemon/index.js';
|
||||
import { HarnessBridge } from '../daemon/harness-bridge.js';
|
||||
import { HarnessBridge, harnessRoots } from '../daemon/harness-bridge.js';
|
||||
import { spokenReply } from '../skills/voice-prompt.js';
|
||||
import { voiceSettings } from '../daemon/voice-settings.js';
|
||||
|
||||
@@ -67,11 +67,13 @@ test('ask extracts harness reply text instead of stringifying the object', async
|
||||
});
|
||||
|
||||
test('harness bridge caps voice shell chaining', () => {
|
||||
const bridge = new HarnessBridge();
|
||||
const bridge = new HarnessBridge({ fsAccess: 'workspace' });
|
||||
assert.equal(bridge.options.origin, 'jarvis-qvac');
|
||||
assert.equal(bridge.options.voice, true);
|
||||
assert.equal(bridge.options.maxShellCalls, 1);
|
||||
assert.equal(bridge.options.maxTurns, 6);
|
||||
assert.deepEqual(bridge.options.roots, []);
|
||||
assert.deepEqual(harnessRoots('filesystem'), ['/']);
|
||||
assert.deepEqual(bridge.options.builtinTools, [
|
||||
'read_file',
|
||||
'list_dir',
|
||||
@@ -150,6 +152,20 @@ test('QVAC scheduler prioritizes voice and keeps one active job', async () => {
|
||||
assert.deepEqual(scheduler.status(), { running: 0, queued: [] });
|
||||
});
|
||||
|
||||
test('idle sleep unloads GPU models instead of only suspending', async () => {
|
||||
const daemon = new JarvisDaemon();
|
||||
const calls = [];
|
||||
daemon.settings = { ...daemon.settings, freeVramOnIdle: true };
|
||||
daemon.parkModels = async () => { calls.push('park'); };
|
||||
daemon.voiceLoop = { interrupt() {} };
|
||||
daemon.harness = { cancel() {}, resetContext: async () => {}, close: async () => {} };
|
||||
try {
|
||||
await daemon.sleep();
|
||||
assert.equal(daemon.state, 'SLEEPING');
|
||||
assert.deepEqual(calls, ['park']);
|
||||
} finally { await daemon.close(); }
|
||||
});
|
||||
|
||||
test('shutdown still closes the harness when recovery or voice cleanup fails', async () => {
|
||||
const daemon = new JarvisDaemon(); let closed = false;
|
||||
daemon.recovery.save = () => { throw new Error('disk full'); };
|
||||
|
||||
Reference in New Issue
Block a user