fix(post-3.5c): nemoton dispatcher IP 殘留集中化

餘震 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 處理)
This commit is contained in:
OoO
2026-04-28 11:37:36 +08:00
parent 60a7917634
commit b954cc37cf

View File

@@ -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,