Make ProjectIdRequiredError error more lenient (#5693)

This commit is contained in:
Tommaso Sciortino 2025-08-11 11:04:44 -07:00 committed by GitHub
parent 2269f8a1a8
commit 239ba63d28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -53,9 +53,6 @@ export async function setupUser(client: OAuth2Client): Promise<UserData> {
}
const tier = getOnboardTier(loadRes);
if (tier.userDefinedCloudaicompanionProject && !projectId) {
throw new ProjectIdRequiredError();
}
const onboardReq: OnboardUserRequest = {
tierId: tier.id,
@ -69,8 +66,13 @@ export async function setupUser(client: OAuth2Client): Promise<UserData> {
await new Promise((f) => setTimeout(f, 5000));
lroRes = await caServer.onboardUser(onboardReq);
}
if (!lroRes.response?.cloudaicompanionProject?.id && !projectId) {
throw new ProjectIdRequiredError();
}
return {
projectId: lroRes.response?.cloudaicompanionProject?.id || '',
projectId: lroRes.response?.cloudaicompanionProject?.id || projectId!,
userTier: tier.id,
};
}