mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 16:19:27 +00:00
fix: route OpenRouter profiles through v1 API
This commit is contained in:
@@ -134,7 +134,7 @@ describe('profile-writer Anthropic direct', () => {
|
||||
it('preserves OpenRouter ANTHROPIC_API_KEY blank behavior', () => {
|
||||
const result = createApiProfile(
|
||||
'openrouter-test',
|
||||
'https://openrouter.ai/api',
|
||||
'https://openrouter.ai/api/v1',
|
||||
'sk-or-testkey',
|
||||
{ default: 'anthropic/claude-opus-4.5', opus: 'anthropic/claude-opus-4.5', sonnet: 'anthropic/claude-opus-4.5', haiku: 'anthropic/claude-opus-4.5' }
|
||||
);
|
||||
@@ -145,7 +145,7 @@ describe('profile-writer Anthropic direct', () => {
|
||||
const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
|
||||
|
||||
// OpenRouter: proxy mode with ANTHROPIC_API_KEY explicitly blank
|
||||
expect(settings.env.ANTHROPIC_BASE_URL).toBe('https://openrouter.ai/api');
|
||||
expect(settings.env.ANTHROPIC_BASE_URL).toBe('https://openrouter.ai/api/v1');
|
||||
expect(settings.env.ANTHROPIC_AUTH_TOKEN).toBe('sk-or-testkey');
|
||||
expect(settings.env.ANTHROPIC_API_KEY).toBe('');
|
||||
});
|
||||
|
||||
@@ -92,6 +92,11 @@ describe('provider-presets', () => {
|
||||
expect(isValidPresetId('hf')).toBe(true);
|
||||
});
|
||||
|
||||
it('uses OpenRouter v1 as the OpenAI-compatible API root', () => {
|
||||
const preset = getPresetById('openrouter');
|
||||
expect(preset?.baseUrl).toBe('https://openrouter.ai/api/v1');
|
||||
});
|
||||
|
||||
it('keeps Anthropic direct last in the recommended preset order and reuses the Claude logo', () => {
|
||||
const recommendedPresetIds = PROVIDER_PRESETS.filter(
|
||||
(preset) => preset.category === 'recommended'
|
||||
|
||||
Reference in New Issue
Block a user