fix: extract text from plannerResponse.modifiedResponse field

This commit is contained in:
2026-03-10 09:38:24 +09:00
parent 7ed2db90df
commit 9b047c0c7d
3 changed files with 17 additions and 18 deletions

View File

@@ -1811,26 +1811,25 @@ function setupMonitor() {
// Extract from plannerResponse field
const pr = s?.plannerResponse;
if (pr) {
if (typeof pr === 'string')
textContent = pr;
// Priority: modifiedResponse (confirmed field from AG)
if (pr.modifiedResponse)
textContent = pr.modifiedResponse;
else if (pr.rawText)
textContent = pr.rawText;
else if (pr.text)
textContent = pr.text;
else if (pr.message)
textContent = typeof pr.message === 'string' ? pr.message : JSON.stringify(pr.message);
textContent = typeof pr.message === 'string' ? pr.message : '';
else if (pr.content?.parts) {
for (const p of pr.content.parts) {
if (p?.text)
textContent += p.text;
}
}
else if (pr.parts) {
for (const p of pr.parts) {
if (p?.text)
textContent += p.text;
}
// Log first time to capture actual field names
if (!textContent) {
logToFile(`[RESPONSE-CAPTURE] plannerResponse keys: [${Object.keys(pr).join(',')}] values(100): ${JSON.stringify(pr).substring(0, 200)}`);
}
if (!textContent)
textContent = JSON.stringify(pr).substring(0, 500);
}
// Extract from ephemeralMessage field
const em = s?.ephemeralMessage;

File diff suppressed because one or more lines are too long