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 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-07-22 18:54:35 -07:00
co-authored by StarMan Claude Fable 5
parent 269dedc038
commit 9963d02777
+13 -4
View File
@@ -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', () => {