fix(small-model): use selected runtime model endpoint (#3437)

This commit is contained in:
Matt Cowger
2026-09-09 08:29:23 +03:00
committed by GitHub
parent 458dcf78c0
commit 66af9b52c7
5 changed files with 63 additions and 14 deletions
@@ -14,7 +14,10 @@ const providerPayload = (overrides = {}) => ({
id: 'llmapi',
source: 'config',
options: { apiKey: 'plugin-key', baseURL: 'https://api.llmapi.ai/v1/' },
models: { 'claude-opus-4-8': { api: { id: 'claude-opus-4-8', url: '', npm: '@ai-sdk/anthropic' } } },
models: {
'claude-opus-4-8': { api: { id: 'claude-opus-4-8', url: '', npm: '@ai-sdk/anthropic' } },
'gpt-5.6-luna': { api: { id: 'gpt-5.6-luna', url: 'https://api.llmapi.ai/v1', npm: '@ai-sdk/openai' } },
},
},
{
id: 'opencode',
@@ -59,6 +62,9 @@ describe('OpenCode runtime provider snapshot', () => {
const provider = await getRuntimeProvider('llmapi');
expect(provider).toMatchObject({ apiKey: 'plugin-key', baseURL: 'https://api.llmapi.ai/v1' });
expect(provider.models.get('gpt-5.6-luna')).toEqual({
api: { url: 'https://api.llmapi.ai/v1', npm: '@ai-sdk/openai' },
});
expect(fetchMock.mock.calls[0][0]).toBe('http://127.0.0.1:4096/provider');
expect(fetchMock.mock.calls[0][1].headers).toMatchObject({ Authorization: 'Basic test' });
});