From 553898e52908d963b55fc60e072cc99599c9c639 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Thu, 6 Aug 2026 03:20:41 +0800 Subject: [PATCH] fix(fixture): drop the unreachable merge-extension pricing fallback Fixture-authored content is the closed base vocabulary, so after the text/reasoning/tool-call arms only tool-result remains; the literal comparison and its JSON fallback were dead and failed oxlint. --- packages/client/connection/src/client/fixture.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/client/connection/src/client/fixture.ts b/packages/client/connection/src/client/fixture.ts index 918b421a08..8528cf0184 100644 --- a/packages/client/connection/src/client/fixture.ts +++ b/packages/client/connection/src/client/fixture.ts @@ -846,10 +846,9 @@ function estimateFixtureContent(blocks: readonly ContentBlock[]): number { if (block.type === 'tool-call') { return tokens + densityPrice(block.name) + densityPrice(block.arguments) + BLOCK_OVERHEAD } - if (block.type === 'tool-result') { - return tokens + estimateFixtureContent(block.content) + BLOCK_OVERHEAD - } - return tokens + densityPrice(JSON.stringify(block)) + BLOCK_OVERHEAD + // Fixture-authored content is the closed base vocabulary, so tool-result + // is the only remaining shape — no merge-extension fallback can occur. + return tokens + estimateFixtureContent(block.content) + BLOCK_OVERHEAD }, 0) }