第121批续26-2:AI 请求超时 90s→180s(实测上游对完整 system prompt 推理 23-75s 分布且 30% 超 90s,180s 兜底;3 处 .timeout + 2 处诊断文案同步)
Auto Release / build (push) Successful in 2m39s

This commit is contained in:
youpaishidifu
2026-11-13 18:10:23 +08:00
parent 6c2f8b1235
commit 7cfc25ead8
+5 -5
View File
@@ -1008,7 +1008,7 @@ public class AIChatManager {
.header("Content-Type", "application/json; charset=utf-8")
.header("Authorization", "Bearer " + endpoint.apiKey)
.POST(HttpRequest.BodyPublishers.ofString(jsonBody, StandardCharsets.UTF_8))
.timeout(Duration.ofSeconds(90))
.timeout(Duration.ofSeconds(180))
.build();
return httpClient.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
@@ -1030,7 +1030,7 @@ public class AIChatManager {
if (e instanceof java.net.http.HttpConnectTimeoutException) {
plugin.getLogger().warning("[AI聊天-调试] 诊断: 连接超时——请求未发出,目标地址不可达或DNS解析慢");
} else if (e instanceof java.net.http.HttpTimeoutException) {
plugin.getLogger().warning("[AI聊天-调试] 诊断: 响应超时——请求已发出,上游90秒内未返回(可能限流/处理慢/挂死)");
plugin.getLogger().warning("[AI聊天-调试] 诊断: 响应超时——请求已发出,上游180秒内未返回(可能限流/处理慢/挂死)");
} else if (e instanceof java.net.ConnectException) {
plugin.getLogger().warning("[AI聊天-调试] 诊断: 连接被拒——目标端口未监听或防火墙拦截");
} else if (e instanceof java.net.UnknownHostException) {
@@ -1138,7 +1138,7 @@ public class AIChatManager {
.header("Content-Type", "application/json; charset=utf-8")
.header("Authorization", "Bearer " + endpoint.apiKey)
.POST(HttpRequest.BodyPublishers.ofString(followUpJson, StandardCharsets.UTF_8))
.timeout(Duration.ofSeconds(90))
.timeout(Duration.ofSeconds(180))
.build();
HttpResponse<String> followUpResp = httpClient.send(followUp, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
@@ -2798,7 +2798,7 @@ public class AIChatManager {
.header("Content-Type", "application/json; charset=utf-8")
.header("Authorization", "Bearer " + endpoint.apiKey)
.POST(HttpRequest.BodyPublishers.ofString(jsonBody, StandardCharsets.UTF_8))
.timeout(Duration.ofSeconds(90))
.timeout(Duration.ofSeconds(180))
.build();
return httpClient.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
@@ -2816,7 +2816,7 @@ public class AIChatManager {
if (e instanceof java.net.http.HttpConnectTimeoutException) {
plugin.getLogger().warning("[AI聊天-调试] 诊断: 连接超时——请求未发出,目标地址不可达或DNS解析慢");
} else if (e instanceof java.net.http.HttpTimeoutException) {
plugin.getLogger().warning("[AI聊天-调试] 诊断: 响应超时——请求已发出,上游90秒内未返回(可能限流/处理慢/挂死)");
plugin.getLogger().warning("[AI聊天-调试] 诊断: 响应超时——请求已发出,上游180秒内未返回(可能限流/处理慢/挂死)");
} else if (e instanceof java.net.ConnectException) {
plugin.getLogger().warning("[AI聊天-调试] 诊断: 连接被拒——目标端口未监听或防火墙拦截");
} else if (e instanceof java.net.UnknownHostException) {