Rate-limit and plan-quota windows in usage_update #2235
tahaburak
started this conversation in
Protocol Suggestions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
The session-usage RFD covers context size and cost, and leaves rate limits and quotas to a future RFD ("What about rate limits and quotas?"). Subscription-backed agents all have plan windows (a rolling 5-hour window, a weekly window, per-model quotas). Today a client that shows plan limits gets them, if at all, through a different vendor-specific route per agent:
usage_updatewith_meta["_claude/rateLimit"](status,resetsAt,rateLimitType, optionalutilization). One window per event, sent only when the info changes; the percentage is left out while the status isallowed. An event that arrives before the turn's first usage is dropped (rate_limit_event dropped when it arrives before the turn's first usage (first turn of a fresh process) claude-agent-acp#1127).account/rateLimits/updatedfrom the Codex app server but doesn't forward it; the numbers are only in the/statusreply, as Markdown with local reset times (Surface Codex RateLimitSnapshot (usage windows) over ACP, not just in /status text codex-acp#227).quotaInfo(remainingFraction,resetTime) but doesn't forward it. A quota stop is sent as agent message text and the turn ends withend_turn, so a client can't tell it from a normal reply.The underlying data has the same shape in all three: a set of windows, each with how much is used and when it resets.
Proposal
An optional
limitsfield onusage_update:{ "sessionUpdate": "usage_update", "used": 53000, "size": 200000, "limits": [ { "id": "five_hour", "label": "5-hour limit", "usedPercent": 40, "resetsAt": "2026-09-26T16:40:00Z", "status": "allowed" }, { "id": "weekly", "label": "Weekly limit", "usedPercent": 10, "resetsAt": "2026-09-30T09:00:00Z" } ] }id: agent-defined, stable across updates, so a client can follow one window over time.label: human-readable name.usedPercent: 0 to 100, optional (absent when the agent doesn't know).resetsAt: RFC 3339, optional.status: optional,allowed|warning|exhausted.Open points:
sizeis required onusage_update; a limits change can arrive when the agent has no fresh context numbers. A siblingsession/updatevariant would avoid that coupling.stopReasonor an error code, ideally naming the exhausted window'sidand itsresetsAt, so a client knows when the agent can work again.All reactions