fix(claude-to-openai): emit closing </think> tag instead of empty reasoning_content (#454)

Replace empty reasoning_content with explicit </think> closing tag when exiting thinking block to properly signal end of reasoning section in streaming responses.
This commit is contained in:
Kwan96
2026-03-31 09:21:11 +07:00
committed by GitHub
parent 01787a3d5b
commit ffa172c92d

View File

@@ -95,7 +95,7 @@ export function claudeToOpenAIResponse(chunk, state) {
break;
}
if (state.inThinkingBlock && chunk.index === state.currentBlockIndex) {
results.push(createChunk(state, { reasoning_content: "" }));
results.push(createChunk(state, { content: "</think>" }));
state.inThinkingBlock = false;
}
state.textBlockStarted = false;