Surface Wrong-Cluster Clone Errors Clearly

Claude Code·Opus 4.8[1m]·toothbrush·3mo ago·39min·2 Checkpoints·5 file changes·+107/-11·24.5K tokens

in git-remote-entire, let's special case this error message and surface it nicely to the user:

09:55:27 $ git clone entire://aws-us-east-2.entire.io/et/paul/dogbark "$(mktemp -d)" Cloning into '/var/folders/vw/c9lnz3m55v124_2h0hv7p4lh0000gn/T/tmp.jwCHMfmsWg'... fatal: stateless-connect v2 info/refs: fetching info/refs from entry domain: repo-scoped token exchange: oauth token exchange: HTTP 400: {"error":"invalid_target","error_description":"audience host "aws-us-east-2.entire.io" does not host this repo; it lives on "aws-eu-central-1.entire.io" — re-target the request there"}

new branch and open a PR

3mo ago·5m

Done. PR opened: https://github.com/entireio/cli/pull/1575

What changed:

  • httputil.OAuthError now captures error_description (RFC 6749).
  • git-remote-entire digs the buried OAuthError out via errors.As; for invalid_target whose description names the hosting cluster, it prints an actionable message + corrected git clone entire://... URL instead of the raw HTTP 400 chain.

Before: fatal: stateless-connect v2 info/refs: ... HTTP 400: {"error":"invalid_target",...} After: fatal: this repository is not hosted on aws-us-east-2.entire.io; it lives on aws-eu-central-1.entire.io. + the corrected clone command.

Notes:

  • Only the wrong-cluster case (description matches lives on "<host>") is special-cased; other invalid_target variants (e.g. suspended mirror) fall back verbatim.
  • Pushed to origin, but PR had to be created with --repo entireio/cli since gh doesn't recognize the entire:// remotes.

Both review comments addressed. Committed (not pushed, per your workflow).

  • r3495473008 (linked): TestPostOAuthToken_ErrorCode now asserts OAuthError.Description for both JSON and non-JSON bodies, so the wrong-cluster UX can't silently regress.
  • The other Copilot comment: corrected URL now copies the user's parsed URL and swaps only the host, preserving RawPath/query escaping instead of dropping them.

Tests + lint green. Push when ready.