fix(nanoclaude): infra pre-route 키워드 추가

docker/컨테이너/디스크/헬스체크/tailscale/모델 키워드를
infra 도구로 직접 라우팅. EXAONE classifier 의존 없이 확실한 매칭.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-13 13:45:40 +09:00
parent 1abec083e7
commit 1ea66530af
+24
View File
@@ -189,6 +189,30 @@ def _pre_route(message: str) -> dict | None:
if query:
return {"action": "tools", "tool": "document", "operation": "search", "params": {"query": query}}
# 인프라 도구 키워드
infra_keywords = ["docker", "컨테이너", "디스크", "용량", "헬스체크", "tailscale", "ollama 모델", "mlx 모델"]
if any(k in msg for k in infra_keywords):
# docker/컨테이너 상태
if any(k in msg for k in ["docker", "컨테이너"]):
host = "nas-company" if any(k in msg for k in ["nas", "회사"]) else "gpu"
return {"action": "tools", "tool": "infra", "operation": "status", "params": {"host": host}}
# 디스크
if any(k in msg for k in ["디스크", "용량"]):
host = ""
if "gpu" in msg: host = "gpu"
elif any(k in msg for k in ["맥미니", "macmini", "mac mini"]): host = "macmini"
return {"action": "tools", "tool": "infra", "operation": "disk", "params": {"host": host}}
# 헬스체크
if "헬스" in msg or "health" in msg:
return {"action": "tools", "tool": "infra", "operation": "health", "params": {}}
# tailscale
if "tailscale" in msg or "네트워크" in msg:
return {"action": "tools", "tool": "infra", "operation": "network", "params": {}}
# 모델 목록
if any(k in msg for k in ["ollama 모델", "mlx 모델"]):
host = "mlx" if "mlx" in msg else "gpu"
return {"action": "tools", "tool": "infra", "operation": "models", "params": {"host": host}}
# 시스템 상태 질문 — 마커만 반환 (worker에서 비동기 조회)
if any(k in msg for k in ["추론 모델", "gemma", "젬마", "서버 상태", "시스템 상태"]) or \
(any(k in msg for k in ["상태", "젬마", "gemma"]) and any(k in msg for k in ["돌아", "일하", "작동", "상태", "건강", "살아", "대기", "", "밀려", "바빠", "느려", ""])):