-
-
Notifications
You must be signed in to change notification settings - Fork 260
Fix image retry loop #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix image retry loop #226
Conversation
WalkthroughThe changes implement header-style-aware rate limiting and expand explicit quota handling for image models. The Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (5)
🧰 Additional context used🧬 Code graph analysis (3)src/plugin/accounts.test.ts (1)
src/plugin/transform/model-resolver.test.ts (2)
src/plugin/accounts.ts (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (5)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryFixes infinite retry loop for image generation models when quota limits are reached. Previously, when image models hit the antigravity quota limit, The fix adds strict quota tracking:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant Plugin as plugin.ts
participant Resolver as model-resolver.ts
participant AccountMgr as AccountManager
Note over Client,AccountMgr: Image Model Request (e.g., gemini-3-pro-image)
Client->>Plugin: Request with image model
Plugin->>Resolver: resolveModelWithTier(model)
Resolver->>Resolver: Detect IMAGE_GENERATION_MODELS regex
Resolver->>Resolver: Set explicitQuota=true (NEW)
Resolver-->>Plugin: {explicitQuota: true, quotaPreference: "antigravity"}
Plugin->>AccountMgr: getCurrentOrNextForFamily()
AccountMgr->>AccountMgr: Check rate limits
alt Account available
AccountMgr-->>Plugin: Return account
Plugin->>Client: Process request
else All accounts rate-limited
AccountMgr-->>Plugin: null
Plugin->>Plugin: getHeaderStyleFromUrl() → "antigravity"
Plugin->>Plugin: isExplicitQuotaFromUrl() → true
Plugin->>AccountMgr: getMinWaitTimeForFamily(family, model, "antigravity", true)
Note over AccountMgr: NEW: strict=true, headerStyle="antigravity"
AccountMgr->>AccountMgr: Filter by isRateLimitedForHeaderStyle<br/>(strict quota check)
AccountMgr->>AccountMgr: Calculate wait time for<br/>specific antigravity quota pool
AccountMgr-->>Plugin: waitMs (e.g., 30000)
Plugin->>Client: Return 429 with retry-after
end
Note over Plugin,AccountMgr: Before fix: Used fallback logic (EITHER pool)<br/>After fix: Respects strict antigravity quota
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
Fix for 164, resolves account rotation on quota limits reached with image model.