@@ -68,6 +68,34 @@ test('harness bridge recovers streamed text when final envelope is empty after a
|
||||
assert.equal(reply.text, 'Your computer is ready.');
|
||||
});
|
||||
|
||||
test('ask with no spoken text after tools returns to listening without a Reply', async () => {
|
||||
const daemon = new JarvisDaemon();
|
||||
daemon.harness = { ask: async () => ({ ok: true, text: '', reason: 'stop' }), cancel() {}, close: async () => {} };
|
||||
daemon.voiceLoop = null;
|
||||
const replies = [];
|
||||
daemon.on('Reply', (text) => replies.push(text));
|
||||
try {
|
||||
const result = await daemon.ask('status');
|
||||
assert.equal(result, '');
|
||||
assert.deepEqual(replies, []);
|
||||
assert.equal(daemon.state, 'LISTENING');
|
||||
} finally {
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('confirmPermission forwards Allow/Deny to the harness session', async () => {
|
||||
const daemon = new JarvisDaemon();
|
||||
const calls = [];
|
||||
daemon.harness = { session: { permit(...args) { calls.push(args); } }, cancel() {}, close: async () => {} };
|
||||
try {
|
||||
daemon.confirmPermission('job-1', 'call-9', 'allow');
|
||||
assert.deepEqual(calls, [['job-1', 'call-9', 'allow']]);
|
||||
} finally {
|
||||
await daemon.close();
|
||||
}
|
||||
});
|
||||
|
||||
test('harness bridge resetContext disposes the current conversation', async () => {
|
||||
let cancelled = false; let disposed = false;
|
||||
const bridge = Object.create(HarnessBridge.prototype);
|
||||
|
||||
Reference in New Issue
Block a user