From 6582b5dc1a6a3ca842d5ec644b31d3730c63e907 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 11 Apr 2026 11:16:42 +0000 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E8=81=8A=E5=A4=A9API?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86:=20=E5=9B=BD=E5=86=85?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E5=BC=82=E5=B8=B8=E6=97=B6=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=99=8D=E7=BA=A7=E5=88=B0=E9=80=9A=E7=94=A8=E5=BC=95=E6=93=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/5a0f8fc3-ded6-4e1f-8c98-b1e59f82aad6 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- server/app/server.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/server/app/server.js b/server/app/server.js index ef877da8..2d4c3493 100644 --- a/server/app/server.js +++ b/server/app/server.js @@ -272,8 +272,13 @@ app.post('/api/chat', async (req, res) => { // 优先用国内模型智能网关(读取 ZY_DEEPSEEK_API_KEY 等独立密钥) if (domesticGateway) { - const result = await domesticGateway.chat(sessionId, message); - return res.json({ ...result, sessionId }); + try { + const result = await domesticGateway.chat(sessionId, message); + return res.json({ ...result, sessionId }); + } catch (gwErr) { + console.error(`[聊天网关] 国内模型网关异常: ${gwErr.message}`); + // 降级到通用聊天引擎 + } } // 降级到通用聊天引擎