SkillNet icon indicating copy to clipboard operation
SkillNet copied to clipboard

Slow / Unstable Skill Download in China due to raw.githubusercontent.com

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

Description

The current downloader implementation fetches files using:

response = self.session.get(raw_url)

While this works in some environments, it leads to significant performance and stability issues in certain regions, especially mainland China.

Problem

•	raw.githubusercontent.com is very slow and unstable in China
•	In practice, requests often:
•	take several seconds per file
•	or fail intermittently due to network issues
•	Since a skill may contain multiple files, the overall download becomes extremely slow or even unusable

Additionally, the current implementation: • does not specify a timeout, so requests may hang indefinitely • does not provide retry logic • does not support fallback mirrors • relies entirely on a single source: raw.githubusercontent.com

Suggested Improvements

  1. Add configurable timeout
  2. Add fallback mirrors When the primary source is slow or unavailable, try alternative mirrors such as: • https://ghproxy.com/ • https://raw.gitmirror.com/ or make it configurable (if possible)

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

Thanks for reporting the issue, we will process it as soon as possible!

LiamLYYY avatar Mar 19 '26 03:03 LiamLYYY

Thanks for the detailed report! This has been fully addressed. Changes implemented:

  • Timeout + Retry: All HTTP requests now use a configurable timeout (default 15s) with exponential-backoff retry (default 3 attempts). No more hanging requests.
  • Mirror support: Configurable via [--mirror] CLI flag or GITHUB_MIRROR environment variable. When set, file downloads go through the mirror directly — no hardcoded mirror addresses baked into the library.
  • Priority chain: [--mirror] parameter > GITHUB_MIRROR env var > direct GitHub access (no mirror).

Usage:

# CLI
skillnet download <url> --mirror https://ghfast.top/
# Or set once via environment variable
export GITHUB_MIRROR="https://ghfast.top/"
skillnet download <url>
# Python SDK
client.download(url="...", mirror_url="https://ghfast.top/")

The mirror works by prefix-concatenation (e.g. https://ghfast.top/{raw_github_url}), so it's compatible with ghfast.top, ghproxy.com, and similar services.

We chose not to hardcode any default mirror — following the same pattern as pip's -i flag — so users can freely pick the mirror that works best for their network.

The update is already published on PyPI — run pip install -U skillnet-ai to try it out.

Icarus-Chen avatar Mar 19 '26 07:03 Icarus-Chen

hi, do you have any further questions?

zxlzr avatar Mar 20 '26 05:03 zxlzr