diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 1cd86b50a..84bcdd479 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/). +- [修复] 已配置钉钉 Webhook 时不再误报“未配置通知渠道”;钉钉 Stream 仍仅用于交互,不作为定时静态推送渠道。 - [改进] AIHubMix 注册与引流链接统一使用 inferera.com,改善中国大陆网络直连体验。 - [修复] 单股推送模式在未配置通知渠道时仍会落盘本地个股报告;CLI 启动分析若因空股票列表、个股结果全失败或本地报告保存失败而未生成报告,会显式返回失败并记录原因。 - [修复] 合并推送模式下即使个股汇总报告落盘失败,仍会先发送已有的合并通知;仅启用大盘复盘但最终未生成任何复盘内容时,分析任务会显式返回失败。 diff --git a/src/config.py b/src/config.py index a9cf21de0..63699d294 100644 --- a/src/config.py +++ b/src/config.py @@ -3423,6 +3423,7 @@ class Config: # --- Notification channels --- has_notification = bool( self.wechat_webhook_url + or self.dingtalk_webhook_url or self.feishu_webhook_url or ( (self.feishu_app_id or "") diff --git a/tests/test_config_validate_structured.py b/tests/test_config_validate_structured.py index 223873a35..d5c63a69e 100644 --- a/tests/test_config_validate_structured.py +++ b/tests/test_config_validate_structured.py @@ -520,6 +520,15 @@ class TestValidateStructuredNotification: issues = cfg.validate_structured() assert not any(i.severity == "warning" and "通知渠道" in i.message for i in issues) + def test_dingtalk_webhook_counts_as_notification_channel(self): + cfg = _make_config( + wechat_webhook_url=None, + dingtalk_webhook_url="https://oapi.dingtalk.com/robot/send?access_token=test", + ) + issues = cfg.validate_structured() + + assert not any(i.severity == "warning" and "通知渠道" in i.message for i in issues) + @pytest.mark.parametrize( ("kwargs", "missing_field"), [