From 6da7ed53f2cbd3834358710b0bab4bf032c03611 Mon Sep 17 00:00:00 2001 From: lieyan666 <2102177341@qq.com> Date: Fri, 23 Jan 2026 23:45:14 +0800 Subject: [PATCH] fix: change HTTP status code from 400 to 502 when no provider available Fixes #1082 When all Antigravity accounts are unavailable, the error response now returns HTTP 502 (Bad Gateway) instead of HTTP 400 (Bad Request). This ensures that NewAPI and other clients will retry the request on a different channel, improving overall reliability. --- sdk/api/handlers/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/api/handlers/handlers.go b/sdk/api/handlers/handlers.go index 232f0b95..3cb6d59e 100644 --- a/sdk/api/handlers/handlers.go +++ b/sdk/api/handlers/handlers.go @@ -615,7 +615,7 @@ func (h *BaseAPIHandler) getRequestDetails(modelName string) (providers []string } if len(providers) == 0 { - return nil, "", &interfaces.ErrorMessage{StatusCode: http.StatusBadRequest, Error: fmt.Errorf("unknown provider for model %s", modelName)} + return nil, "", &interfaces.ErrorMessage{StatusCode: http.StatusBadGateway, Error: fmt.Errorf("unknown provider for model %s", modelName)} } // The thinking suffix is preserved in the model name itself, so no