diff --git a/changelog.d/maintenance/antigravity-nonstream-test-realign.md b/changelog.d/maintenance/antigravity-nonstream-test-realign.md new file mode 100644 index 0000000000..b116718b81 --- /dev/null +++ b/changelog.d/maintenance/antigravity-nonstream-test-realign.md @@ -0,0 +1 @@ +- Realign the Antigravity non-streaming 429-retry test with the executor's actual contract: it returns the already-converted OpenAI `chat.completion` payload, so the test asserts that payload directly instead of re-parsing it as raw SSE (which returned `null` and failed the release-tip unit suite). diff --git a/tests/unit/antigravity-streaming-passthrough.test.ts b/tests/unit/antigravity-streaming-passthrough.test.ts index 23715cbae3..5aef685b7b 100644 --- a/tests/unit/antigravity-streaming-passthrough.test.ts +++ b/tests/unit/antigravity-streaming-passthrough.test.ts @@ -9,7 +9,6 @@ import { AntigravityExecutor, createCreditsExtractionTransform, } from "../../open-sse/executors/antigravity.ts"; -import { parseSSEToGeminiResponse } from "../../open-sse/handlers/sseParser/geminiResponse.ts"; import { clearAntigravityVersionCache, seedAntigravityVersionCache, @@ -73,11 +72,10 @@ test("AntigravityExecutor.execute auto-retries short 429 responses and collects credentials: { accessToken: "token", projectId: "project-1" }, log: { debug() {}, warn() {} }, }); - // Non-streaming now returns raw SSE; parse it the way chatCore would. - const rawSSE = await result.response.text(); - const parsed = parseSSEToGeminiResponse(rawSSE, "antigravity/gemini-2.5-flash"); - assert.ok(parsed, "parseSSEToGeminiResponse should parse the SSE"); - const payload = parsed as ChatCompletionPayload; + // Non-streaming collects the upstream SSE and returns the already-converted + // OpenAI chat.completion payload — no further SSE parsing on the caller side. + const payload = JSON.parse(await result.response.text()) as ChatCompletionPayload; + assert.equal(payload.object, "chat.completion"); assert.equal(calls.length, 2); assert.equal(result.response.status, 200);