Skip to content

bug: Coder Agents shows a Coder-budget message for provider billing and quota errors #32101

Open

Description

@coder

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Coder Agents maps provider failures to generic error kinds, and the terminal message for some kinds points admins at the wrong cause.

Example: an OpenAI "You have no credits remaining" error (a billing problem on the OpenAI account) is shown as:

The AI usage limit has been exceeded. Contact an administrator or check the applicable budget and quota settings.

That reads like a Coder budget or quota limit. In coderd/x/chatd/chaterror/message.go, ChatErrorKindUsageLimit returns this fixed string and, unlike rate limit, auth, and config errors, doesn't name the provider. Since #25676, provider quota and billing errors (for example insufficient_quota) are classified as usage_limit, so they all get this message. Coder's own spend limits are reported with the same kind, so the two causes look identical in the UI.

The provider's original text is preserved in ClassifiedError.Detail, but the headline message is what admins act on.

Expected Behavior

  • Provider-side quota and billing errors name the provider and point to the provider account, for example: "OpenAI reports that the account's usage quota or credits are exhausted. Check billing for the provider account."
  • Coder-side budget and usage limits keep a message that points to Coder's settings.
  • Ideally, the provider's detail text is shown alongside the message for these errors.

It may be worth auditing the other generic kinds for similar mismatches.

Steps to Reproduce

  1. Configure Coder Agents with an OpenAI provider whose account has no remaining credits.
  2. Send a message in a Coder Agents chat.
  3. The chat fails with "The AI usage limit has been exceeded. Contact an administrator or check the applicable budget and quota settings."

Environment

  • Coder version: reproduced by a user on a recent release; the message is unchanged on main as of 2026-11-12.

Created on behalf of @grove-mountain

Activity

  1. linear-code commented on Nov 12, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions