From f62687d5da97242f732a9a76b18457cc064a5489 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:55:36 +0000 Subject: [PATCH 1/3] Initial plan From 054900ba4f3d47b20e3f7c96b7e1e1d395378b93 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:04:08 +0000 Subject: [PATCH 2/3] fix: normalize dev-status.json and collaborators.json field names for zhuyuan issue reply The script expected field names (team_status, modules, next_step, waiting_for, last_synced) that didn't match the actual Notion-synced data (team, module, current, waiting, last_sync). Added a data normalization step after reading JSON files to bridge the gap. Also handles nested collaborators.json format and missing tech_routing/server_info/os fields gracefully. Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- scripts/zhuyuan-issue-reply.js | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/scripts/zhuyuan-issue-reply.js b/scripts/zhuyuan-issue-reply.js index f5925ace..cefb219d 100644 --- a/scripts/zhuyuan-issue-reply.js +++ b/scripts/zhuyuan-issue-reply.js @@ -24,6 +24,41 @@ try { collaborators = []; } +// === 数据规范化:兼容 Notion 同步的字段名差异 === +if (devStatus.team && !devStatus.team_status) { + devStatus.team_status = devStatus.team; +} +if (devStatus.last_sync && !devStatus.last_synced) { + devStatus.last_synced = devStatus.last_sync; +} +if (!devStatus.tech_routing) { + devStatus.tech_routing = { level_2_peer_help: {} }; +} +if (!devStatus.server_info) { + devStatus.server_info = {}; +} +if (Array.isArray(devStatus.team_status)) { + devStatus.team_status.forEach(dev => { + if (dev.module !== undefined && dev.modules === undefined) { + dev.modules = [dev.module]; + } + if (dev.current !== undefined && dev.next_step === undefined) { + dev.next_step = dev.current; + } + if (dev.waiting !== undefined && dev.waiting_for === undefined) { + dev.waiting_for = dev.waiting; + } + if (!dev.os) { + dev.os = '未记录'; + } + }); +} + +// 兼容 collaborators.json 的嵌套结构 +if (!Array.isArray(collaborators) && collaborators && collaborators.collaborators) { + collaborators = collaborators.collaborators; +} + const issueNumber = process.env.ISSUE_NUMBER; const issueTitle = process.env.ISSUE_TITLE || ''; const issueBody = process.env.ISSUE_BODY || ''; From 6628bf12c606792958c0568712debf1b3c93e1a0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 11 Mar 2026 13:05:01 +0000 Subject: [PATCH 3/3] fix: add Array.isArray guard for module field normalization Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- scripts/zhuyuan-issue-reply.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/zhuyuan-issue-reply.js b/scripts/zhuyuan-issue-reply.js index cefb219d..0841d074 100644 --- a/scripts/zhuyuan-issue-reply.js +++ b/scripts/zhuyuan-issue-reply.js @@ -40,7 +40,7 @@ if (!devStatus.server_info) { if (Array.isArray(devStatus.team_status)) { devStatus.team_status.forEach(dev => { if (dev.module !== undefined && dev.modules === undefined) { - dev.modules = [dev.module]; + dev.modules = Array.isArray(dev.module) ? dev.module : [dev.module]; } if (dev.current !== undefined && dev.next_step === undefined) { dev.next_step = dev.current;