让免费层限流的报告跟真实限流一致,并给少一块结果的静默失败留下函数名和错误类型。

Co-Authored-By: Grok (agent loop)
This commit is contained in:
jesse-ux
2026-10-15 23:12:56 +08:00
co-authored by Grok (agent loop)
parent e4ff62c738
commit a7162db271
38 changed files with 706 additions and 129 deletions
+7 -1
View File
@@ -516,6 +516,9 @@ def test_high_rigor_vedastro_official_summary_passes_through_contract_fields(mon
monkeypatch.delenv('VEDASTRO_FREE_TIER_QUEUE', raising=False)
monkeypatch.delenv('VEDASTRO_FREE_TIER_QUEUE_ENABLED', raising=False)
monkeypatch.delenv('VEDASTRO_ENABLE_FREE_TIER_QUEUE', raising=False)
monkeypatch.delenv('VEDASTRO_API_KEY', raising=False)
monkeypatch.delenv('VEDASTRO_FREE_TIER_MAX_REQUESTS', raising=False)
monkeypatch.delenv('VEDASTRO_FREE_TIER_WINDOW_SECONDS', raising=False)
handler = _handler()
chart = {
@@ -564,7 +567,10 @@ def test_high_rigor_vedastro_official_summary_passes_through_contract_fields(mon
assert runtime_truth['fallback_active'] is True
assert runtime_truth['blocked_items'] == ['official_event_radar_partial']
assert runtime_truth['free_tier_strategy']['using_free_tier'] is True
assert runtime_truth['free_tier_strategy']['queue_enabled'] is False
# 原值:False
# 新值:True
# 原因:没设置已废弃的排队开关时,官方免费层默认仍在限流。报告改为跟随真实限流。
assert runtime_truth['free_tier_strategy']['queue_enabled'] is True
assert runtime_truth['free_tier_strategy']['cache_hit'] is False
assert runtime_truth['free_tier_strategy']['guard_status'] == 'degraded_or_partial'