Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@proma/electron",
"version": "0.15.11",
"version": "0.15.12",
"description": "Proma next gen ai software with general agents - Electron App",
"main": "dist/main.cjs",
"author": {
Expand Down
9 changes: 5 additions & 4 deletions apps/electron/src/main/lib/adapters/pi-native-retry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ function failedAssistant(errorMessage: string): AssistantMessage {
}

describe('Pi native retry classifier', () => {
test('classifies an OpenAI Responses terminal-event stream interruption as retryable', () => {
expect(isRetryableAssistantError(
failedAssistant('OpenAI Responses stream ended before a terminal response event'),
)).toBe(true)
test.each([
'OpenAI Responses stream ended before a terminal response event',
'Upstream Responses stream ended before a terminal event',
])('classifies Responses terminal-event stream interruption "%s" as retryable', (errorMessage) => {
expect(isRetryableAssistantError(failedAssistant(errorMessage))).toBe(true)
})

test.each([
Expand Down
1 change: 1 addition & 0 deletions apps/electron/src/main/lib/error-patterns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('isTransientNetworkError', () => {
'stream closed prematurely',
'premature close',
'OpenAI Responses stream ended before a terminal response event',
'Upstream Responses stream ended before a terminal event',
'Anthropic stream ended before message_stop',
'peer closed connection',
'incomplete chunked read',
Expand Down
2 changes: 1 addition & 1 deletion apps/electron/src/main/lib/error-patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* 这些都是 provider 连接被 CDN/网关切断的同类瞬时错误,与 ECONNRESET 性质一致。
*/
export const TRANSIENT_NETWORK_PATTERN =
/terminated|socket hang up|ECONNRESET|ETIMEDOUT|ECONNABORTED|EPIPE|ENOTFOUND|EAI_AGAIN|ECONNREFUSED|fetch failed|network error|peer closed connection|connection (?:error|closed|reset)|other side closed|incomplete chunked read|AbortError|(?:operation|request) was aborted|(?:request )?timed out|stream (?:closed|ended|disconnected) prematurely|premature close|stream ended before (?:a )?(?:terminal response event|message_stop)/i
/terminated|socket hang up|ECONNRESET|ETIMEDOUT|ECONNABORTED|EPIPE|ENOTFOUND|EAI_AGAIN|ECONNREFUSED|fetch failed|network error|peer closed connection|connection (?:error|closed|reset)|other side closed|incomplete chunked read|AbortError|(?:operation|request) was aborted|(?:request )?timed out|stream (?:closed|ended|disconnected) prematurely|premature close|stream ended before (?:a )?(?:terminal (?:response )?event|message_stop)/i

/** 判断错误消息/stderr 是否为瞬时网络错误 */
export function isTransientNetworkError(message?: string, stderr?: string): boolean {
Expand Down
2 changes: 1 addition & 1 deletion patches/@earendil-works%2Fpi-ai@0.80.9.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ index b3c27c8d5fb9a77c117af7ab8f789170903d5252..42b41a67c5607ef605fba6340882db6f
// (#4433); Bedrock/Smithy can throw an HTTP/2 no-response error (#3594).
"ended without",
+ // OpenAI Responses can close an SSE stream before sending its terminal event.
+ "stream ended before (?:a )?terminal response event",
+ "stream ended before (?:a )?terminal (?:response )?event",
+ // HTTP chunked/SSE transports can close before the complete body arrives.
+ // Match both phrases because proxy implementations may retain only one.
+ "peer closed connection",
Expand Down