Skip to content

fix(loop): reselect across full backend priority after a global limit - #248

Merged
ProtocolWarden merged 1 commit into
mainfrom
fix/controller-global-limit-fallback
Jun 7, 2026
Merged

fix(loop): reselect across full backend priority after a global limit#248
ProtocolWarden merged 1 commit into
mainfrom
fix/controller-global-limit-fallback

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

Problem

A global Claude limit (5h session / account cap) cools both claude and opus, 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 to codex — 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 passed
  • ruff check clean

Fix authored in a Codex session; verified and landed via worktree off main (live checkout on goal/3476567d untouched). Running controller needs a restart to pick this up.

🤖 Generated with Claude Code

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
ProtocolWarden merged commit 59f3eb8 into main Jun 7, 2026
15 checks passed
@ProtocolWarden
ProtocolWarden deleted the fix/controller-global-limit-fallback branch June 7, 2026 18:14
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>
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