From 94cdb3a2836b63f97fcd65899d072878f8c9458f Mon Sep 17 00:00:00 2001 From: kim Date: Sun, 18 Oct 2026 19:45:03 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=8C=EC=84=B1=20=EC=A7=80=EB=AA=85=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8:=20=EB=AA=A8=EB=8D=B8=EC=9D=B4=20=EB=AC=B4?= =?UTF-8?q?=EC=8B=9C=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=84=9C=EB=B2=84=EA=B0=80=20=ED=99=95=EC=9D=B8=20=EC=A7=88?= =?UTF-8?q?=EB=AC=B8=EC=9C=BC=EB=A1=9C=20=EC=A7=81=EC=A0=91=20=ED=84=B4?= =?UTF-8?q?=EC=9D=84=20=EB=81=9D=EB=83=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src/gateway/chat/handle-chat.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gateway/chat/handle-chat.ts b/src/gateway/chat/handle-chat.ts index 98e11e0..7970a5e 100644 --- a/src/gateway/chat/handle-chat.ts +++ b/src/gateway/chat/handle-chat.ts @@ -2636,14 +2636,13 @@ async function handleChat( const _alt = _loc ? suspectSoundAlikePlace(_loc) : null; const _lastAsst = String([...history].reverse().find(h => h.role === 'assistant')?.content || ''); if (_alt && !(_lastAsst.includes(_loc) && /말씀|맞으|맞나/.test(_lastAsst))) { - const askMsg = `PLACE CONFIRMATION NEEDED: "${_loc}" sounds like "${_alt}" and may be a speech-recognition error. The weather lookup was NOT run. Reply with ONE short speakable question only — e.g. "${_loc}이 ${_alt} 말씀이세요?" — and nothing else; do not call any tool. If the user confirms "${_loc}" is correct, look it up as written.`; + // 약한 모델(gemma4)은 "되묻기만 하라"는 도구 결과를 무시하고 다른 지명으로 다시 조회했다 — 모델에 맡기지 않고 + // 서버가 직접 확인 질문으로 이번 턴을 끝낸다. + const question = `혹시 ${_loc}이 아니라 ${_alt} 말씀이세요? 맞으면 "응"이라고 하고, 아니면 지명을 다시 말씀해 주세요.`; console.log(`[v2] VOICE PLACE CHECK: "${_loc}" ~ "${_alt}" — asking for confirmation instead of ${toolName}`); - const askResult: ToolResult = { name: toolName, args: toolArgs, result: askMsg, error: false }; - allToolResults.push(askResult); - sendSSE('tool_call', { action: toolName, args: toolArgs, stepNum: allToolResults.length }); - sendSSE('tool_result', { action: toolName, result: askMsg.slice(0, 300), error: false, stepNum: allToolResults.length }); - messages.push({ role: 'tool', name: toolName, tool_name: toolName, tool_call_id: toolCallId || undefined, content: askMsg }); - continue; + sendSSE('info', { message: `음성 인식 확인: "${_loc}" → "${_alt}"?` }); + logToDaily(workspacePath, 'SmallClaw', question, sessionId); + return { type: 'chat', text: question, usage: lastUsage }; } }