From c9bcacd11ab0f9d58a0643960fc22c1af69bb530 Mon Sep 17 00:00:00 2001 From: erio Date: Tue, 17 Mar 2026 01:12:54 +0800 Subject: [PATCH] revert: remove unnecessary 30s timeout from TestConnection The caller's context already controls the timeout. Adding our own timeout changes the original behavior and may prematurely cancel legitimate retries. --- backend/internal/service/antigravity_gateway_service.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/internal/service/antigravity_gateway_service.go b/backend/internal/service/antigravity_gateway_service.go index 14efabf1a4..13c3eef6a0 100644 --- a/backend/internal/service/antigravity_gateway_service.go +++ b/backend/internal/service/antigravity_gateway_service.go @@ -1043,13 +1043,8 @@ func (s *AntigravityGatewayService) TestConnection(ctx context.Context, account // 复用 antigravityRetryLoop:完整的重试 / credits overages / 智能重试 prefix := fmt.Sprintf("[antigravity-Test] account=%d(%s)", account.ID, account.Name) - // 限制测试连接的总超时:避免 MODEL_CAPACITY_EXHAUSTED 60 次重试导致长时间阻塞 - const testConnectionTimeout = 30 * time.Second - testCtx, cancel := context.WithTimeout(ctx, testConnectionTimeout) - defer cancel() - p := antigravityRetryLoopParams{ - ctx: testCtx, + ctx: ctx, prefix: prefix, account: account, proxyURL: proxyURL,