Skip to content

Commit ecc88e1

Browse files
fix(openai): accept missing content-type on ChatGPT Responses SSE stream
1 parent 494c01c commit ecc88e1

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/agents/provider-transport-fetch.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,12 @@ describe("buildGuardedModelFetch", () => {
300300
);
301301

302302
expect(response.headers.get("content-type")).toContain("text/event-stream");
303-
await expect(response.text()).resolves.toContain("response.created");
303+
const items = [];
304+
for await (const item of Stream.fromSSEResponse(response, new AbortController())) {
305+
items.push(item);
306+
}
307+
308+
expect(items).toEqual([{ ok: true }]);
304309
expect(release).toHaveBeenCalledTimes(1);
305310
});
306311

0 commit comments

Comments
 (0)