refactor(decision_manager): I2 DI 化 MCP Providers + fix config list type bug

- DecisionManager.__init__ 注入 SSHProvider/K8sProvider,移除函數內 import+實例化
- config.get_tg_user_whitelist() 支援 list 輸入(monkeypatch/直接傳入),修復 AttributeError
- LOGBOOK 更新(test fix 6e0ee8b)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-12 13:04:46 +08:00
parent 6e0ee8b413
commit 184b37a8b1
3 changed files with 12 additions and 4 deletions

View File

@@ -400,6 +400,9 @@ class Settings(BaseSettings):
def get_tg_user_whitelist(self) -> list[int]:
"""Parse comma-separated or JSON array user IDs to list[int]"""
raw = self.OPENCLAW_TG_USER_WHITELIST
# 已是 list測試 monkeypatch 或程式碼直接傳入)
if isinstance(raw, list):
return [int(uid) for uid in raw]
if not raw or not raw.strip():
return []
# Handle JSON array format or comma-separated