Skip to content

rate-limit-guard: a lane should drop its latched pause when the account changes #5177

Description

@kyle-sexton

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.email differs 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

Activity

  1. added
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Sep 28, 2026
  2. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    ContributorAuthor

    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 oauthAccount from ~/.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.

  3. added
    priority: mediumReal value, no hard deadline; normal backlog flow.
    work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    and removed
    needs-triageNot yet classified. Floor until a type and one priority tier are set.
    on Sep 29, 2026
  4. kyle-sexton commented on Sep 29, 2026

    @kyle-sexton
    ContributorAuthor

    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.

  5. added
    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.
    and removed
    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.
    on Sep 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyFully specified and briefed; eligible for autonomous pickup from the frontier.priority: mediumReal value, no hard deadline; normal backlog flow.work-class: structuralRefactors, migrations, contract changes; cross-cutting and hard to reverse.

    Fields

    No fields configured for Feature.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions