From b235acebb2bf73f41a8cee00f9d548d28526d5bc Mon Sep 17 00:00:00 2001 From: Turtle Date: Mon, 19 Oct 2026 15:24:47 +0800 Subject: [PATCH] test(llm-pi-ai): cover same-API signature stripping and stored replay signature --- packages/llm/llm-pi-ai/tests/protocol-roundtrip.spec.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/llm/llm-pi-ai/tests/protocol-roundtrip.spec.ts b/packages/llm/llm-pi-ai/tests/protocol-roundtrip.spec.ts index f3daac2842..82644ab561 100644 --- a/packages/llm/llm-pi-ai/tests/protocol-roundtrip.spec.ts +++ b/packages/llm/llm-pi-ai/tests/protocol-roundtrip.spec.ts @@ -111,7 +111,7 @@ function expectToolPairs(request: unknown, api: Api): void { const tool = { name: 'lookup', description: 'Look up a value.', parameters: { type: 'object', properties: { key: { type: 'number' } }, required: ['key'] } } const pairs: { a: Api; b: Api | 'deepseek-messages' }[] = [ - ...apis.flatMap(a => apis.filter(b => b !== a).map(b => ({ a, b }))), + ...apis.flatMap(a => apis.map(b => ({ a, b }))), ...apis.map(a => ({ a, b: 'deepseek-messages' as const })), ] @@ -154,6 +154,9 @@ describe('protocol history round trips', () => { { type: 'text', textSignature: JSON.stringify({ v: 1, id: 'msg_empty' }) }, ]) expect(original.message.source).toMatchObject({ replayState: { response: { responseId: 'resp_original' }, blocks } }) + } else { + const blocks = (original.message.source as { replayState: { blocks: unknown[] } }).replayState.blocks.filter(block => (block as { type: string }).type === 'tool-call') + expect(blocks).toEqual([{ type: 'tool-call', thoughtSignature: 'gemini-signature' }, { type: 'tool-call' }]) } history.push(original.message, ...calls.map(call => createToolResultMessage({ callId: call.id, content: [{ type: 'text', text: 'value' }], isError: false,