Repository navigation
Conversation
[Medium impact] The PR appears safe to merge, with the existing non-blocking concern about hidden request error details. Findings
Fix with agent prompt### Issue 1
cli/src/commands/install.ts:155-158
When a Git install fails without a token, `runGitHubCurl` replaces the actual error with authentication advice. The CLI prints only `err.message`, so saving the original error in `cause` hides details such as a DNS failure, certificate error, or missing `curl`. Users may configure a token when that cannot fix the problem. Include the original error message alongside the token hint, and add a test for a non-authentication failure.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryGit-ref installs now trim GitHub tokens and skip blank values before choosing a fallback.
Reviews (2) · Last reviewed commit: "fix(cli): skip blank GitHub tokens durin..." · Reviewed by Greptile |
| throw new Error( | ||
| "GitHub request failed without authentication. Set GH_TOKEN or GITHUB_TOKEN for private repositories or higher rate limits.", | ||
| { cause }, | ||
| ); |
There was a problem hiding this comment.
Request errors lose their details
When a Git install fails without a token, runGitHubCurl replaces the actual error with authentication advice. The CLI prints only err.message, so saving the original error in cause hides details such as a DNS failure, certificate error, or missing curl. Users may configure a token when that cannot fix the problem. Include the original error message alongside the token hint, and add a test for a non-authentication failure.
Prompt To Fix With AI
This is a comment left during a code review.
Path: cli/src/commands/install.ts
Line: 155-158
Comment:
**Request errors lose their details**
When a Git install fails without a token, `runGitHubCurl` replaces the actual error with authentication advice. The CLI prints only `err.message`, so saving the original error in `cause` hides details such as a DNS failure, certificate error, or missing `curl`. Users may configure a token when that cannot fix the problem. Include the original error message alongside the token hint, and add a test for a non-authentication failure.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Thinking Path
Linked Issues or Issue Description
Closes #17634. Related: #13928 addresses git-ref package staging. Its diff does not fix blank-token selection. Issue-number and keyword searches found no dedicated fix PR.
What Changed
Verification
pnpm --dir cli exec vitest run src/__tests__/install-command.test.ts src/__tests__/install-store.test.ts: 37 tests passed.Before the fix, the expanded install-command suite had four failures in token-selection and anonymous-error cases. All now pass.
Tests use a fake command runner and inspect the real temporary config file. No live private-repository download was performed.
pnpm -r typecheckpassed.pnpm buildpassed.Full
pnpm test:runwas attempted but interrupted after server suites failed during import withAI_InvalidArgumentError: baseURL must be a non-empty string. A focused server rerun reproduced the error. The runtime exports empty provider base URLs. Omitting empty*_BASE_URLvariables from a focused rerun ofserver/src/__tests__/tool-access-service.test.tsallowed all 469 tests to pass. The full suite was not rerun to completion; full-suite acceptance is not claimed.Tests ran on Linux against upstream
cff331f6ca0a652b5e41641c68dfa5fa584c22aewith both independent fixes present. Each PR contains only its own fix.Risks
Low risk. Non-blank GH_TOKEN keeps precedence. Tokens remain in a mode-0600 temporary curl config file and are removed after the request. Anonymous failures now have a contextual message; the original error is retained as the cause.
Model Used
OpenAI GPT-6 via Codex, with code execution and repository tools. The runtime does not expose a more specific deployment ID or context-window size.
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived detailsCI and review checkboxes remain pending because those results are not yet available.