Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Unreleased

## 2.4.1 - 2026-11-11

A bug-fix release for Dux Shell 2.0 and 2.1. On a Claude Team plan, a member's sign-in cannot read the organization's usage credits, and the plugin asked for them again on every refresh until Anthropic rate limited the usage endpoint behind the Claude card. A refusal is now remembered for a day per organization, a rate limit on the credits endpoint pauses both requests, and the card names the next try. Only the Claude adapter changed: update through **Settings → Plugins → Check for updates**, no restart needed. Settings, profiles, pins and history carry over unchanged.

Long-form notes: [docs/releases/2.4.1.md](docs/releases/2.4.1.md).

### Fixes

- Claude accounts whose sign-in cannot read the organization's usage credits (a Team plan member gets HTTP 403 from `prepaid/credits`) no longer ask for them on every refresh. Nothing was recorded for a refusal, so each widget instance and each refresh asked again, and the account was soon rate limited (HTTP 429) on the usage endpoint that feeds the Claude card. A 403 or 404 is now remembered for 24 hours per organization and shows no credits, a 429 there pauses the usage endpoint as well and the card names the next try, credits are not asked while that pause holds, and switching organization re-checks at once instead of reusing the other organization's balance. The record is replaced atomically, so a refresh killed mid-write keeps the last balance, and a record written by 2.4.0, which names no organization, is checked again once (#123).
Expand Down
86 changes: 86 additions & 0 deletions docs/releases/2.4.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# 2.4.1: Claude Team accounts stop tripping the rate limit

A bug-fix release for Dux Shell 2.0 and 2.1. On a Claude **Team** plan, a
member's sign-in cannot read the organization's usage credits, and the plugin
asked for them again on every refresh until Anthropic rate limited the usage
endpoint that feeds the Claude card
([#123](https://github.com/bernardopg/AiOverviewControl/issues/123),
[#124](https://github.com/bernardopg/AiOverviewControl/pull/124),
[#125](https://github.com/bernardopg/AiOverviewControl/pull/125)). Settings,
Claude profiles, pins and history carry over unchanged. Version authority
remains `plugin.json`; the published release body comes from the matching
section in `CHANGELOG.md`.

Thanks to [@guidi-injenia](https://github.com/guidi-injenia), who logged every
request the adapter made on a Team account with two monitors and showed the
refused credits call repeating while the usage request itself was still served
from its cache.

## Upgrading

- Requires Dux Shell 2.0 or newer; 2.1 is what CI tests.
- Update through **Settings → Plugins → Check for updates**. No restart is
needed: only the Claude adapter changed, and no file was added to a
directory a running shell has already listed.
- The first refresh after the update asks for usage credits once more: a
record written by 2.4.0 does not say which organization it belongs to.

## User-visible changes

### Refused usage credits are not asked again for a day

Usage credits (prepaid and promotional) come from
`GET /api/oauth/organizations/<org>/prepaid/credits`, which shares the
account's rate limit with `/api/oauth/usage`. A Team member who is not an
admin gets HTTP 403 there. The adapter only recorded a successful answer, so
a refusal was asked again on every run: each widget instance (Dux Shell builds
one per bar screen), each manual refresh, even while the usage request was
served from its 120 second cache. The account was soon answered HTTP 429 on
the usage endpoint, with a one hour `Retry-After`.

Every credits answer is now recorded with its time, status and organization:

- **403 or 404** (a Team member, a plan without usage credits): not asked
again for 24 hours, and the card shows no credits.
- **429**: starts the same backoff as the usage endpoint, so neither is asked
until it ends, honouring `Retry-After`.
- **Any other failure** (5xx, a network error, a `200` whose body is not a
credits object): retried after the usual 10 minutes, keeping the last good
balance.

Credits are never asked while a usage backoff holds, also when the usage
numbers come from the cache. Switching organization re-checks at once instead
of showing the previous organization's balance. The record is replaced with a
rename, so a refresh killed mid-write keeps the last one, and a corrupt, empty
or future-stamped record is checked again rather than trusted.

### The card names the next try during any pause

While a backoff holds, the card's **Updated** line shows
**Rate limited · next try HH:MM**, as 2.2.4 introduced. It now does so as well
when the pause came from the credits endpoint, and when the usage numbers
shown are a fresh snapshot from the cache.

## Documentation

- [Troubleshooting → Claude](../troubleshooting.md#claude) explains why a Team
account shows no credits, when a refusal is asked again, and how to force a
re-check by deleting `claude-prepaid-cache.json`.
- [Provider verification](../provider-verification.md) records the 24 hour
refusal interval, the organization scope and the shared backoff.

## Validation and limitations

- Every shell suite, the QML runtime suite under the pinned Dux Shell 2.1.0,
the metadata and changelog gates and statement coverage (100%) pass in CI.
- New fixture tests reproduce the report (four runs made four credits requests
before the fix, one after) and cover a first refusal, a 2.4.0 record, 403
held for a day across instances, 404, an organization switch, a 5xx and an
HTML `200` keeping the balance, corrupt, empty and future-stamped records, a
failed rename, and a credits 429 pausing the usage endpoint and naming the
next try.
- Not verified against a live Team account: the fix was built from the
reporter's request log. The 24 hour interval means a member who is made an
admin sees the credits within a day, or at once after deleting the record.
- The backoff only spaces out this plugin's requests. The limit is per
account: Claude Code and other tools polling the same endpoint still count.
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"id":"aiOverviewControl","name":"AiOverviewControl","description":"Plugin-managed AI quota, billing, authentication, and local usage telemetry for Dux Shell","version":"2.4.0","requires_dms":">=2.0.0","author":"bernardopg","icon":"monitoring","type":"composite","capabilities":["dankbar-widget","dash-card","process"],"components":{"widget":"./AiOverviewControlWidget.qml","dashCard":"./AiOverviewDashCard.qml"},"settings":"./AiOverviewControlSettings.qml","dash":{"card":{"title":"AI quotas","w":2,"h":1,"minW":1,"minH":1,"maxW":4,"maxH":2},"options":[{"key":"count","text":"Providers","type":"choice","def":"0","choices":[{"value":"0","text":"Fit to size"},{"value":"1","text":"1"},{"value":"3","text":"3"},{"value":"6","text":"6"}]},{"key":"tone","text":"Tone","type":"choice","def":"","choices":[{"value":"","text":"Surface"},{"value":"primary","text":"Primary"},{"value":"secondary","text":"Secondary"},{"value":"tertiary","text":"Tertiary"}]}]},"requires":["bash","jq","curl"],"permissions":["process","settings_read","settings_write"]}
{"id":"aiOverviewControl","name":"AiOverviewControl","description":"Plugin-managed AI quota, billing, authentication, and local usage telemetry for Dux Shell","version":"2.4.1","requires_dms":">=2.0.0","author":"bernardopg","icon":"monitoring","type":"composite","capabilities":["dankbar-widget","dash-card","process"],"components":{"widget":"./AiOverviewControlWidget.qml","dashCard":"./AiOverviewDashCard.qml"},"settings":"./AiOverviewControlSettings.qml","dash":{"card":{"title":"AI quotas","w":2,"h":1,"minW":1,"minH":1,"maxW":4,"maxH":2},"options":[{"key":"count","text":"Providers","type":"choice","def":"0","choices":[{"value":"0","text":"Fit to size"},{"value":"1","text":"1"},{"value":"3","text":"3"},{"value":"6","text":"6"}]},{"key":"tone","text":"Tone","type":"choice","def":"","choices":[{"value":"","text":"Surface"},{"value":"primary","text":"Primary"},{"value":"secondary","text":"Secondary"},{"value":"tertiary","text":"Tertiary"}]}]},"requires":["bash","jq","curl"],"permissions":["process","settings_read","settings_write"]}
Loading