fix(chat): recover active requests and preserve finish order

This commit is contained in:
john
2026-07-16 21:04:32 +08:00
parent 933466c8ab
commit c1012da120
4 changed files with 65 additions and 3 deletions
+8
View File
@@ -54,6 +54,14 @@ test('only ambiguous transport failures keep the chat streaming', () => {
assert.equal(shouldKeepStreamingAfterRunError(503), true);
assert.equal(shouldKeepStreamingAfterRunError(400), false);
assert.equal(shouldKeepStreamingAfterRunError(undefined), false);
assert.equal(
shouldKeepStreamingAfterRunError(
undefined,
'Session already has an active request. Cancel it first.',
),
true,
);
assert.equal(shouldKeepStreamingAfterRunError(undefined, '后台任务失败'), false);
});
test('shouldPromoteSessionIdToStreaming skips re-streaming after Finish', () => {