From 6891619c81390af906586de82523941a0f9c17a3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 31 Mar 2026 06:48:30 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E5=92=8C=E5=AE=89=E5=85=A8=E6=89=AB=E6=8F=8F=E5=8F=8D=E9=A6=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - work-order-manager.js: 归档前确保目录存在(mkdirSync recursive) - staging-ops-agent.js: LLM模型名可配置(ZY_LLM_MODEL环境变量) - staging-auto-deploy.yml: 工单读取增加try-catch错误处理 - zhuyuan-sovereign.conf: SSL配置块增加域名占位符替换说明 Agent-Logs-Url: https://github.com/qinfendebingshuo/guanghulab/sessions/bb893563-5fa6-41ba-86e4-b6f87d2c2c32 Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/workflows/staging-auto-deploy.yml | 15 ++++++++++----- scripts/staging-ops-agent.js | 2 +- scripts/work-order-manager.js | 3 +++ server/nginx/zhuyuan-sovereign.conf | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/staging-auto-deploy.yml b/.github/workflows/staging-auto-deploy.yml index 3b3a850b..4bbd2c17 100644 --- a/.github/workflows/staging-auto-deploy.yml +++ b/.github/workflows/staging-auto-deploy.yml @@ -363,11 +363,16 @@ jobs: # 读取工单重试次数 ORDER_ID="${{ needs.deploy-staging.outputs.order_id }}" RETRY_INFO=$(node -e " - const data = JSON.parse(require('fs').readFileSync('data/work-orders/active.json','utf8')); - const order = data.orders.find(o => o.id === '$ORDER_ID'); - if (order) { - console.log(order.retry_count >= order.max_retries ? 'SEND_ALERT' : 'SKIP'); - } else { + try { + const data = JSON.parse(require('fs').readFileSync('data/work-orders/active.json','utf8')); + const order = data.orders.find(o => o.id === '$ORDER_ID'); + if (order) { + console.log(order.retry_count >= order.max_retries ? 'SEND_ALERT' : 'SKIP'); + } else { + console.log('SKIP'); + } + } catch (e) { + console.error('工单文件读取失败:', e.message); console.log('SKIP'); } ") diff --git a/scripts/staging-ops-agent.js b/scripts/staging-ops-agent.js index 16e65df2..cdfede61 100644 --- a/scripts/staging-ops-agent.js +++ b/scripts/staging-ops-agent.js @@ -219,7 +219,7 @@ ${logContent.slice(0, 3000)} const requestModule = isHttps ? https : http; const body = JSON.stringify({ - model: 'deepseek-chat', // 优先使用高性价比模型 + model: process.env.ZY_LLM_MODEL || 'deepseek-chat', // 默认使用高性价比模型, 可通过环境变量覆盖 messages: [ { role: 'system', content: '你是铸渊(ZhuYuan),光湖(HoloLake)系统的AI守护者。精通服务器运维、Node.js、Nginx、PM2。' }, { role: 'user', content: prompt } diff --git a/scripts/work-order-manager.js b/scripts/work-order-manager.js index 6eac822f..a97a4ecc 100644 --- a/scripts/work-order-manager.js +++ b/scripts/work-order-manager.js @@ -222,6 +222,9 @@ function archiveOrder(args) { message: '任务归档完成' }); + // 确保归档目录存在 + fs.mkdirSync(ARCHIVE_DIR, { recursive: true }); + // 移到归档目录 const month = new Date().toISOString().slice(0, 7); const archiveFile = path.join(ARCHIVE_DIR, `${month}.json`); diff --git a/server/nginx/zhuyuan-sovereign.conf b/server/nginx/zhuyuan-sovereign.conf index ce1c90e3..7b6224c9 100644 --- a/server/nginx/zhuyuan-sovereign.conf +++ b/server/nginx/zhuyuan-sovereign.conf @@ -203,6 +203,8 @@ server { # 当 /opt/zhuyuan/config/ssl/ 下存在证书文件时启用 # 证书来源: GitHub Secrets → ZY_SSL_FULLCHAIN / ZY_SSL_PRIVKEY # 部署方式: staging-auto-deploy.yml 自动写入证书文件 +# 域名占位符: ZY_DOMAIN_PREVIEW_PLACEHOLDER 由 deploy workflow 的 sed 命令替换 +# (同 §1/§2 的注入方式,详见 staging-auto-deploy.yml 和 deploy-to-zhuyuan-server.yml) # ─── §3.1 预览域名 HTTPS (guanghu.online) ─── # 注意: 此block仅在证书存在时由deploy脚本include,不会导致Nginx启动失败