mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 07:12:12 +03:00
Train 1D: merge via --admin on .113 validation
Squash merge from local merge-train (Hard Rule owner-approved). Tip 029cdf4215cf465f0e1716ac9f84a84692b1e881 validated on 192.168.0.113: 26631/26653 pass.
This commit is contained in:
@@ -191,7 +191,11 @@ export function openaiToClaudeResponse(chunk, state) {
|
||||
}
|
||||
if (parts.length > 0) reasoningContent = parts.join("");
|
||||
}
|
||||
if (reasoningContent && !isInternalReasoningPlaceholder(reasoningContent)) {
|
||||
if (
|
||||
typeof reasoningContent === "string" &&
|
||||
reasoningContent !== "" &&
|
||||
!isInternalReasoningPlaceholder(reasoningContent)
|
||||
) {
|
||||
stopTextBlock(state, results);
|
||||
|
||||
if (!state.thinkingBlockStarted) {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { test } from "node:test";
|
||||
import { openaiToClaudeResponse } from "../../open-sse/translator/response/openai-to-claude.ts";
|
||||
|
||||
test("openai-to-claude ignores zero-length reasoning_content empty string deltas", () => {
|
||||
const state = {
|
||||
messageStartSent: true,
|
||||
thinkingBlockStarted: false,
|
||||
thinkingBlockIndex: -1,
|
||||
textBlockStarted: false,
|
||||
textBlockIndex: -1,
|
||||
textBlockClosed: false,
|
||||
nextBlockIndex: 0,
|
||||
_pendingXmlToolCalls: [],
|
||||
};
|
||||
|
||||
const chunk = {
|
||||
choices: [
|
||||
{
|
||||
delta: {
|
||||
reasoning_content: "",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
const results = openaiToClaudeResponse(chunk, state) || [];
|
||||
assert.equal(results.length, 0);
|
||||
assert.equal(state.thinkingBlockStarted, false);
|
||||
});
|
||||
Reference in New Issue
Block a user