feat: Abort AI builder requests on chat stop (#17854)

This commit is contained in:
oleg
2025-08-04 09:55:07 +02:00
committed by GitHub
parent 1554e76500
commit ce98f7c175
19 changed files with 585 additions and 91 deletions

View File

@@ -219,6 +219,7 @@ export async function streamRequest<T extends object>(
onDone?: () => void,
onError?: (e: Error) => void,
separator = STREAM_SEPERATOR,
abortSignal?: AbortSignal,
): Promise<void> {
const headers: Record<string, string> = {
'browser-id': getBrowserId(),
@@ -229,6 +230,7 @@ export async function streamRequest<T extends object>(
method: 'POST',
credentials: 'include',
body: JSON.stringify(payload),
signal: abortSignal,
};
try {
const response = await fetch(`${context.baseUrl}${apiEndpoint}`, assistantRequest);