Repository navigation
fix: skip an empty r/all head listing instead of crashing the bot - #100
Merged
Merged
Conversation
Reddit sometimes returns no comments for the head poll. fetch_head raised a RuntimeError that handle_exception re-raises, so the process exited and Docker restarted it in a loop, which also SIGKILLed any `exec`'d --process-one run. fetch_head now returns None and poll_head skips that poll. 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
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
added a commit
that referenced
this pull request
Oct 16, 2026
fetch_head now returns None for an empty listing (#100), which the live comment reader test did not expect, so it failed with a TypeError and blocked the deploy of v3.1.1. 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Querent · project thread
Before: when Reddit returned an empty r/all comment listing to the head poll,
fetch_headraisedRuntimeError('The r/all comment listing returned no comments').main.handle_exceptionre-raises unknown errors, so the process exited and Docker restarted the container. On the VM that had happened 71 times by 2026-10-16 21:32 UTC. Each restart also SIGKILLed anydocker compose exec bot python -m racb --process-onerun, which then stopped mid-log with exit code 137 and no error message.After: an empty listing skips that one poll. It logs a WARNING once per streak and an INFO line when comments come back. The next poll queues every block up to the head it finds, so no comment is missed.
How:
fetch_headreturnsNonefor an empty listing, andCommentReader.poll_headreturns early onNoneand counts the streak inempty_head_polls. I added unit tests for the skip, for the catch-up afterwards, and forrun()continuing past an empty listing. AGENTS.md and the changelog fragment are updated too.Generated by Claude Code