Repository navigation
fix(server): promote Claude account revive queue and rebalance to bkmain (#322) - #323
Closed
bk-agent-01 wants to merge 4 commits into
Closed
bk-agent-01 wants to merge 4 commits into
bk-agent-01 wants to merge 4 commits into
Conversation
…spread load - A failed hard-limit move no longer leaves the rejection in the duplicate filter, so a new turn's rejection moves the thread (2026-10-16: a thread stayed on `sam` for 20 min while `tushar` had room). - Limit notices expire at their reset; the "all accounts are at their limit" notice is derived live from a durable revive queue (migration 1053). - A thread no account can take is parked and continued in waves as accounts reset (revive pass after every status poll); the 5-minute reset wait is now a queue entry, so a restart no longer loses it. - Auto threads move off an account over its fair share at turn boundaries, at most once an hour. - New claudeAccounts.leaveQueue RPC and a "Leave queue" item in the picker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…alance - A revive checks it still owns the queue entry before it moves or continues the thread, so Leave queue / a user message during placement wins. - The duplicate filter forgets a condition after a successful move and when the first turn on the new account starts. - Rebalance runs only at a real turn end, pre-checks the last status before asking the switcher, backs off 5 min after a probe finds nowhere better, moves at most one thread per source account per status read, and writes only the row so the old session keeps its own attribution. - Parking no longer forks a revive pass; archived threads leave the queue; a passed reset time is no longer shown as expected. - Test counts for the new RPC (237) and migration 1053; formatting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…very turn start forgets stale limit keys Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…turn in flight The provider-level idle check also counted the failed turn that parked the thread, so a mid-turn thread never got its continue. Test for the race. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closed on Tushar's instruction (2026-10-17): promote the full |
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
This PR promotes the Claude account server fix from #322 (merged into
stageasfd41ddad) tobkmain. It contains only the 4 commits of #322, cherry-picked ontoorigin/bkmain, so it carries none of the other stage-only merges (#317, #319, #320).Production still shows the problem from 2026-10-16. A limit hit can leave a thread on a full account with a stale "All Claude accounts are at their limit" banner while other accounts have room. At 17:0x UTC, a production thread hit the
barsha5-hour limit, and a person had to change its account by hand.ThreadClaudeAccount.wait, theclaudeAccounts.leaveQueueRPC, and "Leave queue" in the picker.The new switcher (bk-docs #1143,
space-share-v2) is already live on dev-server-1 and suppliesfair_shareandrecoveries.How I tested
34d6ad4b5e(all jobs except the Blacksmith artifact job, which never starts in this fork). Two fresh-context code reviews found no open bug.fd41ddad. No limit event happened on stage after the deploy, so production is the first real check. After the deploy, I read theclaude.account.*lines (place-none,revived,rebalance,hard-limit) of the next production limit event.Risks and rollback
thread_claude_account. Older code ignores them.bkmain.🤖 Generated with Claude Code (Claude Opus 5.5, T3 Code)