fix(mindspace): fail closed on invalid page data delivery
This commit is contained in:
@@ -31,6 +31,18 @@ export function shouldPromoteSessionIdToStreaming(chatState) {
|
||||
return chatState !== 'idle';
|
||||
}
|
||||
|
||||
/**
|
||||
* Only transport uncertainty may continue a run after submit fails. A
|
||||
* deterministic gateway error already has a terminal outcome and must return
|
||||
* the chat UI to an error/idle state instead of leaving a Stop button active.
|
||||
*
|
||||
* @param {number | undefined | null} status
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function shouldKeepStreamingAfterRunError(status) {
|
||||
return status === 0 || status === 409 || Number(status) >= 500;
|
||||
}
|
||||
|
||||
/**
|
||||
* Agent-run POST tracks portal request_id; Goose SSE may emit a different chat_request_id.
|
||||
* Adopt the upstream id so Message/Finish events are not dropped in the UI.
|
||||
|
||||
Reference in New Issue
Block a user