fix(proxy): fail over on empty upstream responses - #246
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #246 +/- ##
==========================================
+ Coverage 72.09% 72.13% +0.04%
==========================================
Files 243 243
Lines 14147 14152 +5
Branches 4674 4676 +2
==========================================
+ Hits 10199 10209 +10
Misses 2598 2598
+ Partials 1350 1345 -5
🚀 New features to boost your workflow:
|
g1331
force-pushed
the
fix/proxy-empty-upstream-response
branch
from
August 3, 2026 05:02
6012ccc to
33e804a
Compare
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.
Summary
修复上游返回空响应时被透传到下游的问题。成功但空 body 的非流式响应,以及没有产生有效内容就结束的 SSE 流,都会在响应提交前触发故障转移。
Related Issue
未关联具体 Issue。
Type of Change
Changes
UpstreamEmptyResponseError,拦截成功状态下的空非流式响应。firstByteTimeout配置才进行检测。proxy-client与代理路由回归测试,并补充中英文显示文本。Test Plan
proxy-client94/94,代理路由 88 通过)pnpm exec tsc --noEmit)Checklist
Screenshots
不适用。
Additional Notes
截图中的 HTTP 499 仍表示下游客户端断开,不属于本次空响应错误。