chore(quota): drop the Command Code usage provider

Command Code's official API has no usage endpoints; the old usage source
was the unofficial studio API reached through a now-archived plugin, so
the tile could only ever fail for officially configured users. Removed
across server, shared UI, and the VS Code extension; the provider logo
fallback stays — it serves the model picker, not usage.
This commit is contained in:
Bohdan Triapitsyn
2026-08-26 19:29:04 +03:00
parent 067c6caf0c
commit c4df01f707
9 changed files with 5 additions and 329 deletions
@@ -9,7 +9,6 @@ import { buildResult } from '../utils/index.js';
import * as claude from './claude/index.js';
import * as codex from './codex.js';
import * as commandCode from './command-code.js';
import * as copilot from './copilot.js';
import * as crof from './crof.js';
import * as cursor from './cursor.js';
@@ -30,12 +29,6 @@ import * as opencodeGo from './opencode-go.js';
import * as xai from './xai.js';
const registry = {
'command-code': {
providerId: commandCode.providerId,
providerName: commandCode.providerName,
isConfigured: commandCode.isConfigured,
fetchQuota: commandCode.fetchQuota
},
claude: {
providerId: claude.providerId,
providerName: claude.providerName,
@@ -160,12 +153,6 @@ const registry = {
const pendingFetches = new Map();
const normalizeQuotaProviderId = (providerId) => {
if (typeof providerId !== 'string') return providerId;
return ['command-code', 'commandcode', 'command_code', 'command code'].includes(providerId.trim().toLowerCase())
? 'command-code'
: providerId;
};
export const listConfiguredQuotaProviders = () => {
const configured = [];
@@ -210,14 +197,13 @@ const fetchQuotaForProviderUncoalesced = async (providerId) => {
};
export const fetchQuotaForProvider = (providerId) => {
const normalizedProviderId = normalizeQuotaProviderId(providerId);
const existing = pendingFetches.get(normalizedProviderId);
const existing = pendingFetches.get(providerId);
if (existing) return existing;
const pending = fetchQuotaForProviderUncoalesced(normalizedProviderId).finally(() => {
if (pendingFetches.get(normalizedProviderId) === pending) pendingFetches.delete(normalizedProviderId);
const pending = fetchQuotaForProviderUncoalesced(providerId).finally(() => {
if (pendingFetches.get(providerId) === pending) pendingFetches.delete(providerId);
});
pendingFetches.set(normalizedProviderId, pending);
pendingFetches.set(providerId, pending);
return pending;
};