chore: generate

This commit is contained in:
opencode-agent[bot]
2026-06-05 03:21:15 +00:00
parent b551fa85c5
commit d7cdbc99e3
3 changed files with 25 additions and 13 deletions
@@ -173,10 +173,18 @@ describe("cortexFetch", () => {
bun_it("rewrites role:'' to role:'assistant' in streaming SSE chunks", async () => {
const chunk = `data: {"choices":[{"delta":{"role":"","content":"Hi"},"index":0}]}\n\n`
const upstream: FetchLike = async () =>
new Response(new ReadableStream({ start: (ctrl) => { ctrl.enqueue(new TextEncoder().encode(chunk)); ctrl.close() } }), {
status: 200,
headers: { "content-type": "text/event-stream" },
})
new Response(
new ReadableStream({
start: (ctrl) => {
ctrl.enqueue(new TextEncoder().encode(chunk))
ctrl.close()
},
}),
{
status: 200,
headers: { "content-type": "text/event-stream" },
},
)
const response = await cortexFetch(upstream)("https://test", {})
const text = await response.text()
expect(text).toContain('"role":"assistant"')