From b954cc37cf46463dbfe7748183a45ee50a2640fb Mon Sep 17 00:00:00 2001 From: OoO Date: Tue, 28 Apr 2026 11:37:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(post-3.5c):=20nemoton=20dispatcher=20IP=20?= =?UTF-8?q?=E6=AE=98=E7=95=99=E9=9B=86=E4=B8=AD=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 餘震 C-1: - services/nemoton_dispatcher_service.py:287 env fallback hardcoded 192.168.0.111,違反 ADR-008 集中化原則 - 改從 config.HERMES_URL 集中讀取 Out-of-scope finding(不在本次修復範圍): - line 286 仍寫死 "qwen2.5:7b-instruct",但實際模型是 hermes3:latest (與 hermes_analyst_service.py:30 不一致,應由後續 PR 處理) --- services/nemoton_dispatcher_service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/nemoton_dispatcher_service.py b/services/nemoton_dispatcher_service.py index 497b2fc..0ba59a8 100644 --- a/services/nemoton_dispatcher_service.py +++ b/services/nemoton_dispatcher_service.py @@ -26,6 +26,8 @@ from typing import Optional import requests from services.mcp_context_service import build_mcp_context +from config import HERMES_URL # ADR-008 集中化:禁止硬編碼 IP + logger = logging.getLogger(__name__) @@ -284,7 +286,7 @@ def _build_footprint_json(hermes_stats: Optional[dict], nim_stats: Optional[dict if hermes_stats: result["analyst"] = { "model": "qwen2.5:7b-instruct", - "host": os.getenv("HERMES_URL", "http://192.168.0.111:11434"), + "host": HERMES_URL, # ADR-008:集中讀取,禁止硬編碼 IP "duration_sec": hermes_stats.get("duration_sec", 0), "tokens": hermes_stats.get("tokens", 0), "cost_usd": 0,