nexu-io/open-design · error · Error

public_github_repository_metric request failed with ${respon

Error message

public_github_repository_metric request failed with ${response.status}

What it means

Thrown by executePublicGithubRepositoryMetric when the fetch to api.github.com returns a non-2xx response.status. The template literal interpolates the numeric status so the caller can distinguish 404 (repo not found / private), 403/429 (rate limit), 401 (auth required), or 5xx (GitHub outage). No retry is attempted; the refresh fails fast.

Source

Thrown at apps/daemon/src/live-artifacts/refresh.ts:693

  if (!Array.isArray(input.fields)) throw new Error('input.fields must be an array of strings');
  const fields = input.fields.filter((field): field is string => typeof field === 'string');
  if (fields.length !== input.fields.length) throw new Error('input.fields must be an array of strings');
  return fields.slice(0, 20);
}

async function executePublicGithubRepositoryMetric(options: ExecuteLocalDaemonRefreshSourceOptions): Promise<BoundedJsonObject> {
  const input = options.source.input as PublicGithubRepositoryMetricInput;
  const url = selectGithubRepositoryApiUrl(input);
  const fetchInit: RequestInit = {
    headers: {
      Accept: 'application/vnd.github+json',
      'User-Agent': 'open-design-live-artifact-refresh',
    },
  };
  if (options.signal !== undefined) fetchInit.signal = options.signal;
  const response = await fetch(url, fetchInit);
  if (!response.ok) {
    throw new Error(`public_github_repository_metric request failed with ${response.status}`);
  }
  const parsed = await response.json() as Record<string, unknown>;
  const output: BoundedJsonObject = { toolName: 'public_github_repository_metric' };
  for (const field of selectGithubFields(input)) {
    const value = parsed[field];
    if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) {
      output[field] = value;
    }
  }
  return asBoundedRefreshOutput(output);
}

export async function executeLocalDaemonRefreshSource(options: ExecuteLocalDaemonRefreshSourceOptions): Promise<BoundedJsonObject> {
  if (options.source.type === 'local_file') {
    const toolName = options.source.toolName ?? 'project_files.read_json';
    if (toolName !== 'project_files.read_json') {
      throw new Error(`unsupported local_file refresh tool: ${toolName}`);
    }

View on GitHub (pinned to 5be4028344)

Solutions

  1. If 403/429: wait for rate-limit window reset (check X-RateLimit-Reset) or reduce refresh frequency; authenticated requests are not supported by this tool, so the unauthenticated ceiling applies.
  2. If 404: verify owner/repo spelling and that the repo is public; private repos cannot be fetched here.
  3. If 5xx: this is a GitHub-side outage; retry the refresh after a short delay or report upstream status.
  4. Inspect the thrown error message for the numeric status to route to the right fix.
Defensive patterns

Strategy: retry

Validate before calling

async function probeGithub(url: URL, signal?: AbortSignal): Promise<boolean> {
  const res = await fetch(url, { method: 'HEAD', signal, headers: { 'User-Agent': 'probe' } });
  return res.ok;
}

Try / catch

try {
  await executeLocalDaemonRefreshSource(opts);
} catch (err) {
  const msg = err instanceof Error ? err.message : String(err);
  if (/request failed with 403|429/.test(msg)) {
    // back off; rate-limited
  } else if (/request failed with 404/.test(msg)) {
    // repo missing/private — fix the source
  } else if (/request failed with 5\d\d/.test(msg)) {
    // GitHub incident — retry with backoff
  } else throw err;
}

Prevention

When it happens

Trigger: Repository does not exist or is private (404); unauthenticated rate limit exceeded (403/429 with X-RateLimit-Remaining: 0); GitHub API incident (5xx); network proxy returns an unexpected status; URL host/path validated but repo was renamed/deleted between authoring and refresh.

Common situations: Heavy development hits the 60-req/hour unauthenticated rate ceiling; model invents a plausible-sounding owner/repo that doesn't exist; repo was renamed or transferred; transient GitHub incident during a demo; corporate proxy returns 502 for api.github.com.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/180c3d76769f9c30. Report an issue: GitHub.