fix(extension): resolve AI response dropping by adding nested payload extraction in step-utils

This commit is contained in:
Variet Worker
2026-04-10 15:52:25 +09:00
parent 89c95de18c
commit 6bbc9ddd00
5 changed files with 53 additions and 18 deletions

View File

@@ -366,18 +366,15 @@ function setupMonitor() {
} catch { }
}
if (sType.includes('PLANNER_RESPONSE') && s?.status?.includes('DONE')) {
const pr = s?.plannerResponse;
if (pr) {
let text = pr.modifiedResponse || pr.rawText || pr.text || '';
if (text.length > 10) {
lastResponseCaptureStep = actualIdx;
ctx.logToFile(`[RT-CAPTURE] step=${actualIdx} (${text.length} chars)`);
const truncated = text.length > 3500
? text.substring(0, 3500) + '\n\n_(이하 생략)_'
: text;
ctx.writeChatSnapshot(`💬 **AI 응답**\n\n${truncated}`);
break;
}
let text = extractPlannerText(s) || '';
if (text.length > 10) {
lastResponseCaptureStep = actualIdx;
ctx.logToFile(`[RT-CAPTURE] step=${actualIdx} (${text.length} chars)`);
const truncated = text.length > 3500
? text.substring(0, 3500) + '\n\n_(이하 생략)_'
: text;
ctx.writeChatSnapshot(`💬 **AI 응답**\n\n${truncated}`);
break;
}
}
}