diff options
| author | Tommaso Sciortino <[email protected]> | 2025-08-11 11:04:44 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-11 18:04:44 +0000 |
| commit | 239ba63d281953179f5ac05d9a70c0783b5a9ec9 (patch) | |
| tree | ded24a93b255e80f8050421ba849d85492fa681a /packages/core/src/code_assist/setup.ts | |
| parent | 2269f8a1a839f2dbdb45f5abda7981fce50f654c (diff) | |
Make ProjectIdRequiredError error more lenient (#5693)
Diffstat (limited to 'packages/core/src/code_assist/setup.ts')
| -rw-r--r-- | packages/core/src/code_assist/setup.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/core/src/code_assist/setup.ts b/packages/core/src/code_assist/setup.ts index 9c7a8043..02c9406c 100644 --- a/packages/core/src/code_assist/setup.ts +++ b/packages/core/src/code_assist/setup.ts @@ -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, }; } |
