feat(Antigravity): 为无 project_id 的账户生成随机 project_id

部分账户类型(如 g1-pro-tier)API 不返回 cloudaicompanionProject,
但实际接受任意格式的 project_id,故添加随机生成逻辑作为兜底。
This commit is contained in:
song
2025-12-30 23:54:33 +08:00
parent 1c42403e6d
commit fa48cf27eb
2 changed files with 27 additions and 0 deletions

View File

@@ -149,6 +149,12 @@ func (s *AntigravityOAuthService) ExchangeCode(ctx context.Context, input *Antig
result.ProjectID = loadResp.CloudAICompanionProject
}
// 兜底:随机生成 project_id
if result.ProjectID == "" {
result.ProjectID = antigravity.GenerateMockProjectID()
fmt.Printf("[AntigravityOAuth] 使用随机生成的 project_id: %s\n", result.ProjectID)
}
return result, nil
}