fix(commandcode): retry on transient stream error and avoid fake stop chunks

This commit is contained in:
Christian Gennari
2026-09-18 17:07:32 +07:00
committed by decolua
parent b3d6e089c6
commit 092c84eac9
4 changed files with 65 additions and 8 deletions

View File

@@ -133,6 +133,10 @@ function convertMessages(messages = []) {
if (role === ROLE.ASSISTANT) {
const blocks = [];
const rc = m.reasoning_content || m.thought || m.reasoning;
if (rc || (Array.isArray(m.tool_calls) && m.tool_calls.length > 0)) {
blocks.push({ type: "reasoning", text: rc || " " });
}
const text = flattenText(m.content);
if (text) blocks.push({ type: OPENAI_BLOCK.TEXT, text });
if (Array.isArray(m.tool_calls)) {