Repository navigation
Description
Client or integration
OpenCodex dashboard
Area
Provider adapter
Summary
GET /api/provider-quotas fails as a whole whenever one vendor's quota probe throws a network error. A DNS/connection error raised inside a single provider probe is not isolated per provider, so the dashboard loses the entire quota report instead of showing the providers it could read.
Observed twice on this machine:
- 2026-11-19:
fetchOpenRouterQuota→ECONNRESETonhttps://openrouter.ai/api/v1/key - 2026-11-08:
fetchDeepSeekQuota→getaddrinfo ENOTFOUND api.deepseek.com
In both cases the raw TypeError reaches the request handler and the request ends with GET - http://127.0.0.1:10100/api/provider-quotas failed.
Expected: a failing probe is contained. The provider should be reported as error/unknown (or omitted) and the endpoint should still return 200 with the reports it could collect, the same way provider model discovery already degrades (fallback=stale / fallback=configured) instead of failing the catalog.
Reproduction
-
Have a provider configured whose quota probe hits an unreachable or resetting host, e.g. an OpenRouter key on a network where
openrouter.airesets the TLS connection, or a DeepSeek key without DNS resolution forapi.deepseek.com. -
Open the dashboard (it polls the quota endpoint) or call it directly with the admin token:
curl -H "Authorization: Bearer <admin-api-token>" http://127.0.0.1:10100/api/provider-quotas -
The request fails and
%USERPROFILE%\.opencodex\service.loggets the stack trace below, once per poll.
Expected: HTTP 200 with the remaining providers and a per-provider failure marker.
Actual: request failure for the whole endpoint whenever the reset happens.
Version
2.100.3 (npm runtime); also observed on 2.100.5 after upgrading. Stack line numbers from the npm package at those versions.
Operating system
Windows 11 Pro, build 26200, x64
Provider and model
openrouter (quota probe /key); deepseek (quota probe /user/balance)
Logs or error output
377 | async function fetchOpenRouterQuota(provider: string, config: OcxProviderConfig): Promise<ProviderQuotaProbeResult> {
378 | // Never send a configured API key to a lookalike host or through a redirect.
379 | if (!isCanonicalOpenRouterBaseUrl(config.baseUrl)) return null;
380 | const apiKey = resolveProviderApiKey(config.apiKey)?.trim();
381 | if (!apiKey) return null;
382 | const response = await quotaFetch(provider, config, `${OPENROUTER_BASE_URL}/key`, {
^
TypeError: ECONNRESET: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()
path: "https://openrouter.ai/api/v1/key",
errno: 0,
code: "ECONNRESET"
at async fetchOpenRouterQuota (...\src\providers\quota\vendor-probes-key.ts:382:26)
at async collectOwnedReport (...\src\providers\quota\report-cache.ts:36:24)
GET - http://127.0.0.1:10100/api/provider-quotas failed
352 | async function fetchDeepSeekQuota(provider: string, config: OcxProviderConfig): Promise<ProviderQuotaProbeResult> {
356 | const response = await quotaFetch(provider, config, `${DEEPSEEK_BASE_URL}/user/balance`, {
^
TypeError: getaddrinfo ENOTFOUND api.deepseek.com
path: "https://api.deepseek.com/user/balance",
syscall: "getaddrinfo",
hostname: "api.deepseek.com",
errno: 4,
code: "ENOTFOUND"
at async fetchDeepSeekQuota (...\src\providers\quota\vendor-probes-key.ts:356:26)
GET - http://127.0.0.1:10100/api/provider-quotas failed
254 of these accumulated in the log on 2026-11-08 alone, i.e. every dashboard poll fails while the provider stays unreachable.
Screenshots and supporting files
None.
Redacted configuration
Not needed; the failure is the probe's own network error.
Checks
- I searched existing issues and documentation. Neighbouring reports (Provider quota report cache never commits while Codex traffic flows, so every quota read re-probes Anthropic and drops its row on a single failed read #7956, [Bug]: stored monthlyPercent: 100 with no upstream source is never retired for the main account (pool path fixed by #8120) #8596) cover quota value staleness for the main account; this one is about a thrown transport error taking down the entire
/api/provider-quotasresponse. - I removed secrets, tokens, account details, request credentials, and personal data.
Activity
lidge-jun commentedon Nov 20, 2026
Fixed by #8948, squash-merged into dev as d9120df.