Skip to content

status line keeps the Anthropic rate-limit window after switching to another provider #479

Closed

Description

@przadka-agents

Problem

After switching the model from an Anthropic one to openai-codex/gpt-6.2-astra in the same session, the status line keeps showing the 7-day window from the last Anthropic response (7d 11% (4d11h) for us).
Every later Codex response leaves it unchanged, so the number is stale and belongs to a different account.

In extensions/status-line.ts (1.9.0, same code in 1.10.1):

  • parseRateLimits reads only the anthropic-ratelimit-unified-5h / -7d header families.
  • after_provider_response replaces rateLimits only when that parse returns something, so a response without Anthropic headers keeps the old snapshot.
  • model_select only calls scheduleRefresh(); it doesn't clear rateLimits. Only session_start does.

Suggested approach

  1. Clear rateLimits on model_select when the provider changes, so a stale window disappears instead of being shown against the wrong account.
  2. Optionally, map the Codex usage headers into rate_limits. The Codex CLI binary references *-primary-used-percent, *-primary-window-minutes, *-primary-reset-at and the matching *-secondary-* fields. I haven't captured a live response to confirm the exact prefix.

1 alone fixes the wrong number. 2 is a feature on top.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions