Skip to content

fix(skills): skip the index on GitHub transport errors instead of failing the build - #108

Merged
nibzard merged 1 commit into
mainfrom
fix/agent-skills-generator-error-handling
Jul 31, 2026
Merged

fix(skills): skip the index on GitHub transport errors instead of failing the build#108
nibzard merged 1 commit into
mainfrom
fix/agent-skills-generator-error-handling

Conversation

@nibzard

@nibzard nibzard commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

PR #95 rewrote scripts/generate-agent-skills-index.ts and dropped the deploy-safe error handling that PR #89 introduced, leaving if (import.meta.main) { await main(); } bare. Since bun run build runs generate first, any GitHub outage, 5xx, or exhausted rate limit aborted the whole production build for a non-core discoverability feature.

This restores #89's intent as a two-tier split:

  • Transport errors are skippable. A new GitHubTransportError class covers non-ok GitHub responses (via githubRequestError, including rate-limit exhaustion) and raw fetch network failures (via a small githubFetch wrapper). The entrypoint catches only this class, warns, and exits 0, leaving the index absent for that deploy: honest rather than stale.
  • Everything else still fails the build. Schema, packaging, validation, and filesystem errors rethrow, so a malformed index can never ship. The script writes nothing before every artifact validates, so skipping leaves no partial output.

Test plan

  • New tests in tests/agent-skills-index.test.ts:
    • non-ok GitHub responses classify as GitHubTransportError
    • exhausted rate limits classify as GitHubTransportError with guidance in the message
    • fetch network failures wrap into GitHubTransportError via githubFetch
    • validation and packaging errors do not classify as transport errors
  • bun test tests/agent-skills-index.test.ts: 32 pass
  • bun test: 302 pass
  • bun run check: clean

…ling the build

PR #95 rewrote the generator and dropped the deploy-safe error handling
from PR #89, so any GitHub outage, 5xx, or exhausted rate limit aborted
the whole production build via bun run generate.

Restore the intended two-tier split:

- Transport errors (fetch network failures, non-ok GitHub responses,
  rate limits) are classified as GitHubTransportError. The entrypoint
  warns and exits 0, leaving the index absent for that deploy.
- Schema, packaging, validation, and filesystem errors still throw and
  fail the build, so a malformed index can never ship.

The script writes nothing before every artifact validates, so skipping
on a transport error leaves no partial output behind.
@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 31, 2026 12:48pm

Request Review

@nibzard
nibzard merged commit 6f04299 into main Jul 31, 2026
2 of 3 checks passed
@nibzard
nibzard deleted the fix/agent-skills-generator-error-handling branch July 31, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant