From 1ea66530af60a940927939eb9186d106b7607c70 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Mon, 13 Apr 2026 13:45:40 +0900 Subject: [PATCH] =?UTF-8?q?fix(nanoclaude):=20infra=20pre-route=20?= =?UTF-8?q?=ED=82=A4=EC=9B=8C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit docker/컨테이너/디스크/헬스체크/tailscale/모델 키워드를 infra 도구로 직접 라우팅. EXAONE classifier 의존 없이 확실한 매칭. Co-Authored-By: Claude Opus 4.6 (1M context) --- nanoclaude/services/worker.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/nanoclaude/services/worker.py b/nanoclaude/services/worker.py index 696c6f2..1b32e51 100644 --- a/nanoclaude/services/worker.py +++ b/nanoclaude/services/worker.py @@ -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 ["돌아", "일하", "작동", "상태", "건강", "살아", "대기", "큐", "밀려", "바빠", "느려", "많"])):