Skip to content

Commit 46053c5

Browse files
committed
fix: 添加 HTTP/2 stream error 到可重試錯誤列表
問題: - 用戶遇到錯誤:stream error: stream ID 1; INTERNAL_ERROR - 這是 HTTP/2 連接被服務端關閉的錯誤 - 當前重試機制不包含此類錯誤,導致直接失敗 修復: - 添加 "stream error" 到可重試列表 - 添加 "INTERNAL_ERROR" 到可重試列表 - 遇到此類錯誤時會自動重試(最多 3 次) 影響: - 提高 API 調用穩定性 - 自動處理服務端臨時故障 - 減少因網絡波動導致的失敗
1 parent 45ec645 commit 46053c5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

mcp/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ func isRetryableError(err error) bool {
280280
"connection refused",
281281
"temporary failure",
282282
"no such host",
283+
"stream error", // HTTP/2 stream 错误
284+
"INTERNAL_ERROR", // 服务端内部错误
283285
}
284286
for _, retryable := range retryableErrors {
285287
if strings.Contains(errStr, retryable) {

0 commit comments

Comments
 (0)