fix(executor): debug 输出 LLM 实际回复的前200字
之前只输出 💬 text,看不到 LLM 实际说了什么。 现在 stderr 会显示 LLM 回复前200字符,可以通过 checkpoint 找到完整文本。 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user