Skip to content

fix: ask the head poll for 100 comments and log only long empty streaks - #102

Merged
Toldry merged 1 commit into
masterfrom
claude/project-thread-wz5dwe
Oct 17, 2026
Merged

Toldry merged 1 commit into
masterfrom
claude/project-thread-wz5dwe

Conversation

@Toldry

@Toldry Toldry commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Requested by Querent · project thread

Before: on 3.1.1 the VM logged The r/all comment listing returned no comments (WARNING) and ... has comments again after N empty poll(s) (INFO) about every 30 seconds. Reddit was returning an empty r/all listing on roughly every other head poll with limit=25. Nothing was lost, since the next poll queues every block up to the head, but the log was flooded.

After: the head poll asks for 100 comments, the most one request can return. Reddit filters the listing after applying the limit, so a bigger limit should make empty pages rarer. Empty polls are counted in the heartbeat (head: 50 polls (12 empty), 1.70 s/poll). A WARNING is logged only after EMPTY_HEAD_POLLS_BEFORE_WARNING (6) empty polls in a row, which is about a minute without new blocks being queued. A matching INFO line is logged when such a streak ends.

How: HEAD_LISTING_LIMIT goes from 25 to 100. CommentReader.poll_head logs only at the streak threshold, and StreamMetrics.record_head_poll(seconds, empty=False) counts empty polls. This adds unit tests and updates AGENTS.md and a changelog fragment.


Generated by Claude Code

Co-Authored-By: Toldry <toldry@gmail.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019ddUNNyEKK7YQuAyfKfGwi
@Toldry Toldry self-assigned this Oct 16, 2026
@Toldry
Toldry merged commit 026a5c4 into master Oct 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants