router-for-me/CLIProxyAPI · error
http %d: %s
Error message
http %d: %s
What it means
Returned by AntigravityAuth.OnboardUser when any poll attempt to onboardUser returns a status other than 200. The message carries the status code plus up to 200 characters of the response body (trimmed from a 500-char preview), so the Google error detail is included. Unlike pending responses (200 + done=false), any non-200 aborts the polling loop immediately rather than counting down attempts.
Source
Thrown at internal/auth/antigravity/auth.go:374
}
return "", fmt.Errorf("no project_id in response")
}
time.Sleep(2 * time.Second)
continue
}
responsePreview := strings.TrimSpace(string(bodyBytes))
if len(responsePreview) > 500 {
responsePreview = responsePreview[:500]
}
responseErr := responsePreview
if len(responseErr) > 200 {
responseErr = responseErr[:200]
}
return "", fmt.Errorf("http %d: %s", resp.StatusCode, responseErr)
}
return "", fmt.Errorf("onboard user did not complete after %d attempts", maxAttempts)
}
View on GitHub (pinned to 78f0c4079e)
Solutions
- Read the status and embedded body: 401 → re-login to mint a fresh token before onboarding runs
- 403 with a tier/permission message → the account is not entitled to the tier being requested; verify allowedTiers from the loadCodeAssist response
- 5xx → re-run login; the loop's 5 attempts do not cover non-200s, so a manual retry is needed
- Check system clock skew, which can turn a valid token into a 401
Defensive patterns
Strategy: try-catch
Validate before calling
if strings.TrimSpace(accessToken) == "" {
return fmt.Errorf("refusing onboardUser with empty token; refresh first")
} Try / catch
if _, err := auth.OnboardUser(ctx, token, tierID); err != nil && strings.Contains(err.Error(), "http ") {
if strings.Contains(err.Error(), "http 401") { /* re-login for fresh token */ }
if strings.Contains(err.Error(), "http 403") { /* tier not entitled; check allowedTiers */ }
if strings.Contains(err.Error(), "http 5") { /* transient; retry login */ }
} Prevention
- Mint a fresh token immediately before onboarding; long flows can outlive token lifetime
- Use a tier_id actually present in loadCodeAssist allowedTiers for the account
When it happens
Trigger: Expired/invalid access token (401) because onboarding happens after a token lifetime boundary; missing entitlement for the tier_id sent (403, e.g. free-tier not offered to the account); Google 5xx on the daily endpoint.
Common situations: Long onboarding polls outliving the token used for them; accounts invited to a paid tier but still sending the default 'free-tier' tier_id; intermittent 503s on daily-cloudcode-pa.googleapis.com.
Related errors
- request failed with status %d: %s
- antigravity token exchange: request failed: status %d
- antigravity token exchange: request failed: status %d: %s
- antigravity userinfo: request failed: status %d
- antigravity userinfo: request failed: status %d: %s
AI-assisted analysis of router-for-me/CLIProxyAPI@78f0c4079e (2026-08-15).
Data as JSON: /api/errors/c8a656d6e032d3b5.
Report an issue: GitHub.