fix: 配置接线审查修复(push数值哨兵化/恒真测试修正/哨兵防漂移/种子映射消双路径)

Important-1: push 数值字段(timeout/max_attempts/retry_backoff_base)
出厂默认改 None 哨兵(与 ai.model 同款),resolve_push_settings 对 None
回退 env——根治 truthy 出厂默认永久遮住 env 覆盖;恒真测试修正(env 数值
patch 成 7.5/5/2.0 与出厂区分)+租户显式数值优先断言;ai.provider 遮
env 的边界记入 docstring。Minor-2: 出厂 model 哨兵与 DEFAULT_CONFIG
一致性测试 + defaults.py 双源注释(model/rate_limit_per_hour)。
Minor-4: allowed_seed_keys → context_seed_map(返回映射,单一取值路径)。
Minor-6/7/3/8: WS 配置冻结时机注释/name_to_region 查表序注释改准确/
chat_rest limit 0 语义注释/resolver None 路径仅供测试注释。404 全绿。

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-10-12 21:57:57 +08:00
parent 32b582aac8
commit 49e2b476f5
7 changed files with 74 additions and 29 deletions
+13 -4
View File
@@ -13,10 +13,19 @@ DEFAULT_CONFIG: dict = {
"wall": {}, # wall 由租户 seed 的 wall.json 提供,出厂留空
"contact": {"cc_completion": True, "email_light_ask": True, "template_languages": ["en", "zh", "es"]},
"email": {"smtp": None, "sender_name": "", "notify_emails": []},
"push": {"enabled": False, "url": "", "api_key": "", "prefix": "", "timeout": 10,
"max_attempts": 3, "retry_backoff_base": 1.0},
"ai": {"provider": "glm", "api_key": None, "base_url": None, "model": "glm-4-flash"},
"engine": {"context_seed_keys": {}, "rate_limit_per_hour": 30,
# 数值字段出厂哨兵 None = "未设置"(与 ai.model 同款纪律):
# resolve_push_settings 对 None 回退 env PUSH_*(settings 自带部署级默认,
# 最终行为不变)——truthy 出厂默认(10/3/1.0)会永久遮住 env 同名覆盖
"push": {"enabled": False, "url": "", "api_key": "", "prefix": "",
"timeout": None, "max_attempts": None, "retry_backoff_base": None},
"ai": {"provider": "glm", "api_key": None, "base_url": None,
# 双源防漂移: 出厂 model 须与 ai_service._FACTORY_DEFAULT_MODEL 一致
# (resolve_ai_settings 的"未设置"哨兵;测试强制同步)
"model": "glm-4-flash"},
"engine": {"context_seed_keys": {},
# 双源防漂移: 默认值须与 rate_limit.DEFAULT_MAX 一致
# (chat_rest 空槽兜底读它)
"rate_limit_per_hour": 30,
# 双源防漂移: 默认值须与 conn_limiter.DEFAULT_WS_CONN_LIMIT 一致
"ws_conn_limit": 10},
"misc": {"name_to_region_extras": {}},