Fix joining active inference

This commit is contained in:
dwrz
2026-11-04 00:25:23 +00:00
parent e13d9d849d
commit caaacf1c98
4 changed files with 138 additions and 124 deletions
+8 -4
View File
@@ -165,9 +165,10 @@ export class Api {
* message_deleted per manifest ID that is no longer saved. An
* empty manifest requests every saved row.
*
* When an inference is reserved or ongoing, the stream then follows
* its events and ends with done. When none is, the stream ends
* after the diff without done.
* If an inference run is reserved or in progress, the stream sends one
* inference_active event, then the live events of the run, and then done.
* If no run is active, the stream closes after the diff and does not send
* inference_active or done.
*
* @param {string} id - conversation ID.
* @param {Array<{id: string, updated_at: string}>} manifest
@@ -345,7 +346,10 @@ export class Api {
body,
signal,
});
yield* readEvents(res);
for await (const event of readEvents(res)) {
if (signal?.aborted) return;
yield event;
}
}
}