fix(antigravity): fetch default mapping from API and sync Redis on rate limit
1. Frontend: replace hardcoded antigravityDefaultMappings with async fetch from GET /admin/accounts/antigravity/default-model-mapping, eliminating the duplicate data source that caused frontend/backend mapping inconsistency. 2. Backend: convert handleSmartRetry and antigravityRetryLoop from standalone functions to AntigravityGatewayService methods, enabling Redis cache sync (updateAccountModelRateLimitInCache) after both rate-limit write paths — long-delay branch and retry-exhausted branch.
This commit is contained in:
@@ -387,6 +387,17 @@ export async function importData(payload: {
|
||||
return data
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Antigravity default model mapping from backend
|
||||
* @returns Default model mapping (from -> to)
|
||||
*/
|
||||
export async function getAntigravityDefaultModelMapping(): Promise<Record<string, string>> {
|
||||
const { data } = await apiClient.get<Record<string, string>>(
|
||||
'/admin/accounts/antigravity/default-model-mapping'
|
||||
)
|
||||
return data
|
||||
}
|
||||
|
||||
export const accountsAPI = {
|
||||
list,
|
||||
getById,
|
||||
@@ -412,7 +423,8 @@ export const accountsAPI = {
|
||||
bulkUpdate,
|
||||
syncFromCrs,
|
||||
exportData,
|
||||
importData
|
||||
importData,
|
||||
getAntigravityDefaultModelMapping
|
||||
}
|
||||
|
||||
export default accountsAPI
|
||||
|
||||
Reference in New Issue
Block a user