From a9da944a5d249b8ede47e887ab4a8285984e09b1 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Tue, 17 Mar 2026 03:50:45 -0700 Subject: [PATCH] fix(dingtalk): requirements check passes with only one credential set check_dingtalk_requirements() used 'and' to check for missing env vars: if not CLIENT_ID and not CLIENT_SECRET: return False This only returns False when BOTH are missing. If only one is set (e.g. CLIENT_ID without CLIENT_SECRET), the check passes and connect() fails later with a cryptic error. Fix: Change 'and' to 'or' so it returns False when EITHER is missing. --- gateway/platforms/dingtalk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/platforms/dingtalk.py b/gateway/platforms/dingtalk.py index 38a802641..8ed376962 100644 --- a/gateway/platforms/dingtalk.py +++ b/gateway/platforms/dingtalk.py @@ -60,7 +60,7 @@ def check_dingtalk_requirements() -> bool: """Check if DingTalk dependencies are available and configured.""" if not DINGTALK_STREAM_AVAILABLE or not HTTPX_AVAILABLE: return False - if not os.getenv("DINGTALK_CLIENT_ID") and not os.getenv("DINGTALK_CLIENT_SECRET"): + if not os.getenv("DINGTALK_CLIENT_ID") or not os.getenv("DINGTALK_CLIENT_SECRET"): return False return True