fix: extract user message from userInput.userResponse field (discovered via step dump)
This commit is contained in:
@@ -1888,23 +1888,23 @@ function setupMonitor() {
|
|||||||
});
|
});
|
||||||
if (umResp?.steps?.length > 0) {
|
if (umResp?.steps?.length > 0) {
|
||||||
const umStep = umResp.steps[0];
|
const umStep = umResp.steps[0];
|
||||||
// User message text can be in various fields
|
// User message is in userInput.userResponse (discovered via step dump)
|
||||||
const umText = umStep?.userMessage?.text
|
const ui = umStep?.userInput;
|
||||||
|| umStep?.userMessage?.rawText
|
const umText = ui?.userResponse || '';
|
||||||
|| umStep?.plannerResponse?.rawText
|
const clientType = ui?.clientType || '';
|
||||||
|| umStep?.metadata?.toolCall?.argumentsJson
|
const isFromIDE = clientType.includes('IDE');
|
||||||
|| '';
|
logToFile(`[USER-MSG] step=${userInputIdx} type=${umStep?.type} client=${clientType} text=${umText.substring(0, 100)}`);
|
||||||
if (umText.length > 2) {
|
if (umText.length > 2) {
|
||||||
const truncated = umText.length > 800
|
const truncated = umText.length > 800
|
||||||
? umText.substring(0, 800) + '\n\n_(이하 생략)_'
|
? umText.substring(0, 800) + '\n\n_(이하 생략)_'
|
||||||
: umText;
|
: umText;
|
||||||
writeChatSnapshot(`👤 **사용자 (AG 직접 입력)**\n\n${truncated}`);
|
const source = isFromIDE ? 'AG 직접 입력' : 'API';
|
||||||
|
writeChatSnapshot(`👤 **사용자 (${source})**\n\n${truncated}`);
|
||||||
logToFile(`[USER-MSG] relayed ${umText.length} chars from step ${userInputIdx}`);
|
logToFile(`[USER-MSG] relayed ${umText.length} chars from step ${userInputIdx}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Fallback: just notify that user sent input
|
writeChatSnapshot(`👤 **사용자** — _(내용 없음)_`);
|
||||||
writeChatSnapshot(`👤 **사용자 (AG 직접 입력)** — _(내용 추출 불가)_`);
|
logToFile(`[USER-MSG] step ${userInputIdx} text empty`);
|
||||||
logToFile(`[USER-MSG] step ${userInputIdx} text empty, sent fallback`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1853,22 +1853,24 @@ function setupMonitor() {
|
|||||||
});
|
});
|
||||||
if (umResp?.steps?.length > 0) {
|
if (umResp?.steps?.length > 0) {
|
||||||
const umStep = umResp.steps[0];
|
const umStep = umResp.steps[0];
|
||||||
// User message text can be in various fields
|
// User message is in userInput.userResponse (discovered via step dump)
|
||||||
const umText = umStep?.userMessage?.text
|
const ui = umStep?.userInput;
|
||||||
|| umStep?.userMessage?.rawText
|
const umText = ui?.userResponse || '';
|
||||||
|| umStep?.plannerResponse?.rawText
|
const clientType = ui?.clientType || '';
|
||||||
|| umStep?.metadata?.toolCall?.argumentsJson
|
const isFromIDE = clientType.includes('IDE');
|
||||||
|| '';
|
|
||||||
|
logToFile(`[USER-MSG] step=${userInputIdx} type=${umStep?.type} client=${clientType} text=${umText.substring(0, 100)}`);
|
||||||
|
|
||||||
if (umText.length > 2) {
|
if (umText.length > 2) {
|
||||||
const truncated = umText.length > 800
|
const truncated = umText.length > 800
|
||||||
? umText.substring(0, 800) + '\n\n_(이하 생략)_'
|
? umText.substring(0, 800) + '\n\n_(이하 생략)_'
|
||||||
: umText;
|
: umText;
|
||||||
writeChatSnapshot(`👤 **사용자 (AG 직접 입력)**\n\n${truncated}`);
|
const source = isFromIDE ? 'AG 직접 입력' : 'API';
|
||||||
|
writeChatSnapshot(`👤 **사용자 (${source})**\n\n${truncated}`);
|
||||||
logToFile(`[USER-MSG] relayed ${umText.length} chars from step ${userInputIdx}`);
|
logToFile(`[USER-MSG] relayed ${umText.length} chars from step ${userInputIdx}`);
|
||||||
} else {
|
} else {
|
||||||
// Fallback: just notify that user sent input
|
writeChatSnapshot(`👤 **사용자** — _(내용 없음)_`);
|
||||||
writeChatSnapshot(`👤 **사용자 (AG 직접 입력)** — _(내용 추출 불가)_`);
|
logToFile(`[USER-MSG] step ${userInputIdx} text empty`);
|
||||||
logToFile(`[USER-MSG] step ${userInputIdx} text empty, sent fallback`);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (umErr: any) {
|
} catch (umErr: any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user