Skip to content

v0.214.0

Choose a tag to compare

@github-actions github-actions released this 23 Oct 21:37
· 30 commits to main since this release
96048c3

protoAgent v0.214.0

This release finishes the subscription-usage work (epic #4309, ADR 0122). Model failover now reads your Claude / ChatGPT-Codex quota before it picks a fallback. Token use is recorded per account, so you can see which agent spent it. The usage meters show each window once, and the label now says how much is used.

Added

  • Quota-aware model failover (#4483, issue #4437). routing.fallback_models now checks this instance's cached subscription-usage snapshot before it fails over. It never forces a poll.
    • A fallback whose OAuth account (anthropic-oauth: / openai-codex:) has a blocked window for that model is skipped. It is named in the model.fallback event's new skipped_blocked field.
    • When the primary returns a quota 429 and a fresh snapshot confirms the whole account is blocked, fallbacks on the same account are skipped, because they share the exhausted quota. Only a fallback on a different account (another subscription, or the gateway) is tried. If every fallback shares that account, the original quota error is raised.
    • A 429 alone does not mark the whole account as exhausted. Short throttles and limits scoped to one model still allow retries to other usable models on the same subscription.
    • A per-chat model pick (the model selector) that hits its quota no longer falls back silently to a default on the same account. The turn shows the quota error, with the reset time when the provider reports one, and keeps the provider's 429 retry metadata.
  • Per-agent subscription attribution (#4484, issue #4438). Each turn now records the provider and account it ran on. That covers native OAuth turns and ACP coder runs, which record their reported tokens against the delegate's account; their cost stays 0. protoagent usage --by-agent (locally, or --fleet --by-agent through the hub) shows each member's share of the attributed tokens in every current window.
  • /usage in chat (#4485). Posts every connected Claude and ChatGPT / Codex plan in the thread, one line per window, with the percent used and the reset time, e.g. "Weekly · Fable — 0% used, resets in 5d 15h 8m". It uses the same data as the Settings ▸ Providers meters.

Fixed

  • Usage meters no longer show the session and weekly windows twice (#4485). The usage endpoint and the model-response headers name the same windows differently (session:0 vs 5h:0). The store merged on that id, so the first turn after each poll added a second copy. Windows now merge on what they measure (kind, length and scope), and the newest reading wins. Each meter now reads "Weekly · 17% used" instead of "Weekly · Available 17%", which looked like 17% was left. It adds "Near limit" at 80% and "Limit reached" at 100%.

Upgrading

  • Meters correct themselves. After you update, the Claude card in Settings ▸ Providers shows one meter per window (session, weekly, weekly Fable), each reading "N% used". If an old duplicate row is still there, it goes away at the next usage poll. There's nothing to clear.
  • Quota-aware failover adds no config. routing.fallback_models keeps its meaning and order. Only fallbacks on an OAuth subscription are affected: a blocked account is skipped, and a confirmed account-wide quota 429 fails over only to a different account. With no usage snapshot, a stale or unknown one, or a model routed through the gateway, failover runs in exactly the configured order, as before. If you watch model.fallback events, they gain a skipped_blocked field.
  • A per-chat pick on an exhausted subscription now fails visibly. It used to fall back to the default model on the same account. Now it shows the quota error, with the reset time, so pick a model on another account or wait for the reset.
  • protoagent usage --by-agent needs operator credentials. It counts only turns recorded after this upgrade; the telemetry store adds provider_id / account_key columns on first start, and older turns have no account. Shares are of tokens attributed on this box or fleet. The plan's percentage stays account-wide, so use by other clients, and turns with no resolved account, fall outside the shares. Only current windows of known length are listed, and a model-scoped window counts only that model.
  • /usage works in any open chat. It reads the same /api/usage endpoint as the meters, so the server's 60-second poll floor applies.

What's Changed

  • feat: usage U8: quota-aware fallback — skip blocked accounts, fail over on quota 429 only across accounts (#4437) by @mabry1985 in #4483
  • feat: usage U9: per-turn provider/account attribution + protoagent usage --by-agent (#4438) by @mabry1985 in #4484
  • fix(usage): one meter per window, say used not available, add /usage in chat by @mabry1985 in #4485

Full Changelog: v0.213.1...v0.214.0