fix(pi): 修复 Responses 流终态事件中断未自动重试【已审核 PR】#1291
Open
Andreaseszhang wants to merge 1 commit into
Open
Conversation
Made-with: Proma
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
修复部分上游 Responses SSE 流在终态事件前中断时无法触发 Pi 原生自动重试的问题。实际错误文案为
Upstream Responses stream ended before a terminal event,与既有规则中的terminal response event少了response,导致未被归类为可恢复断流。改动
patches/@earendil-works%2Fpi-ai@0.80.9.patch— 将 Pi 原生 retry pattern 扩展为同时识别terminal event与terminal response event,使其在同一 transcript 内自动恢复。apps/electron/src/main/lib/error-patterns.ts— 同步扩展 Proma 主进程的瞬时网络错误分类;原生重试耗尽后,该错误仍会作为network_error进入外层重试与 UI。apps/electron/src/main/lib/adapters/pi-native-retry.test.ts— 添加截图中Upstream Responses stream ended before a terminal event的原生重试回归测试。apps/electron/src/main/lib/error-patterns.test.ts— 添加同一错误文案的主进程网络错误分类回归测试。apps/electron/package.json— 将@proma/electron版本从0.15.11升至0.15.12。测试方法
bun test apps/electron/src/main/lib/adapters/pi-native-retry.test.ts apps/electron/src/main/lib/error-patterns.test.ts。network_error分类。bun run typecheck,确认所有 workspace package 类型检查通过。备注
stream ended错误误判为可重试。Made with Proma · GitHub