fix: avoid duplicate call to extractReasoningContentFromMessage (#2661)

In convertToSteps(), the extractReasoningContentFromMessage function was
called twice for the same message - once to check if reasoning exists and
again to assign it to the step object. Reuse the already-extracted value
from the local variable instead.
This commit is contained in:
Jsonz
2026-04-30 11:33:49 +08:00
committed by GitHub
parent 08afdcb907
commit 24a5a00679
@@ -451,7 +451,7 @@ function convertToSteps(messages: Message[]): CoTStep[] {
id: message.id,
messageId: message.id,
type: "reasoning",
reasoning: extractReasoningContentFromMessage(message),
reasoning,
};
steps.push(step);
}