diegosouzapw/OmniRoute · error · Error

Failed to fetch GitHub usage

Error message

Failed to fetch GitHub usage: ${error.message}

What it means

Catch-all rethrow in getGitHubUsage: an exception occurred anywhere in the try block (fetch throw, JSON parse, quota field access) and the original error.message is embedded verbatim. This is the terminal wrap for any unexpected failure while fetching/parsing GitHub Copilot quota data.

Solutions

  1. Inspect the embedded error.message to identify the failing stage
  2. Retry for transient network errors
  3. Re-authenticate if the inner message indicates an auth failure
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/usage/fetcher.ts:121 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/dba5250859284af8. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/usage/fetcher.ts:121

        resetDate: data.limited_user_reset_date,
        quotas: {
          chat: {
            used: usedQuotas.chat || 0,
            total: monthlyQuotas.chat || 0,
            unlimited: false,
          },
          completions: {
            used: usedQuotas.completions || 0,
            total: monthlyQuotas.completions || 0,
            unlimited: false,
          },
        },
      };
    }

    return { message: "GitHub Copilot connected. Unable to parse quota data." };
  } catch (error) {
    throw new Error(`Failed to fetch GitHub usage: ${error.message}`);
  }
}

function formatGitHubQuotaSnapshot(quota) {
  if (!quota) return { used: 0, total: 0, unlimited: true };

  return {
    used: quota.entitlement - quota.remaining,
    total: quota.entitlement,
    remaining: quota.remaining,
    unlimited: quota.unlimited || false,
  };
}

/**
 * Proactive credit balance probe for Antigravity.
 *
 * Fires a minimal streamGenerateContent request with GOOGLE_ONE_AI credits enabled

View on GitHub (pinned to a179ffed5b)