From 9963d02777f957ba50b06c87cee150a767388cc1 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Wed, 22 Jul 2026 18:54:35 -0700 Subject: [PATCH] test(ai): update gateway-chat recipe assertions for ollama chat touchpoint ollama intentionally gained a zero-cost local chat touchpoint in this PR, so the 'embedding-only' assertions that pinned ollama chat-less now assert the new shape: voyage stays chat-less; ollama declares chat at $0 and passes assertTouchpoint on the openai-compat tier. Co-authored-by: StarMan <26191190+starm2010@users.noreply.github.com> Co-Authored-By: Claude Fable 5 --- test/ai/gateway-chat.test.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/test/ai/gateway-chat.test.ts b/test/ai/gateway-chat.test.ts index 4aee06a26..7bf2de566 100644 --- a/test/ai/gateway-chat.test.ts +++ b/test/ai/gateway-chat.test.ts @@ -53,9 +53,16 @@ describe('chat touchpoint — recipe registry', () => { } }); - test('embedding-only providers (voyage, ollama) do NOT declare chat', () => { + test('embedding-only providers (voyage) do NOT declare chat', () => { expect(getRecipe('voyage')!.touchpoints.chat).toBeUndefined(); - expect(getRecipe('ollama')!.touchpoints.chat).toBeUndefined(); + }); + + test('ollama declares a zero-cost local chat touchpoint (#1854)', () => { + const chat = getRecipe('ollama')!.touchpoints.chat; + expect(chat).toBeDefined(); + expect(chat!.models.length).toBeGreaterThan(0); + expect(chat!.cost_per_1m_input_usd).toBe(0); + expect(chat!.cost_per_1m_output_usd).toBe(0); }); test('openai-compat chat recipes have base_url_default', () => { @@ -112,8 +119,10 @@ describe('chat touchpoint — model resolver + aliases (Codex F-OV-5)', () => { test('assertTouchpoint rejects chat on embedding-only providers with a fix hint', () => { expect(() => assertTouchpoint(getRecipe('voyage')!, 'chat', 'voyage-3')) .toThrow(AIConfigError); - expect(() => assertTouchpoint(getRecipe('ollama')!, 'chat', 'nomic-embed-text')) - .toThrow(AIConfigError); + // ollama gained a chat touchpoint (#1854); openai-compat tier accepts + // arbitrary models, so it no longer rejects here. + expect(() => assertTouchpoint(getRecipe('ollama')!, 'chat', 'llama3.3')) + .not.toThrow(); }); test('assertTouchpoint rejects unknown native model with the model list in the fix hint', () => {