Download failures hide GitHub API errors
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
SkillDownloader.download()returnsNoneon many failure paths (parse error, empty file list, HTTP ≠ 200, exceptions).- 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. SkillNetClient.download()then raises something likeSkillNetError("Download failed: Download returned None. ...")— no status code, no GitHubmessage.
Expected behavior
Expose failure details to callers, for example:
- Option A: Raise an exception that includes
http_statusandgithub_message(parsed from JSONmessagewhen present), plus rawresponse_texttruncated if needed. - Option B: Return a small result object, e.g.
success + path | error_detail, instead of onlyOptional[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
- Use
skillnet-aifrom PyPI (any recent version). - 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/.... - Call
SkillNetClient().download(folder_url=<valid GitHub tree or blob URL>, target_dir=...). - 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.
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
Thanks for update!