fix(provider): 统一响应体超时错误分类

将收到响应头后在读取 JSON 或 Veo 视频响应体阶段发生的 deadline/网络超时统一归类为 terminal timeout,保留 HTTP 状态、request ID 和 wire 证据,避免继续返回 response_read_error。

验证:go test ./... -count=1;go test ./internal/clients ./internal/runner -count=1;go vet ./internal/clients ./internal/runner;gofmt。
This commit is contained in:
2026-08-05 14:35:54 +08:00
parent dd10a807df
commit f9b945e4aa
3 changed files with 46 additions and 0 deletions
+5
View File
@@ -555,6 +555,11 @@ func (c GeminiClient) geminiVeoDownload(ctx context.Context, request Request, ap
}
payload, err := io.ReadAll(io.LimitReader(resp.Body, geminiVeoMaxVideoBytes+1))
if err != nil {
if timeoutErr := transportClientError(err); timeoutErr.Code == "timeout" {
timeoutErr.StatusCode = resp.StatusCode
timeoutErr.RequestID = requestIDFromHTTPResponse(resp)
return nil, "", timeoutErr
}
return nil, "", &ClientError{Code: "response_read_error", Message: err.Error(), StatusCode: resp.StatusCode, Retryable: true}
}
if int64(len(payload)) > geminiVeoMaxVideoBytes {