From 81476cbaa108d1862a4a1a51d1965fa8e1a4954c Mon Sep 17 00:00:00 2001 From: kim Date: Thu, 22 Oct 2026 14:53:03 +0900 Subject: [PATCH] =?UTF-8?q?=EB=82=A0=EC=94=A8=20=EB=8F=84=EA=B5=AC=20?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=ED=8A=B8:=20'=EB=B9=84=EC=98=A4=EB=82=98/?= =?UTF-8?q?=EB=B9=84=20=EC=98=A4=EB=A0=A4=EB=82=98/=EB=B9=84=EC=98=A4?= =?UTF-8?q?=EB=8A=94=EC=A7=80'=20=EA=BC=B4=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=E2=80=94=20'=EC=A3=BC=EB=A7=90=EC=97=90=20=ED=98=84=ED=92=8D?= =?UTF-8?q?=20=EB=B9=84=EC=98=A4=EB=82=98=3F'=EC=97=90=20weather=5Fkma?= =?UTF-8?q?=EA=B0=80=20=EB=B9=A0=EC=A0=B8=20web=5Fsearch=EB=A1=9C=20?= =?UTF-8?q?=EB=8B=B5=ED=96=88=EC=9D=8C?= 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/tool-scope.ts | 3 +++ tests/tool-scope.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gateway/chat/tool-scope.ts b/src/gateway/chat/tool-scope.ts index 9a3708e..b459eb8 100644 --- a/src/gateway/chat/tool-scope.ts +++ b/src/gateway/chat/tool-scope.ts @@ -258,6 +258,9 @@ export function buildSkillToolFilter(input: ToolScopeInput): (toolName: string) // "소식" 단독은 절대 넣지 않는다 — 회사 소식·업계 소식·새로운 소식에 다 걸린다. || new RegExp(`(${WEATHER_PHENOMENON})\\s*(소식|예보|전망|상황)`).test(topicText) || /비가\s*(오|와|내리|올)|비\s*(온다|와요|올까|내려)|비가?\s*(?:많이|조금|얼마나|좀|꽤|엄청)?\s*(?:왔|내렸|오고|내리고)|소나기|호우|폭우|우산/.test(topicText) + // 10-22 실사고: "주말에 현풍 비오나?"가 위 목록에 안 걸려(비가/비 온다 꼴만 있었음) web_search로 갔다. + // 앞 글자가 한글이면 제외(준비·경비 등). + || /(? { // 실제 사고: "향후 비소식은 없나?"에 날씨 키워드가 하나도 안 걸려 weather_* 가 스키마에서 // 빠졌고, 모델은 web_search로 2019년 기사를 물어와 "예보를 확인할 수 없다"고 답했다. // 이어서 "기상청에 알아봐"라고 명시했는데 그것도 안 걸려 두 번째 턴까지 같은 실패. - for (const msg of ['향후 비소식은 없나?', '오늘 영남지역 비소식 있나?', '기상청에 알아봐', '내일 비 와요?', '주말에 소나기 오나', '오늘 서울에 비가 많이 왔나?', '어제 비 왔어?']) { + for (const msg of ['향후 비소식은 없나?', '오늘 영남지역 비소식 있나?', '기상청에 알아봐', '내일 비 와요?', '주말에 소나기 오나', '오늘 서울에 비가 많이 왔나?', '어제 비 왔어?', '주말에 현풍 비오나?', '내일 비 오려나', '비오는지 봐줘']) { assert.equal(filterFor(msg)('weather_kma'), true, msg); } }); @@ -109,7 +109,7 @@ describe('키워드 게이트 — 필요할 때 확실히 나타난다', () => { }); test('"비"는 문맥형으로만 잡는다 — 비용·비교·준비에 걸리면 안 된다', () => { - for (const msg of ['서버 비용이 얼마야', 'A와 B 비교해줘', '발표 준비 도와줘', '비트코인 시세']) { + for (const msg of ['서버 비용이 얼마야', 'A와 B 비교해줘', '발표 준비 도와줘', '비트코인 시세', '준비오나 확인', '경비오면 알려줘']) { assert.equal(filterFor(msg)('weather_kma'), false, msg); } });