fix(source-control): explain clone failures - #9831
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 912c26b. Configure here.
ApprovabilityVerdict: Would Approve Macroscope's review found this PR approvable — The PR narrowly improves failed clone reporting by converting Git stderr into actionable, transport-safe messages while preserving successful clone behavior. It is covered by focused tests and introduces no schema, deployment, default, or static-analysis changes. Not approved because:
Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more. |
…h and timeouts Azure DevOps SSH public-key failures no longer get HTTPS advice; macOS SSH Operation timed out maps to connectivity; GitCommandError cause uses git-level detail.
Dismissing prior approval to re-evaluate 7590f3e

Failed clones surface a bare git error, leaving users to guess between SSH trust, SSH auth, HTTPS auth, DNS, and connectivity problems.
Classify stderr with an ordered matcher (generic repository-not-found last, since SSH emits it alongside DNS errors) and wrap failures in a transport-safe error carrying lengths only, never raw stderr over RPC. Unknown transports get a neutral message instead of an HTTPS guess.
Ports #5005 onto current main.
Built with muse-spark-1.3-contributor via OpenCode in T3 Code.
Note
Medium Risk
Changes clone error handling and RPC-visible failure payloads; misclassification could mislead users, but scope is limited to source-control clone flows.
Overview
Failed repository clones now return fixed, actionable user messages instead of leaking raw Git stderr over RPC.
cloneRepositoryrunsgit clonewithallowNonZeroExit, classifies stderr via a newcloneFailureDetailmatcher (SSH host key, SSH/HTTPS auth, DNS, connectivity, repo access, then a generic fallback), and fails withSourceControlRepositoryErrorwhosecauseis aGitCommandErrorcarrying only command metadata and output lengths—not stderr text. When no provider is passed, the service infers provider kind from the remote URL.New effect tests cover each classified failure path and assert the mapped
detailplus transport-safeGitCommandErrorshape.Reviewed by Cursor Bugbot for commit 8072f19. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add effect test for
cloneRepositoryfailure explanationsGitCommandErrorcause, fixed cause detail, and captured stderr length.cloneRepositoryto map each Git stderr pattern to the exact actionable message listed in the test cases; mismatches will fail the suite.Macroscope summarized 8072f19.