From 79d82a1f8da448933e31066ef8d3f3e04e20e261 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Wed, 11 Mar 2026 17:02:50 +0800 Subject: [PATCH] update --- agent/npc.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/agent/npc.ts b/agent/npc.ts index 73f7b20..cd772f8 100644 --- a/agent/npc.ts +++ b/agent/npc.ts @@ -19,11 +19,17 @@ const main = async () => { const pickRepoInfoEnv = pick(repoInfoEnv, ['repoId', 'repoIdLabel', 'repoName', 'repoNameLabel', 'repoSlug', 'repoSlugLabel']); const issueLabels = issueEnv.issueLabels || []; const isComment = !!commentEnv.commentId; + const envList = [ + ...Object.entries(pickRepoInfoEnv).map(([key, value]) => `${key}: ${value}`), + ...Object.entries(pickIssueEnv).map(([key, value]) => `${key}: ${value}`), + ...Object.entries(pickCommentEnv).map(([key, value]) => `${key}: ${value}`), + ] + writeToProcess('当前环境变量:'); + envList.forEach(item => writeToProcess(item)); if (!isComment && !issueLabels.includes('Run')) { writeToProcess('当前 Issue 不包含 Run 标签,跳过执行'); process.exit(0); } - const messages = [ { role: 'system', @@ -37,7 +43,8 @@ const main = async () => { content: commentEnv.commentBody || pickIssueEnv.issueDescription || '无' } ] - console.log('messages', messages) + writeToProcess('输入消息:'); + writeToProcess(JSON.stringify(messages, null, 2)); const result = await app.run({ path: 'cnb', key: 'chat',