From 0671d49e0eb7b508bdea4ae6aeac171fc9d4d4d7 Mon Sep 17 00:00:00 2001 From: kim Date: Thu, 22 Oct 2026 16:02:09 +0900 Subject: [PATCH] =?UTF-8?q?Claude=20=EB=AA=A8=EB=8D=B8=EC=97=90=EC=84=A0?= =?UTF-8?q?=20ACTION-PROMISE=20=EB=84=9B=EC=A7=80=EC=99=80=20NUMERIC-GROUN?= =?UTF-8?q?DING=20'=EC=97=86=EB=8B=A4/=EB=AF=B8=EA=B3=B5=EA=B0=9C'=20?= =?UTF-8?q?=EC=A3=BC=EC=9E=A5=20=EA=B2=80=EC=82=AC=EB=A5=BC=20=EB=81=94(Ha?= =?UTF-8?q?iku=20=EC=A0=84=ED=99=98=20=ED=9B=84=20=EC=8B=A4=EC=B8=A1:=20?= =?UTF-8?q?=EC=95=BD=EC=86=8D=20=EA=B0=80=EB=93=9C=20=EC=8B=A4=EB=8C=80?= =?UTF-8?q?=ED=99=94=206=EA=B1=B4=20=EC=A4=91=205=EA=B1=B4=20=EC=98=A4?= =?UTF-8?q?=ED=8C=90,=20=EB=B6=80=EC=9E=AC=EC=A3=BC=EC=9E=A5=206=EA=B1=B4?= =?UTF-8?q?=20=EC=A0=84=EB=B6=80=20=EB=A7=9E=EB=8A=94=20=EB=A7=90=EC=9D=84?= =?UTF-8?q?=20=EB=90=98=EB=8F=8C=EB=A6=BC).=20=EC=88=AB=EC=9E=90=C2=B7?= =?UTF-8?q?=EB=82=A0=EC=A7=9C=20=EA=B2=80=EC=82=AC=EC=99=80=20=EB=B9=84Cla?= =?UTF-8?q?ude=20=EB=AA=A8=EB=8D=B8=20=EB=8F=99=EC=9E=91=EC=9D=80=20?= =?UTF-8?q?=EA=B7=B8=EB=8C=80=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- src/gateway/chat/handle-chat.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gateway/chat/handle-chat.ts b/src/gateway/chat/handle-chat.ts index 962f758..0a20798 100644 --- a/src/gateway/chat/handle-chat.ts +++ b/src/gateway/chat/handle-chat.ts @@ -1992,8 +1992,12 @@ async function handleChat( // 수정하겠습니다. 잠시만 기다려 주세요."로 또 끝났는데, 이 가드가 "도구 0개 + 넛지 1회"라 두 번째 // 약속은 아무 망에도 안 걸려 그대로 정지했다. 이제 넛지 2회까지, 도구를 이미 썼어도 // 행동 예고 + "잠시만 기다려" 가 함께 있으면(좁은 조건) 잡는다. + // 2026-10-22 실측: Haiku 전환(10-17) 후 실제 대화 발동 6건 중 5건이 오판(되묻기·조건부 제안을 약속으로 봄), + // 넛지가 맞는 답을 망쳤다. 이 가드는 gemma류의 '예고하고 멈춤' 버릇용이라 Claude 모델에선 끈다(코드는 유지). + const _isClaudeModelThisRound = /claude|haiku|sonnet|opus/i.test(resolvedModelThisRound); const shouldNudgeActionPromise = - actionPromiseNudges < 2 + !_isClaudeModelThisRound + && actionPromiseNudges < 2 && (allToolResults.length === 0 ? isActionPromiseNoTool(candidateText) : isActionPromiseNoTool(candidateText) && isDeferralPromiseReply(candidateText)); @@ -2129,14 +2133,25 @@ async function handleChat( if (!_numeric.sourceOnTopic) { console.log(`[v2] NUMERIC-GROUNDING: standing down — search results cover only ${(_numeric.sourceCoverage * 100).toFixed(0)}% of the query's terms, so they cannot show the answer's figures were fabricated.`); } + // 2026-10-22: '없다/미공개' 주장 검사는 Claude 모델에서 끈다 — Haiku 전환 후 6건 전부 맞는 말 + // ("Haiku 구조는 공개하지 않음", "항모 위치 공개 안 됨")을 되돌렸다. 숫자 검사는 그대로. + // 숫자·날짜 쪽도 근거가 없으면 그쪽 재요청은 그대로 탄다(부재 주장만으로 걸린 경우만 건너뜀). + const _figuresOrDateUnsupported = (!!_numeric.primaryClaim && _numeric.unsupported.includes(_numeric.primaryClaim)) + || _numeric.dateUnsupported; + const _skipNonexistenceForClaude = _numeric.nonexistenceUnsupported && !_figuresOrDateUnsupported + && /claude|haiku|sonnet|opus/i.test(resolvedModelThisRound); + if (_skipNonexistenceForClaude && _numeric.allUnsupported) { + console.log('[v2] NUMERIC-GROUNDING: non-existence check skipped for Claude model'); + } const shouldForceNumericRetry = _numeric.allUnsupported + && !_skipNonexistenceForClaude && numericGroundingForcedRetries < MAX_NUMERIC_GROUNDING_FORCED_RETRIES; if (shouldForceNumericRetry) { numericGroundingForcedRetries++; // The "rewrite using only sourced numbers" wording below is the wrong instruction for a // non-existence claim — that answer has no figures to rewrite, and its problem is the // opposite (it declined to answer, using a made-up fact as the excuse). Give it its own. - if (_numeric.nonexistenceUnsupported && _numeric.nonexistenceClaim) { + if (_numeric.nonexistenceUnsupported && _numeric.nonexistenceClaim && !/claude|haiku|sonnet|opus/i.test(resolvedModelThisRound)) { const _claim = _numeric.nonexistenceClaim; console.log(`[v2] NUMERIC-GROUNDING POST-CHECK (${numericGroundingForcedRetries}/${MAX_NUMERIC_GROUNDING_FORCED_RETRIES}): unsupported non-existence claim ["${_claim}"] not found in tool output. Re-prompting...`); sendSSE('info', { message: 'Re-prompting model: "not released yet" claim was not in the search results...' });