diff --git a/src/components/Agentic/IncidentDirectives/index.tsx b/src/components/Agentic/IncidentDirectives/index.tsx index 3ad4f42c..4de34421 100644 --- a/src/components/Agentic/IncidentDirectives/index.tsx +++ b/src/components/Agentic/IncidentDirectives/index.tsx @@ -157,6 +157,7 @@ export const IncidentDirectives = () => { text, ids: selectedConditions }), + openWhenHidden: true, onopen: (response: Response) => { if (response.ok) { setConversationId( @@ -186,13 +187,15 @@ export const IncidentDirectives = () => { onerror: (err: unknown) => { abortControllerRef.current = null; setIsStartMessageSending(false); + let errorMessage = "Unknown error starting directives chat"; if (err instanceof Error) { - // eslint-disable-next-line no-console - console.error("Error starting directives chat:", err); - } else { - // eslint-disable-next-line no-console - console.error("Unknown error starting directives chat"); + errorMessage = err.message; } + + // eslint-disable-next-line no-console + console.error(errorMessage); + + throw new Error(errorMessage); // Rethrow the error to avoid retrying }, onclose: () => { abortControllerRef.current = null; diff --git a/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx b/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx index beafbbbc..49f74656 100644 --- a/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx +++ b/src/components/Agentic/IncidentsContainer/CreateIncidentChatOverlay/index.tsx @@ -91,6 +91,7 @@ export const CreateIncidentChatOverlay = () => { body: JSON.stringify({ text }), + openWhenHidden: true, onopen: (response: Response) => { if (response.ok) { setIncidentId( @@ -138,13 +139,15 @@ export const CreateIncidentChatOverlay = () => { onerror: (err: unknown) => { abortControllerRef.current = null; setIsStartMessageSending(false); + let errorMessage = "Unknown error starting incident creation chat"; if (err instanceof Error) { - // eslint-disable-next-line no-console - console.error("Error starting incident creation chat:", err); - } else { - // eslint-disable-next-line no-console - console.error("Unknown error starting incident creation chat"); + errorMessage = err.message; } + + // eslint-disable-next-line no-console + console.error(errorMessage); + + throw new Error(errorMessage); // Rethrow the error to avoid retrying }, onclose: () => { abortControllerRef.current = null;