GROUNDING_TOOL_PATTERN에 pubmed/law/case-search/sqlite_query 추가

memory_stats 버그와 같은 클래스의 문제를 전체 도구 목록에서 재점검.
pubmed_search/fetch/fulltext, openalex_search는 도구 설명 자체가 "웹검색
대신 이걸 써라"인데도 AUTO-RECOVER가 그 지시를 무시하고 웹검색을 강제하고
있었음. korean_law_search/fetch, us_case_search, sqlite_query도 조작이
아닌 실제 조회값이라 같은 이유로 추가.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Sonnet 5 committed 2026-08-06 15:56:47 +09:00
1 parent 0c03581fcf
commit b0345e24d4
1 file changed
+13 -1
+13 -1
View File
@@ -37,8 +37,20 @@ import {
// isExemptFromVerification, just discovered via a tool call instead of an input phrasing). The
// model then got a useless web result, contradicted its own already-correct answer, and gave a
// non-answer instead of just repeating the tool's number.
//
// Audited the rest of the tool list the same day for the same gap — any tool whose own
// description already tells the model to use it *instead of* web_search, or that queries an
// authoritative external/local source directly (so its numbers are retrieved, not fabricated),
// belongs here too:
// - pubmed_search/pubmed_fetch/pubmed_fulltext, openalex_search — both literally say "Do NOT
// use web_search/browser_open for this" in their own tool descriptions; AUTO-RECOVER was
// overriding that instruction and forcing web_search anyway.
// - korean_law_search/korean_law_fetch (국가법령정보센터 API), us_case_search (CourtListener)
// — legal answers routinely cite 원/% figures pulled from these, not memorized.
// - sqlite_query — a real SQL query against a workspace .db file; whatever number comes back
// is retrieved from that file, not hallucinated, same logic as memory_stats.
/** Tools that can actually ground a factual/live-data answer. Anything else does not count. */
export const GROUNDING_TOOL_PATTERN = /^(web_search|web_fetch|weather_|ollama_web_|news_search|memory_stats)/i;
export const GROUNDING_TOOL_PATTERN = /^(web_search|web_fetch|weather_|ollama_web_|news_search|memory_stats|pubmed_search|pubmed_fetch|pubmed_fulltext|openalex_search|korean_law_search|korean_law_fetch|us_case_search|sqlite_query)/i;
export interface AutoRecoverInput {
/** The user's message this turn. */