diff --git a/server/lib/gateway/gateway.forwardMessageToOpenAI.js b/server/lib/gateway/gateway.forwardMessageToOpenAI.js index bcdae2a0f9..29e84052c3 100644 --- a/server/lib/gateway/gateway.forwardMessageToOpenAI.js +++ b/server/lib/gateway/gateway.forwardMessageToOpenAI.js @@ -11,7 +11,7 @@ const intentTranslation = { INFO: 'info.get-info', }; -const disableOpenAiFirstReply = new Set(['GET_TEMPERATURE', 'GET_HUMIDITY']); +const disableOpenAiFirstReply = new Set(['GET_TEMPERATURE', 'GET_HUMIDITY', 'NO_RESPONSE']); /** * @public diff --git a/server/test/lib/gateway/gateway.forwardMessageToOpenAI.test.js b/server/test/lib/gateway/gateway.forwardMessageToOpenAI.test.js index e6913af973..8eeca35d4e 100644 --- a/server/test/lib/gateway/gateway.forwardMessageToOpenAI.test.js +++ b/server/test/lib/gateway/gateway.forwardMessageToOpenAI.test.js @@ -205,6 +205,18 @@ describe('gateway.forwardMessageToOpenAI', () => { intent: 'temperature-sensor.get-in-room', }); }); + it('should do nothing, no-response was sent', async () => { + gateway.gladysGatewayClient.openAIAsk = fake.resolves({ + type: 'NO_RESPONSE', + answer: '', + room: '', + }); + const classification = await gateway.forwardMessageToOpenAI({ message, previousQuestions, context }); + expect(classification).to.deep.equal({ + intent: undefined, + }); + assert.notCalled(messageManager.reply); + }); it('should start scene from OpenAI', async () => { gateway.gladysGatewayClient.openAIAsk = fake.resolves({ type: 'SCENE_START',