From b4452d656b4ddd9c5ee57133249255a77fb504e2 Mon Sep 17 00:00:00 2001 From: erio Date: Sat, 14 Mar 2026 21:14:45 +0800 Subject: [PATCH] fix(test): correct 401 escalation test for Gemini platform The test case was named "antigravity_stays_temp" but used PlatformGemini, which should escalate on 401 second hit per upstream logic. --- backend/internal/service/error_policy_test.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/internal/service/error_policy_test.go b/backend/internal/service/error_policy_test.go index 1957ef9468..4099399b7c 100644 --- a/backend/internal/service/error_policy_test.go +++ b/backend/internal/service/error_policy_test.go @@ -110,13 +110,12 @@ func TestCheckErrorPolicy(t *testing.T) { expected: ErrorPolicyTempUnscheduled, }, { - // Antigravity 401 不走升级逻辑(由 applyErrorPolicy 的 temp_unschedulable_rules 自行控制), - // second hit 仍然返回 TempUnscheduled。 - name: "temp_unschedulable_401_second_hit_antigravity_stays_temp", + // Gemini OAuth 401 second hit 会升级为 error(返回 None,交由默认错误逻辑处理)。 + name: "temp_unschedulable_401_second_hit_gemini_escalates", account: &Account{ ID: 15, Type: AccountTypeOAuth, - Platform: PlatformGemini, // 非 Antigravity 平台才有 401 升级逻辑 + Platform: PlatformGemini, // 非 Antigravity 平台 401 second hit 升级 TempUnschedulableReason: `{"status_code":401,"until_unix":1735689600}`, Credentials: map[string]any{ "temp_unschedulable_enabled": true, @@ -131,7 +130,7 @@ func TestCheckErrorPolicy(t *testing.T) { }, statusCode: 401, body: []byte(`unauthorized`), - expected: ErrorPolicyTempUnscheduled, + expected: ErrorPolicyNone, // Gemini 401 second hit 升级为 error }, { name: "temp_unschedulable_401_antigravity_no_escalation",