mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 16:14:31 +00:00
fix(cliproxy): harden xAI provider contracts
This commit is contained in:
1 parent
90c0409aac
commit
4e4c949967
8 files changed
+110
-15
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { MODEL_CATALOGS } from '@/lib/model-catalogs';
|
||||
import { buildUiCatalog, MODEL_CATALOGS, supportsExtendedContext } from '@/lib/model-catalogs';
|
||||
|
||||
describe('xAI model catalog defaults', () => {
|
||||
it('mirrors the CLIProxyAPI text catalog and default tier routing', () => {
|
||||
@@ -27,4 +27,31 @@ describe('xAI model catalog defaults', () => {
|
||||
haiku: 'grok-composer-2.5-fast',
|
||||
});
|
||||
});
|
||||
|
||||
it('does not expose Claude [1m] suffix support for xAI model IDs', () => {
|
||||
const catalog = MODEL_CATALOGS.xai;
|
||||
|
||||
for (const model of catalog.models) {
|
||||
expect(model.extendedContext).not.toBe(true);
|
||||
expect(supportsExtendedContext('xai', model.id)).toBe(false);
|
||||
}
|
||||
});
|
||||
|
||||
it('strips generic extended-context metadata from live xAI catalogs', () => {
|
||||
const catalog = buildUiCatalog('xai', {
|
||||
provider: 'xai',
|
||||
displayName: 'xAI (Grok)',
|
||||
defaultModel: 'grok-4.3',
|
||||
models: [
|
||||
{
|
||||
id: 'grok-4.3',
|
||||
name: 'Grok 4.3',
|
||||
extendedContext: true,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
expect(catalog?.models[0]?.extendedContext).toBeUndefined();
|
||||
expect(supportsExtendedContext('xai', 'grok-4.3', catalog)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user