diff --git a/dist/index.js b/dist/index.js index 53f411e55a4c9a06fd29bb4ab8161c4ad15980cd..71b91f196c8b886ed90dd237dec5625d79d5677e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -12676,10 +12676,13 @@ var OpenAIResponsesLanguageModel = class { } }); } else if (value.item.type === "message") { - controller.enqueue({ - type: "text-end", - id: value.item.id - }); + // Fix for gpt-5-codex: use currentTextId to ensure text-end matches text-start + if (currentTextId) { + controller.enqueue({ + type: "text-end", + id: currentTextId + }); + } currentTextId = null; } else if (isResponseOutputItemDoneReasoningChunk(value)) { const activeReasoningPart = activeReasoning[value.item.id]; diff --git a/dist/index.mjs b/dist/index.mjs index 7719264da3c49a66c2626082f6ccaae6e3ef5e89..090fd8cf142674192a826148428ed6a0c4a54e35 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -12670,10 +12670,13 @@ var OpenAIResponsesLanguageModel = class { } }); } else if (value.item.type === "message") { - controller.enqueue({ - type: "text-end", - id: value.item.id - }); + // Fix for gpt-5-codex: use currentTextId to ensure text-end matches text-start + if (currentTextId) { + controller.enqueue({ + type: "text-end", + id: currentTextId + }); + } currentTextId = null; } else if (isResponseOutputItemDoneReasoningChunk(value)) { const activeReasoningPart = activeReasoning[value.item.id];