Skip to content

Drop status line rate limits when the model switches to another provider - #480

Open
przadka-agents wants to merge 1 commit into
ilovepixelart:mainfrom
przadka-agents:przadka/clear-rate-limits-on-provider-switch
Open

przadka-agents wants to merge 1 commit into
ilovepixelart:mainfrom
przadka-agents:przadka/clear-rate-limits-on-provider-switch

Conversation

@przadka-agents

Copy link
Copy Markdown

Closes #479.

after_provider_response doesn't say which provider answered, so the extension records ctx.model?.provider when a response produces a snapshot.
model_select to a model of a different provider drops the snapshot and its expiry timer.
A switch between models of the same provider keeps it.
The comparison is by provider, not account: pi exposes nothing that identifies the account.

The 429 warning guard is left as is, still once per session.

  • npm run check passes (Biome, strict tsc, knip, Vitest)
  • Tests cover the change (the cross-provider case fails without the fix; the same-provider case guards against clearing too much)

The five-hour and seven-day windows come only from Anthropic response headers, so after a switch to another provider no response replaced them and the previous account's usage stayed in the payload for the rest of the session.

Fixes ilovepixelart#479
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.

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

1 participant