diff --git a/src/utils/glmt-deprecation.ts b/src/utils/glmt-deprecation.ts index 8235aea8..38a3599f 100644 --- a/src/utils/glmt-deprecation.ts +++ b/src/utils/glmt-deprecation.ts @@ -25,11 +25,7 @@ export function isLegacyGlmtBaseUrl(baseUrl: string | null | undefined): boolean return false; } - return ( - normalized === LEGACY_GLMT_BASE_URL || - normalized.includes('/api/coding/paas/v4') || - normalized.endsWith('/chat/completions') - ); + return normalized === LEGACY_GLMT_BASE_URL || normalized.includes('/api/coding/paas/v4'); } export function normalizeDeprecatedGlmtEnv(env: Record): GlmtNormalizationResult { diff --git a/tests/unit/utils/glmt-deprecation.test.ts b/tests/unit/utils/glmt-deprecation.test.ts index d003a9e7..592b370a 100644 --- a/tests/unit/utils/glmt-deprecation.test.ts +++ b/tests/unit/utils/glmt-deprecation.test.ts @@ -20,6 +20,9 @@ describe('glmt deprecation helpers', () => { expect(isLegacyGlmtBaseUrl('https://api.z.ai/api/coding/paas/v4/chat/completions/')).toBe( true ); + expect(isLegacyGlmtBaseUrl('https://private.example.internal/v1/chat/completions')).toBe( + false + ); expect(isLegacyGlmtBaseUrl('https://api.z.ai/api/anthropic')).toBe(false); });