diff --git a/.github/workflows/syslog-auto-pipeline.yml b/.github/workflows/syslog-auto-pipeline.yml index 78498053..908ae0db 100644 --- a/.github/workflows/syslog-auto-pipeline.yml +++ b/.github/workflows/syslog-auto-pipeline.yml @@ -261,7 +261,9 @@ jobs: const email = '${{ steps.parse.outputs.email }}'; const typeLabel = type === 'syslog' ? 'SYSLOG 闭环处理' : '问题解答'; - const maskedEmail = email.replace(/(.{2})(.*)(@.*)/, '$1***$3'); + const maskedEmail = email.length > 4 + ? email.replace(/(.{2})(.*)(@.*)/, '$1***$3') + : '***'; const body = [ '✅ **已处理** · ' + typeLabel, diff --git a/scripts/wake-persona.js b/scripts/wake-persona.js index 9668282c..bfd1bbaf 100644 --- a/scripts/wake-persona.js +++ b/scripts/wake-persona.js @@ -36,11 +36,10 @@ const AUTHOR = process.env.AUTHOR || 'unknown'; // Claude 模型优先级队列(从高到低) const PREFERRED_MODELS = [ 'claude-sonnet-4', - 'claude-3.5-sonnet', 'claude-3-5-sonnet-20241022', + 'claude-3.5-sonnet', 'claude-3-5-sonnet', 'anthropic/claude-3.5-sonnet', - 'anthropic/claude-3-5-sonnet', 'claude-3-sonnet', 'claude-3-haiku', ]; @@ -132,18 +131,22 @@ function selectBestModel(models) { for (const preferred of PREFERRED_MODELS) { const match = available.find(function (id) { return id.includes(preferred); }); if (match) { - const originalId = models.find(function (m) { return m.id.toLowerCase() === match; }).id; - console.log('[LLM] 📌 选择模型: ' + originalId + ' (匹配规则: ' + preferred + ')'); - return originalId; + const found = models.find(function (m) { return m.id.toLowerCase() === match; }); + if (found) { + console.log('[LLM] 📌 选择模型: ' + found.id + ' (匹配规则: ' + preferred + ')'); + return found.id; + } } } // 兜底:任何含 'claude' 的模型 const anyClaude = available.find(function (id) { return id.includes('claude'); }); if (anyClaude) { - const originalId = models.find(function (m) { return m.id.toLowerCase() === anyClaude; }).id; - console.log('[LLM] 📌 兜底选择 Claude 模型: ' + originalId); - return originalId; + const found = models.find(function (m) { return m.id.toLowerCase() === anyClaude; }); + if (found) { + console.log('[LLM] 📌 兜底选择 Claude 模型: ' + found.id); + return found.id; + } } // 最终兜底:平台第一个可用模型