fix(loop): reselect across full backend priority after a global limit - #248
Merged
Merged
Conversation
A global Claude limit cools both claude and opus, but the fallback path only checked the immediate alternate (opus) — saw it cooled, and slept until Claude reset instead of falling through to codex. Re-run the full backend selector after applying cooldown state so codex picks up work. Observed live 2026-06-07T15:56Z: controller logged 'using codex' then slept 125m with codex cooldown null. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
ProtocolWarden
added a commit
that referenced
this pull request
Jun 7, 2026
Every OC PR appends an entry at the top of .console/log.md, so each merge to main turned every other open PR CONFLICTING on log.md (this session: #247, #249, #250 all conflicted after #248/#251 merged). A merge=union driver makes git keep both sides' appended lines automatically — no conflict — on every local merge/rebase the loop runs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
A global Claude limit (5h session / account cap) cools both
claudeandopus, but the post-limit fallback path only checked the immediate alternate backend (opus). Seeing it cooled, the controller slept until Claude reset instead of falling through tocodex— observed live 2026-06-07T15:56Z: log said "using codex", then slept 125m with codex cooldown null.Fix
After applying cooldown state, re-run the full backend selector (
claude → opus → codex) via_fallback_backend_after_limit()instead of checking only_alternate_backend(). Regression test covers the global-limit → codex path.Verification
pytest -q tests/test_loop_controller.py→ 24 passedruff checkcleanFix authored in a Codex session; verified and landed via worktree off main (live checkout on
goal/3476567duntouched). Running controller needs a restart to pick this up.🤖 Generated with Claude Code