feat(antigravity): 从 LoadCodeAssist 复用 TierInfo 提取 plan_type
复用已有 GetTier() 返回的 tier ID(free-tier / g1-pro-tier / g1-ultra-tier),通过 TierIDToPlanType 映射为 Free / Pro / Ultra, 在 loadProjectIDWithRetry 中顺带提取并写入 credentials.plan_type; 前端增加 Abnormal 异常套餐红色标记。 Made-with: Cursor
This commit is contained in:
@@ -16,3 +16,26 @@ func TestApplyAntigravityPrivacyMode_SetsInMemoryExtra(t *testing.T) {
|
||||
t.Fatalf("expected privacy_mode %q, got %v", AntigravityPrivacySet, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyAntigravityPrivacyMode_PreservedBySubscriptionResult(t *testing.T) {
|
||||
account := &Account{
|
||||
Credentials: map[string]any{
|
||||
"access_token": "token",
|
||||
},
|
||||
Extra: map[string]any{
|
||||
"existing": "value",
|
||||
},
|
||||
}
|
||||
applyAntigravityPrivacyMode(account, AntigravityPrivacySet)
|
||||
|
||||
_, extra := applyAntigravitySubscriptionResult(account, AntigravitySubscriptionResult{
|
||||
PlanType: "Pro",
|
||||
})
|
||||
|
||||
if got := extra["privacy_mode"]; got != AntigravityPrivacySet {
|
||||
t.Fatalf("expected subscription writeback to keep privacy_mode %q, got %v", AntigravityPrivacySet, got)
|
||||
}
|
||||
if got := extra["existing"]; got != "value" {
|
||||
t.Fatalf("expected existing extra fields to be preserved, got %v", got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user