fix: extract text from plannerResponse.modifiedResponse field
This commit is contained in:
@@ -1779,20 +1779,20 @@ 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.message) textContent = typeof pr.message === 'string' ? pr.message : JSON.stringify(pr.message);
|
||||
else if (pr.text) textContent = pr.text;
|
||||
else if (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;
|
||||
|
||||
Reference in New Issue
Block a user