Repository navigation
fix(runtime): derive account cooling status from its deadline - #480
Merged
caigee-cmd merged 1 commit intoNov 10, 2026
Merged
Conversation
The persisted accounts.status is only rewritten when pool state changes; a cooldown that simply expires leaves status=cooling and its last error behind. Derive the projected status from the authoritative deadline in AccountView/Accounts, keeping active cooldowns and live pool cooldowns untouched.
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.
Summary
accounts.statusis persisted only when pool state changes. When a cooldown simply expires, the row keepsstatus=coolingand its last error, so the console shows a healthy account as cooling indefinitely (observed for ~15h on a Qoder account that answered 200 immediately when pinned).AccountView/Accounts: an expired account-wide cooldown with no live pool cooldown becomesready, and the stalelast_erroris cleared. Active cooldowns and live pool cooldowns are untouched.Why view-level
statusis a cached projection;cooldown_untiland the pool'sdown_untilare authoritative. Read-time derivation also repairs existing stale rows without a migration and cannot drift from the live pool.Tests
go test ./... -count=1go vet ./internal/runtimego test ./internal/runtime -count=1(new unit tests + SQLite-backed stale-row test)python3 scripts/release-notes.py validategit diff --checkNotes
中文摘要:账号冷却到期后,数据库里的
status不会自动重写,控制台会一直显示“冷却中”。现在在生成账号视图时按冷却截止时间判断:已过期且没有实时冷却就显示 ready,并清掉上次错误;仍在冷却中的账号不受影响。不改路由、不写库、不加迁移。