earendil-works/pi · error · Error

Could not load Radius OAuth config from ${gateway}: ${respon

Error message

Could not load Radius OAuth config from ${gateway}: ${response.status} ${await response.text()}

What it means

Error "Could not load Radius OAuth config from ${gateway}: ${response.status} ${await response.text()}" thrown in earendil-works/pi.

Source

Thrown at packages/ai/src/auth/oauth/radius.ts:56

	authorizationEndpoint: string;
};

type DeviceAuthorizationResponse = {
	device_code: string;
	user_code: string;
	verification_uri: string;
	expires_in: number;
	interval?: number;
};

async function loadRadiusOAuthDiscovery(gateway: string, signal: AbortSignal): Promise<RadiusOAuthDiscovery> {
	const response = await fetch(new URL("/v1/oauth", gateway), {
		headers: { accept: "application/json" },
		signal,
	});

	if (!response.ok) {
		throw new Error(
			`Could not load Radius OAuth config from ${gateway}: ${response.status} ${await response.text()}`,
		);
	}

	const discovery = (await response.json()) as Partial<RadiusOAuthDiscovery>;
	if (typeof discovery.authorizationEndpoint !== "string") {
		throw new Error(`Invalid Radius OAuth config from ${gateway}`);
	}
	return { authorizationEndpoint: discovery.authorizationEndpoint };
}

class OAuthResponseError extends Error {
	readonly status: number;
	readonly oauthError?: string;

	constructor(status: number, oauthError: string | undefined, description: string | undefined, message: string) {
		const detail = oauthError
			? description

View on GitHub (pinned to 4af9d21d3b)

Solutions

  1. Check the gateway URL, status, and body; verify network access to the gateway.

When it happens

Trigger: Thrown at packages/ai/src/auth/oauth/radius.ts:56 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/fd1b73c6d864bc1d. Report an issue: GitHub.