fix(cli): surface real GitHub status on skill download failures#2785
Closed
fahreddinozcan wants to merge 2 commits into
Closed
fix(cli): surface real GitHub status on skill download failures#2785fahreddinozcan wants to merge 2 commits into
fahreddinozcan wants to merge 2 commits into
Conversation
Map GitHub API failures (401/403/404) to actionable messages instead of a bare "GitHub API error", so an expired GITHUB_TOKEN/GH_TOKEN is distinguishable from a rate limit.
On 401/403 skill download failures, setup now prints a tip: line pointing users at GITHUB_TOKEN/GH_TOKEN or `gh auth login`, mirroring the existing EACCES tip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Surfaces the real GitHub HTTP status when CLI skill downloads fail, instead of a bare "GitHub API error", and prints an actionable tip.
fetchRepoTreenow returns the HTTP status on failure instead ofnull.describeGitHubErrormaps 401 (invalid/expired token), 403 (rate limit), and 404 (repo/branch not found) to recognizable messages.githubErrorTiprenders atip:line in setup pointing users at GITHUB_TOKEN/GH_TOKEN orgh auth login, mirroring the existing EACCES tip.downloadSkillFromGitHubandlistSkillsFromGitHubreport the descriptive error.Fixes the confusion in #2363 where an expired token surfaced identically to a rate limit, leaving users unable to diagnose it.
Validated locally against the real download path: a dead token yields
401 (invalid or expired token)+ tip, a bad repo yields404, and a validghlogin downloads the skill with no error.