ACTION-PROMISE 가드: '필요하면/원하시면/궁금하다면 …드리겠습니다'도 조건부 제안으로 통과(닥터앱 스타틴 답이 오판 넛지로 앞 주제 재검색+영어 답변). 넛지 문구에 사용자 언어로 답하라 추가

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Opus 5.5 committed 2026-10-22 15:57:05 +09:00
1 parent 9e9cc4a6bf
commit 013bdb073b
3 files changed
+11 -2

No files matched your search

+1 -1
View File
@@ -2004,7 +2004,7 @@ async function handleChat(
messages.push({ role: 'assistant', content: candidateText });
messages.push({
role: 'user',
content: 'You announced an action (search/download/create/…) but the turn ended with zero tool calls — the user only sees the promise, which reads as if you stopped mid-answer. Do it now: make the real tool call, then report the result. If you cannot or should not perform it, say so plainly right now instead of promising.',
content: 'You announced an action (search/download/create/…) but the turn ended with zero tool calls — the user only sees the promise, which reads as if you stopped mid-answer. Do it now: make the real tool call, then report the result. If you cannot or should not perform it, say so plainly right now instead of promising. Reply in the same language as the user (Korean if they wrote Korean).',
});
lastRoundWasGuardReprompt = false;
continue;
+4 -1
View File
@@ -557,7 +557,10 @@ export function isActionPromiseNoTool(text: string): boolean {
if (/[??]\s*$|(?:알려|말씀해|가르쳐)\s*주(?:시면|세요|실래요)|확인\s*부탁|(?:인가요|일까요|건가요|드릴까요|할까요|싶으신가요)[??\s]*$/.test(tail.trim()) || /(?:알려|말씀해)\s*주시면/.test(tail)
// 2026-10-21 메인채팅: "합칠 원문을 다시 붙여 주시면 바로 정리해 드리겠습니다"가 약속으로 오판돼 넛지 → "직전 답변에서 행동을
// 약속하지 않았는데, 이 메시지의 지시에 따라…"라는 엉뚱한 답이 나갔다. 마지막 문장이 "~(해/주)시면" 조건문이면 사용자 몫을 기다리는 것이다.
|| /[가-힣]시면\s[^.!?。\n]*$/.test(tail.trim().replace(/[.!。\s]+$/, ''))) return false;
|| /[가-힣]시면\s[^.!?。\n]*$/.test(tail.trim().replace(/[.!。\s]+$/, ''))
// 2026-10-22 닥터앱: "더 자세한 근거나 최신 연구가 필요하면 검색해 드리겠습니다"(시 없는 꼴)가 약속으로 오판 → 넛지가 영어라
// 모델이 앞 턴 주제를 영어로 다시 검색·답변했고 언어 백스톱이 번역해 내보냈다. 사용자 쪽 조건(필요/원하/궁금…면)도 제안이다.
|| /(?:필요하|원하|궁금하|괜찮으|좋으)(?:시)?(?:다)?면\s[^.!?。\n]*$/.test(tail.trim().replace(/[.!。\s]+$/, ''))) return false;
return (
/(검색|찾|조사|다운로드|받아|불러|만들|생성|저장|정리|수집|모으|확인|시작|진행|시도|실행|수정|추가|변경|고치|작성|적용|바꾸|렌더|출력)[가-힣\s]{0,5}겠(습니다|다)|시작합니다|(?:let\s+me|i'?ll|i\s+will)\s+(?:search|find|check|look|download|fetch|grab|read|create|make|try)\b/i.test(tail)
);
+6
View File
@@ -547,7 +547,13 @@ describe('isActionPromiseNoTool — 되묻기는 약속이 아니다', () => {
assert.equal(isActionPromiseNoTool('방금 두 번 같은 문장을 보내 주셨는데, 합칠 원문을 다시 붙여 주시면 바로 정리해 드리겠습니다.'), false);
assert.equal(isActionPromiseNoTool('파일을 올려 주시면 확인하겠습니다.'), false);
});
test('10-22 닥터앱 실측: "~필요하면 검색해 드리겠습니다"도 조건부 제안', () => {
assert.equal(isActionPromiseNoTool('스타틴은 HMG-CoA 환원효소를 억제합니다.\n\n더 자세한 근거나 최신 연구가 필요하면 검색해 드리겠습니다.'), false);
assert.equal(isActionPromiseNoTool('원하시면 부품 목록도 정리해 드리겠습니다.'), false);
assert.equal(isActionPromiseNoTool('궁금하다면 더 찾아보겠습니다.'), false);
});
test('진짜 실행 예고는 그대로 잡는다', () => {
assert.equal(isActionPromiseNoTool('먼저 GitHub에서 관련 리포지토리를 검색하겠습니다.'), true);
assert.equal(isActionPromiseNoTool('정확한 정보가 필요하므로 검색해 드리겠습니다.'), true);
});
});