{"record":{"id":"180c3d76769f9c30","repo":"nexu-io/open-design","slug":"public-github-repository-metric-request-failed-wit","errorCode":null,"errorMessage":"public_github_repository_metric request failed with ${response.status}","messagePattern":"public_github_repository_metric request failed with (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/live-artifacts/refresh.ts","lineNumber":693,"sourceCode":"  if (!Array.isArray(input.fields)) throw new Error('input.fields must be an array of strings');\n  const fields = input.fields.filter((field): field is string => typeof field === 'string');\n  if (fields.length !== input.fields.length) throw new Error('input.fields must be an array of strings');\n  return fields.slice(0, 20);\n}\n\nasync function executePublicGithubRepositoryMetric(options: ExecuteLocalDaemonRefreshSourceOptions): Promise<BoundedJsonObject> {\n  const input = options.source.input as PublicGithubRepositoryMetricInput;\n  const url = selectGithubRepositoryApiUrl(input);\n  const fetchInit: RequestInit = {\n    headers: {\n      Accept: 'application/vnd.github+json',\n      'User-Agent': 'open-design-live-artifact-refresh',\n    },\n  };\n  if (options.signal !== undefined) fetchInit.signal = options.signal;\n  const response = await fetch(url, fetchInit);\n  if (!response.ok) {\n    throw new Error(`public_github_repository_metric request failed with ${response.status}`);\n  }\n  const parsed = await response.json() as Record<string, unknown>;\n  const output: BoundedJsonObject = { toolName: 'public_github_repository_metric' };\n  for (const field of selectGithubFields(input)) {\n    const value = parsed[field];\n    if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) {\n      output[field] = value;\n    }\n  }\n  return asBoundedRefreshOutput(output);\n}\n\nexport async function executeLocalDaemonRefreshSource(options: ExecuteLocalDaemonRefreshSourceOptions): Promise<BoundedJsonObject> {\n  if (options.source.type === 'local_file') {\n    const toolName = options.source.toolName ?? 'project_files.read_json';\n    if (toolName !== 'project_files.read_json') {\n      throw new Error(`unsupported local_file refresh tool: ${toolName}`);\n    }","sourceCodeStart":675,"sourceCodeEnd":711,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/live-artifacts/refresh.ts#L675-L711","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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.","If 404: verify owner/repo spelling and that the repo is public; private repos cannot be fetched here.","If 5xx: this is a GitHub-side outage; retry the refresh after a short delay or report upstream status.","Inspect the thrown error message for the numeric status to route to the right fix."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"async function probeGithub(url: URL, signal?: AbortSignal): Promise<boolean> {\n  const res = await fetch(url, { method: 'HEAD', signal, headers: { 'User-Agent': 'probe' } });\n  return res.ok;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await executeLocalDaemonRefreshSource(opts);\n} catch (err) {\n  const msg = err instanceof Error ? err.message : String(err);\n  if (/request failed with 403|429/.test(msg)) {\n    // back off; rate-limited\n  } else if (/request failed with 404/.test(msg)) {\n    // repo missing/private — fix the source\n  } else if (/request failed with 5\\d\\d/.test(msg)) {\n    // GitHub incident — retry with backoff\n  } else throw err;\n}","preventionTips":["Cache repo metrics client-side; the unauthenticated ceiling is 60/hour.","Treat 404 as permanent (fix the URL) and 5xx as transient (retry).","Watch X-RateLimit-Remaining on responses to anticipate exhaustion."],"tags":["network","http-status","rate-limit","github-api","live-artifacts"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}