diff --git a/src/modules/aix/client/aix.client.ts b/src/modules/aix/client/aix.client.ts index 8c1beb0b7..c570b1ef6 100644 --- a/src/modules/aix/client/aix.client.ts +++ b/src/modules/aix/client/aix.client.ts @@ -71,7 +71,7 @@ type StreamMessageStatus = { interface AixClientOptions { - abortSignal: AbortSignal, + abortSignal: AbortSignal | 'NON_ABORTABLE'; // 'NON_ABORTABLE' is a special case for non-abortable operations throttleParallelThreads?: number; // 0: disable, 1: default throttle (12Hz), 2+ reduce frequency with the square root llmOptionsOverride?: Partial<{ llmTemperature: number, @@ -172,12 +172,12 @@ export async function aixChatGenerateTextNS_Simple( aixChatGenerate, aixContext, false, - { abortSignal: abortSignal }, + { abortSignal: abortSignal || 'NON_ABORTABLE' }, undefined, // no streaming ); // re-throw the user-initiated abort, as the former function catches it - if (abortSignal.aborted) + if (abortSignal?.aborted) throw new DOMException('Stopped.', 'AbortError'); const textContentFragments = (fragments || []).filter(f => isTextPart(f.part)); @@ -275,6 +275,13 @@ export async function aixChatGenerateContent_DMessage {