Skip to content

Commit 1457c00

Browse files
alltomatosclaude
andcommitted
fix(providers): fix onboardUser body field name (tier_id, not tierId)
Byte-for-byte comparison against OmniRoute's working Antigravity client (D:\dev\OmniRoute\src\lib\oauth\providers\antigravity.ts): the onboardUser request body uses snake_case tier_id, inconsistent with every other camelCase field in these APIs. We were sending tierId, which Google's onboarding endpoint silently rejects — a plausible root cause for the persistent anomalyco#3501 license error on the "ide" profile, distinct from and on top of the metadata-shape and header fixes already applied. Also re-fetches loadCodeAssist after a successful onboardUser instead of trusting its own response shape for the project ID, matching OmniRoute's sequence — onboardUser's response doesn't reliably carry the project. Co-Authored-By: Claude Sonnet 5 <[email protected]>
1 parent 47a39c8 commit 1457c00

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎packages/core/src/plugin/provider/google-antigravity.ts‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,26 @@ function discoverProject(http: HttpClient.HttpClient, accessToken: string, clien
140140
if (loaded.cloudaicompanionProject) {
141141
return { projectID: loaded.cloudaicompanionProject, tier: loaded.currentTier?.id }
142142
}
143+
// onboardUser's request body uses snake_case tier_id, unlike every other
144+
// camelCase field in these APIs — confirmed against OmniRoute's working
145+
// client. Sending `tierId` here silently fails onboarding (Google's
146+
// request validation just ignores/rejects the unrecognized field).
143147
const onboarded = yield* post(
144148
http,
145149
onboardUserUrl,
146150
accessToken,
147-
{ tierId: loaded.currentTier?.id ?? "free-tier", metadata },
151+
{ tier_id: loaded.currentTier?.id ?? "free-tier", metadata },
148152
OnboardUserResponse,
149153
headers,
150154
)
151-
return { projectID: onboarded.response?.cloudaicompanionProject, tier: loaded.currentTier?.id }
155+
if (onboarded.response?.cloudaicompanionProject) {
156+
return { projectID: onboarded.response.cloudaicompanionProject, tier: loaded.currentTier?.id }
157+
}
158+
// onboardUser's own response doesn't reliably carry the project once
159+
// onboarding completes — OmniRoute re-fetches loadCodeAssist afterward
160+
// to pick it up instead of trusting onboardUser's response shape.
161+
const reloaded = yield* post(http, loadCodeAssistUrl, accessToken, { metadata }, LoadCodeAssistResponse, headers)
162+
return { projectID: reloaded.cloudaicompanionProject, tier: reloaded.currentTier?.id ?? loaded.currentTier?.id }
152163
}).pipe(Effect.catch(() => Effect.succeed({ projectID: undefined, tier: undefined })))
153164
}
154165

0 commit comments

Comments
 (0)