fix(copilot): cancel model policy response bodies · openclaw/openclaw@90ba9fc
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -166,4 +166,18 @@ describe("GitHub Copilot OAuth model policy", () => {
|
166 | 166 | }), |
167 | 167 | ).resolves.toBe(false); |
168 | 168 | }); |
| 169 | + |
| 170 | +it("cancels model enablement response bodies", async () => { |
| 171 | +const cancel = vi.fn(async () => undefined); |
| 172 | +vi.stubGlobal( |
| 173 | +"fetch", |
| 174 | +vi.fn(async () => ({ ok: true, body: { cancel } }) as unknown as Response), |
| 175 | +); |
| 176 | + |
| 177 | +await expect( |
| 178 | +testing.enableGitHubCopilotModel("copilot-token", "claude-sonnet-4.6"), |
| 179 | +).resolves.toBe(true); |
| 180 | + |
| 181 | +expect(cancel).toHaveBeenCalledTimes(1); |
| 182 | +}); |
169 | 183 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。