From 8f55c962bbf9d93531b12911da94d1cbe264e41a Mon Sep 17 00:00:00 2001 From: AirCoding Date: Wed, 10 Jun 2026 09:34:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(executor):=20debug=20=E8=BE=93=E5=87=BA=20L?= =?UTF-8?q?LM=20=E5=AE=9E=E9=99=85=E5=9B=9E=E5=A4=8D=E7=9A=84=E5=89=8D200?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 之前只输出 💬 text,看不到 LLM 实际说了什么。 现在 stderr 会显示 LLM 回复前200字符,可以通过 checkpoint 找到完整文本。 Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/workers/src/roles/ExecutorRole.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/workers/src/roles/ExecutorRole.ts b/packages/workers/src/roles/ExecutorRole.ts index 900113b..931ebea 100755 --- a/packages/workers/src/roles/ExecutorRole.ts +++ b/packages/workers/src/roles/ExecutorRole.ts @@ -87,13 +87,18 @@ After all required files are written and required verification has passed, write // Parse structured actions from native tool_calls first, then strict JSON/code-block fallback const actions = this.parse_actions(text, llm_response.tool_calls || []) - // Debug + // Debug: show actual LLM output + const textPreview = text.replace(/\n/g, '\\n').slice(0, 200) const actionSummary = actions.map(a => { - if (a.type === 'code_block') return `📄 ${(a as any).filename} (${(a as any).content.length}B)` + if (a.type === 'code_block') return `📄 ${(a as any).filename}` if (a.type === 'tool_call') return `🔧 ${(a as any).name}` - return `💬 text` - }).join(', ') + return `💬 ${textPreview}` + }).join(' | ') process.stderr.write(`[EXEC T${turn}] ${actionSummary}\n`) + // Also write full text to log for inspection + if (actions.length === 1 && actions[0].type === 'text') { + this.runtime.checkpoint('executor_text_response', { turn, text: text.slice(0, 1000) }) + } // Execute all actions const hadActions = actions.some(a => a.type !== 'text')