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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user