fix(auth): cancel WHAM probe error bodies · openclaw/openclaw@8aaf937
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -1091,6 +1091,19 @@ describe("markAuthProfileFailure — WHAM-aware Codex cooldowns", () => {
|
1091 | 1091 | expect(store.usageStats?.["openai:default"]?.cooldownUntil).toBe(now + 300_000); |
1092 | 1092 | }); |
1093 | 1093 | |
| 1094 | +it("cancels WHAM HTTP error response bodies", async () => { |
| 1095 | +const now = 1_700_000_000_000; |
| 1096 | +const store = makeStore({}); |
| 1097 | +const response = new Response("server busy", { status: 500 }); |
| 1098 | +const cancel = vi.spyOn(response.body!, "cancel").mockResolvedValue(undefined); |
| 1099 | +fetchMock.mockResolvedValueOnce(response); |
| 1100 | + |
| 1101 | +await markCodexFailureAt({ store, now }); |
| 1102 | + |
| 1103 | +expect(cancel).toHaveBeenCalledOnce(); |
| 1104 | +expect(store.usageStats?.["openai:default"]?.cooldownUntil).toBe(now + 300_000); |
| 1105 | +}); |
| 1106 | + |
1094 | 1107 | it("preserves a longer existing cooldown via max semantics", async () => { |
1095 | 1108 | const now = 1_700_000_000_000; |
1096 | 1109 | const existingCooldownUntil = now + 6 * 60 * 60 * 1000; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。