修复吞字问题

This commit is contained in:
CJACK
2026-05-01 01:31:48 +08:00
parent fca8c01397
commit 92e321fe2c
11 changed files with 257 additions and 47 deletions

View File

@@ -511,14 +511,23 @@ test('parseChunkForContent drops thinking content when thinking is disabled', ()
'text',
);
assert.equal(thinking.finished, false);
assert.equal(thinking.newType, 'text');
assert.equal(thinking.newType, 'thinking');
assert.deepEqual(thinking.parts, []);
const hiddenContinuation = parseChunkForContent(
{ v: 'still hidden' },
false,
thinking.newType,
);
assert.equal(hiddenContinuation.newType, 'thinking');
assert.deepEqual(hiddenContinuation.parts, []);
const answer = parseChunkForContent(
{ p: 'response/content', v: 'visible answer' },
false,
thinking.newType,
hiddenContinuation.newType,
);
assert.equal(answer.newType, 'text');
assert.deepEqual(answer.parts, [{ text: 'visible answer', type: 'text' }]);
});