fix(mindspace): fail closed on invalid page data delivery
This commit is contained in:
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
import {
|
||||
reconcileSessionEventRequestContext,
|
||||
resolvePostAgentRunChatState,
|
||||
shouldKeepStreamingAfterRunError,
|
||||
shouldPromoteSessionIdToStreaming,
|
||||
} from './chat-agent-run-gate.mjs';
|
||||
|
||||
@@ -47,6 +48,14 @@ test('completed run wins when the direct-chat snapshot is not ready', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('only ambiguous transport failures keep the chat streaming', () => {
|
||||
assert.equal(shouldKeepStreamingAfterRunError(0), true);
|
||||
assert.equal(shouldKeepStreamingAfterRunError(409), true);
|
||||
assert.equal(shouldKeepStreamingAfterRunError(503), true);
|
||||
assert.equal(shouldKeepStreamingAfterRunError(400), false);
|
||||
assert.equal(shouldKeepStreamingAfterRunError(undefined), false);
|
||||
});
|
||||
|
||||
test('shouldPromoteSessionIdToStreaming skips re-streaming after Finish', () => {
|
||||
assert.equal(shouldPromoteSessionIdToStreaming('idle'), false);
|
||||
assert.equal(shouldPromoteSessionIdToStreaming('waiting'), true);
|
||||
|
||||
Reference in New Issue
Block a user