can1357/oh-my-pi · error

Failed to fetch Umans models info

Error message

Failed to fetch Umans models info

What it means

The Umans discovery mapper fetches the provider's models info endpoint and wraps ANY fetch/parse failure (network error, timeout, JSON parse error) in this Error with the original attached as `cause`. Note non-ok responses return null instead — this throw is for hard failures, not HTTP statuses.

Source

Thrown at packages/catalog/src/provider-models/openai-compat.ts:862

}): Promise<ModelSpec<"anthropic-messages">[] | null> {
	const discoveryBaseUrl = toAnthropicDiscoveryBaseUrl(options.baseUrl);
	const requestHeaders: Record<string, string> = { Accept: "application/json" };
	if (options.apiKey) {
		requestHeaders["x-api-key"] = options.apiKey;
	}
	const fetchImpl = discoveryFetch(options.fetch);
	let payload: unknown;
	try {
		const response = await fetchImpl(`${discoveryBaseUrl}${UMANS_MODELS_INFO_PATH}`, {
			method: "GET",
			headers: requestHeaders,
		});
		if (!response.ok) {
			return null;
		}
		payload = await response.json();
	} catch (error) {
		throw new Error("Failed to fetch Umans models info", { cause: error });
	}
	if (!isRecord(payload)) {
		return null;
	}
	const models: ModelSpec<"anthropic-messages">[] = [];
	for (const [modelId, value] of Object.entries(payload)) {
		if (!isRecord(value)) continue;
		const mapped = mapUmansModelInfo(modelId, value, options.baseUrl, options.references.get(modelId));
		if (mapped) {
			models.push(mapped);
		}
	}
	return models.sort((left, right) => left.id.localeCompare(right.id));
}

export function umansModelManagerOptions(config?: UmansModelManagerConfig): ModelManagerOptions<"anthropic-messages"> {
	const apiKey = config?.apiKey;
	const baseUrl = normalizeUmansBaseUrl(config?.baseUrl);

View on GitHub (pinned to 9690622007)

Solutions

  1. Check `error.cause` for the underlying failure
  2. Verify network access and the Umans base URL
  3. Retry — discovery timeouts are often transient
  4. If Umans is deprecated/changed, update the provider descriptor or discovery mapper
Defensive patterns

Strategy: try-catch

Try / catch

try {
  models = await fetchUmansModels();
} catch (err) {
  if (err instanceof Error && err.message === "Failed to fetch Umans models info") {
    logger.warn("Umans discovery failed", { cause: (err as { cause?: unknown }).cause });
    return [];
  }
  throw err;
}

Prevention

When it happens

Trigger: fetchImpl throws (DNS failure, connection refused, TLS error, abort/timeout) or response.json() rejects while fetching Umans models info.

Common situations: Umans API down or unreachable, invalid credentials causing TLS/proxy issues, 5s discovery timeout firing, malformed/non-JSON response body.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/a9e15f638b165d91. Report an issue: GitHub.