can1357/oh-my-pi · error · DestinationUnavailableError

the deprecated public discovery endpoint cannot be used

Error message

the deprecated public discovery endpoint cannot be used

What it means

This DestinationUnavailableError is thrown specifically for the sendspace destination when the configured endpoint hostname equals `api.sendspace.com` (SENDSPACE_DEFAULT_HOST). That host was the public discovery endpoint of a deprecated API, so the library refuses to use it and requires the user to supply a genuinely different replacement endpoint.

Source

Thrown at packages/coding-agent/src/blob-broker/uploaders-legacy.ts:90

	if (endpoint.protocol !== "https:" && endpoint.protocol !== "http:") {
		throw new LegacyDestinationError(destination, "the configured endpoint must use HTTP or HTTPS");
	}
	const hostname = endpoint.hostname.toLowerCase();
	const blocked = BLOCKED_CUSTOM_HOSTS[destination];
	if (blocked) {
		for (const domain of blocked) {
			if (hostname === domain || hostname.endsWith(`.${domain}`)) {
				throw new DestinationUnavailableError(destination, "the defunct public endpoint cannot be used");
			}
		}
	}
	return endpoint;
}

function sendSpaceEndpoint(config: DestinationRuntimeConfig): URL {
	const endpoint = configuredEndpoint("sendspace", config);
	if (endpoint.hostname.toLowerCase() === SENDSPACE_DEFAULT_HOST) {
		throw new DestinationUnavailableError("sendspace", "the deprecated public discovery endpoint cannot be used");
	}
	return endpoint;
}

function httpUrl(destination: BlobDestinationId, raw: string, base?: URL): string {
	let url: URL;
	try {
		url = base ? new URL(raw, base) : new URL(raw);
	} catch (error) {
		throw new LegacyDestinationError(destination, "the upload response did not contain a valid direct URL", error);
	}
	if (url.protocol !== "https:" && url.protocol !== "http:") {
		throw new LegacyDestinationError(destination, "the upload response URL must use HTTP or HTTPS");
	}
	return url.href;
}

function objectValue(value: unknown): Readonly<Record<string, unknown>> {

View on GitHub (pinned to 9690622007)

Solutions

  1. Change the sendspace endpoint to a non-default hostname (a working replacement server you control or trust)
  2. Use any path on a different host — only the exact hostname api.sendspace.com is rejected, subdomains technically pass but will not work against the dead API
  3. Drop the sendspace destination and use one of the still-supported destinations
  4. Verify the hostname in the configured URL is not api.sendspace.com

Example fix

// before
endpoint: https://api.sendspace.com/rest/1.0
// after
endpoint: https://sendspace-proxy.example.com/rest/1.0
Defensive patterns

Strategy: validation

Validate before calling

const host = new URL(config.endpoint).hostname.toLowerCase();
if (host === "api.sendspace.com") {
  throw new Error("sendspace endpoint must not be the deprecated api.sendspace.com");
}

Try / catch

try {
  await uploader.upload(request);
} catch (err) {
  if (err instanceof Error && err.message.includes("deprecated public discovery endpoint")) {
    // supply a non-default sendspace replacement endpoint
  } else throw err;
}

Prevention

When it happens

Trigger: Configuring the sendspace destination with endpoint 'https://api.sendspace.com/...' (or any URL whose hostname, lowercased, is exactly api.sendspace.com) and invoking an upload; sendSpaceEndpoint() checks the host after configuredEndpoint() passes.

Common situations: Users paste the documented-but-deprecated sendspace API URL from old docs; copying the default host into the custom endpoint field without realizing it is explicitly disallowed.

Related errors


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