feat(antigravity): 令牌刷新失败及创建账号时也设置隐私

- token_refresh: 不可重试错误和重试耗尽两条路径添加 ensureAntigravityPrivacy
- admin_service: CreateAccount 为 Antigravity OAuth 账号异步设置隐私

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
QTom
2026-03-28 21:56:45 +08:00
parent 318aa5e0d3
commit 46bc5ca73b
2 changed files with 15 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"io"
"log/slog"
"net/http"
"strings"
"time"
@@ -1587,6 +1588,18 @@ func (s *adminServiceImpl) CreateAccount(ctx context.Context, input *CreateAccou
}
}
// Antigravity OAuth 账号:创建后异步设置隐私
if account.Platform == PlatformAntigravity && account.Type == AccountTypeOAuth {
go func() {
defer func() {
if r := recover(); r != nil {
slog.Error("create_account_antigravity_privacy_panic", "account_id", account.ID, "recover", r)
}
}()
s.EnsureAntigravityPrivacy(context.Background(), account)
}()
}
return account, nil
}