Repository navigation
fix(antigravity): attempt onboarding when projectId is empty (#5193 regression of #2541) - #7815
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Thanks for the sharp root-cause trace here -- the regression chain (#2219 -> #2569 -> #5193 -> this) is exactly right, and the Verified locally: checked out the branch in an isolated worktree and ran the full test file -- all 5 tests pass (2 preserved + 3 new), confirming the fix and the graceful-degradation/timeout-bound behavior. One process item before this can merge: the PR is currently based on Minor non-blocking note for your own tracking: the worst-case added latency when all four bounded network calls (userInfo, loadCodeAssist, onboardUser, retry-loadCodeAssist) are slow-but-not-timing-out is closer to ~32s than the "+8s" mentioned in the description -- still fully bounded (no infinite hang), just worth knowing. Nice work overall -- clean, surgical, well-tested fix for a real bug. |
…-inference#5193 regression of cheaper-inference#2541) PR cheaper-inference#5193 changed onboarding from inline await to fire-and-forget gated by if (projectId), which never fires when projectId is empty — the exact case that needs onboarding. This re-introduced the cheaper-inference#2541 catch-22. Add an else-if branch that attempts onboarding inline (bounded by AbortSignal.timeout) when projectId is empty, then retries loadCodeAssist to discover the newly created project. - Existing accounts with projectId: unchanged (fire-and-forget) - New accounts without projectId: now onboarded within login flow - Timeout bounded: +8s worst case (onboardUser + retry loadCodeAssist) - Graceful degradation: if onboarding fails, lazy retry handles it Tests: - 3 new tests covering empty-projectId onboarding path (RED→GREEN) - Existing 2 tests preserved and passing - Adjusted timeout assertion for the stall test (now includes onboardUser stall) - 5/5 passing on Node 24 Fixes cheaper-inference#7814 Related: cheaper-inference#5193, cheaper-inference#2569, cheaper-inference#2541, cheaper-inference#2219
…tId fix (cheaper-inference#7814) Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com>
f5fc76e to
883febd
Compare
…heaper-inference#5193 regression of cheaper-inference#2541)" This reverts commit b36d3b6. That commit is a byte-identical duplicate of the antigravity onboarding fix shipped separately in PR cheaper-inference#7815 (same author, same diff to src/lib/oauth/providers/antigravity.ts and its test file). Keeping it here would ship and credit the same fix twice across two PRs. cheaper-inference#7808 is scoped to the cheaper-inference#7791 global-install alias-resolver fix only; the antigravity fix stays in cheaper-inference#7815. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
Validated in local merge-train on tomni-proxmox-113 @ 19bcf534352e24cdd2448cdfdfd64d5bd9695c74 (FAST gates green: static + changed tests + vitest) |
bf9202d
into
cheaper-inference:release/v3.8.49
…-inference#5193 regression of cheaper-inference#2541) (cheaper-inference#7815) * fix(antigravity): attempt onboarding when projectId is empty (cheaper-inference#5193 regression of cheaper-inference#2541) PR cheaper-inference#5193 changed onboarding from inline await to fire-and-forget gated by if (projectId), which never fires when projectId is empty — the exact case that needs onboarding. This re-introduced the cheaper-inference#2541 catch-22. Add an else-if branch that attempts onboarding inline (bounded by AbortSignal.timeout) when projectId is empty, then retries loadCodeAssist to discover the newly created project. - Existing accounts with projectId: unchanged (fire-and-forget) - New accounts without projectId: now onboarded within login flow - Timeout bounded: +8s worst case (onboardUser + retry loadCodeAssist) - Graceful degradation: if onboarding fails, lazy retry handles it Tests: - 3 new tests covering empty-projectId onboarding path (RED→GREEN) - Existing 2 tests preserved and passing - Adjusted timeout assertion for the stall test (now includes onboardUser stall) - 5/5 passing on Node 24 Fixes cheaper-inference#7814 Related: cheaper-inference#5193, cheaper-inference#2569, cheaper-inference#2541, cheaper-inference#2219 * docs(changelog): add fragment for antigravity onboarding empty-projectId fix (cheaper-inference#7814) Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> Co-authored-by: Rafael Dias Zendron <rafaumeu@users.noreply.github.com>
…-inference#5193 regression of cheaper-inference#2541) (cheaper-inference#7815) * fix(antigravity): attempt onboarding when projectId is empty (cheaper-inference#5193 regression of cheaper-inference#2541) PR cheaper-inference#5193 changed onboarding from inline await to fire-and-forget gated by if (projectId), which never fires when projectId is empty — the exact case that needs onboarding. This re-introduced the cheaper-inference#2541 catch-22. Add an else-if branch that attempts onboarding inline (bounded by AbortSignal.timeout) when projectId is empty, then retries loadCodeAssist to discover the newly created project. - Existing accounts with projectId: unchanged (fire-and-forget) - New accounts without projectId: now onboarded within login flow - Timeout bounded: +8s worst case (onboardUser + retry loadCodeAssist) - Graceful degradation: if onboarding fails, lazy retry handles it Tests: - 3 new tests covering empty-projectId onboarding path (RED→GREEN) - Existing 2 tests preserved and passing - Adjusted timeout assertion for the stall test (now includes onboardUser stall) - 5/5 passing on Node 24 Fixes cheaper-inference#7814 Related: cheaper-inference#5193, cheaper-inference#2569, cheaper-inference#2541, cheaper-inference#2219 * docs(changelog): add fragment for antigravity onboarding empty-projectId fix (cheaper-inference#7814) Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> Co-authored-by: Rafael Dias Zendron <rafaumeu@users.noreply.github.com>
Summary
Fixes #7814 — PR #5193 regression of #2541.
Accounts without a pre-existing Google Cloud Code project get stuck in a login catch-22:
loadCodeAssistreturns emptyprojectId, but the fire-and-forget onboarding gateif (projectId)never fires for empty projectId — so onboarding never runs.Changes
src/lib/oauth/providers/antigravity.ts— Addelse ifbranch after the existingif (projectId)gate:projectIdis empty ANDonboardUserEndpointsare configured, attempt onboarding inline (bounded byAbortSignal.timeout(8s))loadCodeAssist(also 8s-bounded) to discover the newly created projectantigravityProjectBootstrap.ts) handles ittests/unit/antigravity-oauth-postexchange-nonblocking.test.ts— 3 new tests:postExchange attempts onboarding when projectId is empty and returns discovered projectId— verifies the fix works end-to-endpostExchange falls back to empty projectId when onboardUser fails— verifies graceful degradationpostExchange is timeout-bounded during onboarding attempt (empty projectId)— verifies no infinite hangAlso adjusted existing timeout assertion test to account for the new onboarding attempt (+8s budget when projectId is empty).
Behavior Matrix
Tradeoff
Adds at most +8s to login flow when projectId is empty (onboarding attempt + retry loadCodeAssist, both timeout-bounded). This only affects new accounts without a project — a one-time cost. The alternative (permanently empty projectId) is a broken login.
Tests
All 5 tests passing on Node 24:
Checklist