Skip to content

fix(auto): a reset already passed is re-checked at cadence, not crawled - #60

Merged
deathemperor merged 1 commit into
mainfrom
fix/exhausted-past-reset
Sep 24, 2026
Merged

deathemperor merged 1 commit into
mainfrom
fix/exhausted-past-reset

Conversation

@deathemperor

Copy link
Copy Markdown
Owner

When every account reads spent but one's stored reset is already behind the clock, earliest_recovery returned None ("unprovable"). The engine then reported all-exhausted with earliestResetAt: null and slept the 300 s no-reset fallback. That account had come back at its reset: its reading just predated the rollover, and its row was due for a refetch within a minute. Seen live on 2026-09-24. The active account hit its 5h limit at 16:00:56Z, a minute after death4's 5h reset. The daemon ignited death4, declared all-exhausted, slept five minutes and only switched at 16:06:13Z, so every session stayed stopped at the limit in between.

Fix: the past reset is kept. sleep_until then sits in the past, schedule floors it at the plain interval, and the next tick's fetch shows the account back and lands the switch. A spent account with no reset at all is still unprovable and still crawls. earliestResetAt now names the reset that passed.

Test: a_reset_already_passed_is_rechecked_at_cadence_not_crawled fails on main (earliestResetAt null, 300 s sleep) and passes with the fix: interval sleep, then Switched onto the returned account. cargo test, cargo clippy --all-targets, cargo fmt --check all clean.

Claude Opus 5.5 via Claude Code.

🤖 Generated with Claude Code

When every account read spent but one's stored reset was already behind
the clock, earliest_recovery returned None ("unprovable"), so the engine
reported all-exhausted with no earliestResetAt and slept the 300 s
no-reset fallback. That account had come back at its reset; its reading
only predated the rollover and its row was due again within a minute.
Keeping the past reset makes schedule wait the plain interval, and the
next tick's fetch lands the switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@deathemperor
deathemperor merged commit 6a0a6dc into main Sep 24, 2026
6 checks passed
deathemperor added a commit to deathemperor/infinitus that referenced this pull request Sep 24, 2026
…after a minute (deathemperor/swapd#60) (#1586)

With every account at its limit and one account's stored reset already
behind the clock, the daemon read that as "no provable recovery" and
slept five minutes, past the moment the account came back. On
2026-09-24 every session stayed stopped at the limit from 16:00:56Z
until the switch at 16:06:13Z. swapd#60 keeps the passed reset, so the
next tick comes after the plain interval and the fetch lands the switch.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant