Attention: long rate-limit item scans active sources only
Per Codex: a paused/retired source with a future retry_after_at shouldn't nag 'rate-limited for 12h+' — it's intentionally out of polling. Scope long_rest to active (matching the other operational items). Test: paused/retired rate-limited sources stay quiet. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -114,3 +114,16 @@ def test_attention_quiet_below_thresholds():
|
||||
{"status": "paused", "content_visible": 1, "last_success_at": "2020-01-01 00:00:00"}, # paused → ignored
|
||||
]
|
||||
assert queries._attention(content, sources, 0, now=now) == []
|
||||
|
||||
|
||||
def test_attention_ignores_rate_limit_on_paused_or_retired():
|
||||
from datetime import UTC, datetime
|
||||
from goodnews import queries
|
||||
now = datetime(2026, 6, 9, 12, 0, 0, tzinfo=UTC)
|
||||
content = {"served": 100, "with_image": 95, "latest_brief_size": 7}
|
||||
sources = [
|
||||
{"status": "paused", "retry_after_at": "2026-06-12 00:00:00"}, # intentionally not polling
|
||||
{"status": "retired", "retry_after_at": "2026-06-12 00:00:00"},
|
||||
]
|
||||
# neither should nag about a rate-limit rest
|
||||
assert queries._attention(content, sources, 0, now=now) == []
|
||||
|
||||
Reference in New Issue
Block a user