Skip to content

[bug]: Copilot Business over-limit usage falls back to plan-only #300

Description

@vmvarela

Pre-flight checks

  • I searched existing issues and did not find a duplicate request.
  • I verified this on the current production OpenCode release.

OpenCode version tested

2.0.20

opencode-quota version tested

5.0.0

Bug summary

For GitHub Copilot Business on token-based billing, usage beyond the included AI-credit allowance is displayed as plan-only, even though GitHub reports the used credit count and a 0% remaining percentage.

Steps to reproduce

  1. Sign in to GitHub Copilot Business from OpenCode.
  2. Exceed the included AI-credit entitlement for the current billing cycle.
  3. Check the quota sidebar or /quota_status.

The GitHub Copilot internal user response for the affected account reports token_based_billing: true and a premium_interactions snapshot with entitlement: 3000, quota_remaining: -739.5, remaining: -740, credits_used: 3739, percent_remaining: 0, and has_quota: false. The GitHub UI shows 3,739 / 3,000 AI credits and says usage is paused until reset.

Expected behavior

Show the reported usage and remaining percentage, e.g. 3,739/3,000 and 0% left, with the reset time.

Actual behavior

The live probe succeeds, but the entry is Plan: business | quota details unavailable; the over-limit usage amount and percentage are omitted.

Relevant logs/output

copilot_quota_auth:
- billing_model: ai_credits
- quota_api: copilot_internal_user
- oauth_configured: true
- effective_source: oauth
- live_probe: success
- live_entry_1: Plan: value=business | quota details unavailable reset_at=2026-10-01T00:00:00.000Z

The snapshot has a negative remaining value after the allowance is exceeded. This is distinct from #57, which addressed displaying percentages above 100%, and #126, which added general Copilot AI Credit support.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions