SkillNet icon indicating copy to clipboard operation
SkillNet copied to clipboard

Download failures hide GitHub API errors

Open Ruofei-personal opened this issue 8 months ago • 2 comments

Summary

When installing a skill via SkillNetClient.download(), failures against the GitHub REST API (Contents API, etc.) are not exposed to the caller. The SDK logs the real response (including JSON message for 403 rate limit) but the public API only surfaces a generic error such as “Download returned None”. Integrations cannot show users why the install failed without re-calling GitHub themselves.

Current behavior

  1. SkillDownloader.download() returns None on many failure paths (parse error, empty file list, HTTP ≠ 200, exceptions).
  2. For non-200 responses, the code logs e.g. GitHub API Error [403]: {"message":"API rate limit exceeded ...",...} but does not attach that to the return value.
  3. SkillNetClient.download() then raises something like SkillNetError("Download failed: Download returned None. ...") — no status code, no GitHub message.

Expected behavior

Expose failure details to callers, for example:

  • Option A: Raise an exception that includes http_status and github_message (parsed from JSON message when present), plus raw response_text truncated if needed.
  • Option B: Return a small result object, e.g. success + path | error_detail, instead of only Optional[str].

Minimum ask: for 403 and other GitHub API errors, the same message string GitHub returns should be available to the caller without reading logs.

Reproduction

  1. Use skillnet-ai from PyPI (any recent version).
  2. Exhaust unauthenticated GitHub REST core quota (e.g. ~60 requests/hour per IP), or use an environment that already hits 403 on GET /repos/{owner}/{repo}/contents/....
  3. Call SkillNetClient().download(folder_url=<valid GitHub tree or blob URL>, target_dir=...).
  4. Observe: logs show full 403 JSON; exception text does not mention rate limit.

Why this matters

Downstream apps (agents, IDEs) need to display actionable errors (“rate limited, try later / use token”) instead of a vague “check URL or permissions”. Today they must duplicate the Contents API request to get the same information GitHub already returned once inside the SDK.

Suggested implementation (non-binding)

In SkillDownloader, when response.status_code != 200, parse response.json().get("message") and either raise a typed exception or return it upward so SkillNetClient.download() can include it in the raised error.

Thank you.

Ruofei-personal avatar Mar 18 '26 11:03 Ruofei-personal

Hello @Ruofei-personal,

Thank you for reporting this issue.

We have just released a fix for this. The SDK now properly exposes GitHub API status codes and provides actionable error messages (including hints for 403 rate limits) instead of returning a generic None.

We have updated the package on PyPI. You can upgrade to the latest version and try it out using:

pip install -U skillnet-ai

Feel free for any further feedback or suggestions!

Regards, The SkillNet Team

LiamLYYY avatar Mar 18 '26 13:03 LiamLYYY

Thanks for update!

Ruofei-personal avatar Mar 19 '26 00:03 Ruofei-personal