Repository navigation
rate-limit-guard: a lane should drop its latched pause when the account changes #5177
Description
Problem
Loop lanes (work-loop, babysit-loop) pause when either window in ~/.claude/rate-limit-guard/rate-limits.json reaches 90% and latch that window's resets_at as the pause end. plugins/rate-limit-guard/reference/reader-contract.md (around lines 25-35 and 256-257) lets a reader keep a latched resets_at through the whole pause: "a reader that latched a resets_at before a switch has no obligation yet to drop it". So after the active Claude account is switched (by melodic-software/claude-code-account-rotation, or by hand), a paused lane keeps waiting for the OLD account's reset, and the switch does nothing for it.
The writer half already exists: the tee carries account.email. docs/conventions/loop-lane/README.md §6 calls reader-side invalidation and the lane-floor re-audit "not built … No lane acts on the field yet."
Desired behavior
- A paused lane re-evaluates when the tee's
account.emaildiffers from the account it latched against, and drops the latch when the new account's windows are below the pause threshold. - The reader contract states this as an obligation, not an option.
Second gap to decide here
The tee is refreshed only while an interactive session renders a status line (loop-lane README around lines 640-643: "an unattended lane samples nothing"). On a machine running only headless sessions, a switch never reaches the tee, so the account change is invisible to lanes. Options: the switcher writes a small "account switched" marker lanes watch; the switcher rewrites the tee's account field; or lanes read the active account from ~/.claude.json oauthAccount directly.
Related
- Auto-rotate accounts in reset order for unattended loop lanes claude-code-account-rotation#148 (auto-rotation and lane allocation; decisions in progress).
- Filed from that repo's interview session at the operator's direction (2026-09-28).
Activity
feat: prompt a switch when a rate-limit stop hook reports a limit (#168)
kyle-sexton commentedon Sep 29, 2026
This was generated by AI during triage.
Triage: human-gated
Summary: Paused lanes ignore an account switch: the reader contract says a latched resets_at has no obligation to be dropped, and the loop-lane convention says reader-side invalidation is not built. Related: account-rotation#148.
Open question: How does a headless-only account switch reach the tee?
Evidence that settles it: the maintainer's choice of signal source; changing the reader contract to MUST is a contract change
RECOMMENDED: read
oauthAccountfrom ~/.claude.json (no cross-repo writer change). On an account.email change, re-evaluate and drop the latch if the new account is below 90%; the reader contract states it as MUST.kyle-sexton commentedon Sep 29, 2026
Owner decision (2026-09-29): Option 3. Lanes read oauthAccount.emailAddress from ~/.claude.json directly and drop the latched pause when it changes and the new account is under 90%. The reader contract states this as a MUST. Owner's words: "Accept recommendation: 3, with the reader contract stating it as a MUST".
Next: an agent edits reader-contract.md (obligation plus signal source), the work-loop and babysit-loop lane pause logic, and tests; updates loop-lane README section 6 and the rate-limit-guard changelog and version. No change in the account-rotation repo.
feat(rate-limit-guard): carry the Account switch floor bullet to ever…
feat(rate-limit-guard): release the account-switch reader contract ac…