Repository navigation
bot: a failed newest history page is reported, once an hour per bot - #973
Merged
Merged
Conversation
The newest-hands loop of the history download dropped a failed page
without a line: `fetch_page` returned a bare `None` on any 5xx and the
loop broke. On 2026-10-12 the venue answered HTTP 500 after about 11 s
for four of the five bot keys, so their history stores had stopped
growing one after another over eight days (the oldest, Svanar, 13,147
live hands behind) and the log said nothing.
`fetch_page` now returns the reason (`Err("HTTP 500")`, a body that is
not JSON, or the last transport error), and the newest-hands loop logs
it as a warning, at most once an hour per bot; a page that comes back
clears the bot's hour. The backfill path, which already names a repeated
failure, ignores the reason as before.
Closes #971.
Generated-by: claude-code/claude-sonnet-5-5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 12, 2026
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.
What generated this?
Generated-by: claude-code/claude-sonnet-5-5
Motivation
Closes #971.
The newest-hands loop of the history download drops a failed page without a log line:
fetch_pagereturns a bareNoneon any 5xx and the loop breaks (crates/apps/bot/src/history/download.rs). A read-only probe on 2026-10-12 (GET /me/hand-history?limit=1, one per key, approved by the operator) gave HTTP 200 for SvanBotV10 and HTTP 500 after about 11 s for the other four keys. Their history stores had stopped growing one after another over eight days (newest row: Svanar 10-04 23:40, 13,147 live hands behind; SuraGunnar 10-10 18:59; Svanism 10-11 05:10; SurSvan 10-11 21:24) and the log held only the hourly season refresh.Solution
One change in
crates/apps/bot/src/history/download.rs:fetch_pagereturnsResult<Value, String>:Err("HTTP 500")for a 5xx, the status after the 429 and other retries,a 200 body that is not JSON, or the last transport error. The key travels only in the request header, never in these strings.note_newest_failure, at most once an hour per bot (the loop runs hourly once every bot is done, every minute while one is not, so the limiter only matters for the one-minute case). A page that comes back clears the bot's hour.Tests:
a_server_error_page_comes_back_with_its_status(a local listener answering 500) anda_failed_newest_page_is_reported_once_an_hour_per_bot. The new API does not exist onorigin/main, so before the change they cannot compile; to show they assert behaviour, I disabled the fix (no log line, empty reason) and both failed (left 0, right 1; left "", right "HTTP 500"), then restored it. The stage-1 call site that connects the two is covered by reading, not by a test.Log-only change off the decision path: no paired simulation, no golden change. The cause of the 500 is on the venue's side and is not addressed here. Not released: the installed build is 0e3d584.
Checklist
scripts/check.sh fullpasses on this exact commit (0d96c89), run in a worktree on the shared warmtarget/dev:Generated-by:is in the commit footer and in the section above.🤖 Generated with Claude Code