You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
effect: decide 402 → QuotaExhaustedError and carrying raw usage #323
Two error/usage gaps in @coder/ai-sdk-effect were left out of the publishing PR because each one changes behavior and needs a design choice. RateLimitError.retryAfter did ship there.
402 → QuotaExhaustedError. Today HTTP 402 maps to RateLimitError, classifyError returns rate-limit, and isTransient returns true. Effect 4's QuotaExhaustedError exists for exhausted quota, but its isRetryable is false (effect/ai/AiError). Mapping 402 to it is inconsistent with isTransient: true, unless we also change the classification (a new quota reason, or rate-limit but not transient). That changes the public ErrorReason / isTransient contract, so it needs a decision.
Carry usage.raw.LanguageModelV4Usage has provider-raw usage, but Effect 4.0.3's Response.Usage has no raw field. Carrying it needs a new home, for example the finish part's metadata.coder, which is a public metadata shape.
Acceptance: a decision for each item, then a PR with unit tests and README updates (the error-reason table in packages/effect/README.md).
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
402 handling: Option A. HTTP 402 maps to Effect 4's QuotaExhaustedError. classifyError gets a new quota value, and isTransient returns false for it. 429 stays a transient rate-limit, including retryAfter.
Raw usage: Option A. The provider's raw usage is carried as metadata.coder.rawUsage on the finish part, but only when the provider sends it.
Implementation is in progress on branch issue-323-quota-raw-usage. It merges before the effect 0.1.0 release (#325), so both changes ship in 0.1.0.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: medium
Activity
ThomasK33 commentedon Oct 12, 2026
Decisions (owner, 2026-10-12)
QuotaExhaustedError.classifyErrorgets a newquotavalue, andisTransientreturnsfalsefor it. 429 stays a transientrate-limit, includingretryAfter.metadata.coder.rawUsageon the finish part, but only when the provider sends it.Implementation is in progress on branch
issue-323-quota-raw-usage. It merges before the effect 0.1.0 release (#325), so both changes ship in 0.1.0.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:medium