Skip to content

Rotate /go review accounts through docket's account list - #253

Merged
haacked merged 1 commit into
mainfrom
haacked/rotate-claude-accounts
Oct 23, 2026
Merged

haacked merged 1 commit into
mainfrom
haacked/rotate-claude-accounts

Conversation

@haacked

@haacked haacked commented Oct 23, 2026

Copy link
Copy Markdown
Owner

When the account that /go reviews under hits its usage limit, the review falls back to whatever account the /go session runs on. docket already keeps an ordered list of review accounts and a log of which ones are over a limit, so the two tools disagree about which account to use. A /go review also starts on an account docket already knows is limited, waits for claude to refuse it, and only then retries.

The review runner now reads claude_config_dir and claude_fallback_config_dirs from docket's config.toml and orders them the way docket's account.Pick does. It skips accounts that limits.jsonl shows as still limited. On a usage limit with an unchanged checkout, it retries on the next account, and after the list on the session's own account if the list leaves it out. It reads docket's log but never writes to it. The rotation rule is a Python port of docket's Go code, so a change to docket's rotation needs the same change here. GO_REVIEW_CLAUDE_CONFIG_DIR is gone, and the runner now needs Python 3.11 for tomllib.

Test plan

  • python3 ai/skills/go/scripts/tests/test_run_review.py passes, including new tests for rotation order, recorded limits, the default-account spellings, and an unreadable or relative config.
  • ai/tests/test-canonical-skills.sh, test-skill-spec.sh, and test-plain-writing-contract.sh pass.
  • Against the real docket config with ~/.claude-automation limited, the runner picks ~/.claude, the same account docket picks.
  • Run /go through its Review step while an account is limited and confirm the review lands on the backup account.

https://claude.ai/code/session_013PZWPUEwzpVAms9RexAz8t

The review runner reads claude_config_dir and claude_fallback_config_dirs from docket's config.toml and orders them as docket's account.Pick does. It skips accounts that docket's limits.jsonl shows as over a usage limit. On a usage limit with an unchanged checkout, it retries on the next account, then on this session's account when the list leaves it out. Removes GO_REVIEW_CLAUDE_CONFIG_DIR.

Claude-Session: https://claude.ai/code/session_013PZWPUEwzpVAms9RexAz8t
@haacked
haacked marked this pull request as ready for review October 23, 2026 17:32
@haacked
haacked merged commit 644c6c3 into main Oct 23, 2026
1 check passed
@haacked
haacked deleted the haacked/rotate-claude-accounts branch October 23, 2026 17:33
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