diegosouzapw/OmniRoute · error

skills.sh API error

Error message

skills.sh API error: ${res.status} ${body}

What it means

Upstream HTTP failure from searchSkillsSh: the skills.sh directory /search endpoint returned a non-2xx status; the response body text is embedded for diagnosis (rate limit, 5xx outage, or malformed query). The request had already enforced a 15s abort timeout, so this is purely a server-side rejection, not a local timeout.

Solutions

  1. Retry after a short backoff — transient 5xx/rate limits are common
  2. Simplify or shorten the search query if the error persists
  3. Check skills.sh availability externally if all queries fail
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/lib/skills/skillssh.ts:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/5788a1dff7583aac. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/skills/skillssh.ts:44

const REQUEST_TIMEOUT_MS = 15_000;

/**
 * Search the skills.sh public directory.
 * No authentication required.
 */
export async function searchSkillsSh(
  query: string,
  limit: number = DEFAULT_SEARCH_LIMIT
): Promise<SkillsShSearchResponse> {
  const url = `${SKILLSSH_BASE_URL}/search?q=${encodeURIComponent(query)}&limit=${limit}`;
  const controller = new AbortController();
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);

  try {
    const res = await fetch(url, { signal: controller.signal });
    if (!res.ok) {
      const body = await res.text();
      throw new Error(`skills.sh API error: ${res.status} ${body}`);
    }
    const data = await res.json();
    return SkillsShSearchResponseSchema.parse(data);
  } finally {
    clearTimeout(timeout);
  }
}

/**
 * Fetch SKILL.md content from GitHub for a skills.sh skill.
 *
 * @param source - GitHub "owner/repo" (e.g. "supabase/agent-skills")
 * @param skillId - Skill name (last segment of the full id, e.g. "supabase-postgres-best-practices")
 */
export async function fetchSkillMd(source: string, skillId: string): Promise<string> {
  const url = `${GITHUB_RAW_BASE}/${source}/main/skills/${skillId}/SKILL.md`;
  const controller = new AbortController();
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);

View on GitHub (pinned to a179ffed5b)