Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/daemon/src/lib/credential-discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ const BUILT_IN_PROVIDER_ENV_MAP: BuiltInProviderEnvMapping[] = [
},
{
providerId: 'glm',
displayName: 'GLM',
displayName: 'Z.ai',
Comment thread
lsm marked this conversation as resolved.
envVar: 'GLM_API_KEY',
altEnvVar: 'ZHIPU_API_KEY',
authType: 'api_key',
Expand Down
7 changes: 4 additions & 3 deletions packages/daemon/src/lib/providers/glm-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import { probeAnthropicCompatCredentials } from './shared/credential-probe.js';
*/
export class GlmProvider implements Provider {
readonly id = 'glm';
readonly displayName = 'GLM (智谱AI)';
// GLM is the model family; the provider/company is Zhipu AI, branded Z.ai.
readonly displayName = 'Z.ai';
Comment thread
lsm marked this conversation as resolved.

readonly capabilities: ProviderCapabilities = {
streaming: true,
Expand Down Expand Up @@ -212,7 +213,7 @@ export class GlmProvider implements Provider {
baseUrl,
apiKey,
model: 'glm-5-turbo',
providerName: 'GLM',
providerName: 'Z.ai',
fetchImpl: this.fetchImpl,
})
.then(() => undefined)
Expand Down Expand Up @@ -269,7 +270,7 @@ export class GlmProvider implements Provider {
// Get API key: session override > global env
const apiKey = sessionConfig?.apiKey || this.getApiKey();
if (!apiKey) {
throw new Error('GLM API key not configured');
throw new Error('Z.ai API key not configured');
}

// Get base URL: session override > default
Expand Down
4 changes: 2 additions & 2 deletions packages/daemon/tests/online/glm/glm-provider.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Integration tests for GLM (智谱AI) provider support
* Integration tests for the Z.ai (智谱AI) provider (model family: GLM)
*
* Covers:
* 1. ProviderService — GLM availability, provider listing, model defaults, provider switching
Expand Down Expand Up @@ -81,7 +81,7 @@ describe('GLM Provider Integration', () => {
// Find GLM
const glm = providers.find((p) => p.id === 'glm');
expect(glm).toBeDefined();
expect(glm!.name).toBe('GLM (智谱AI)');
expect(glm!.name).toBe('Z.ai');
// Note: baseUrl is now undefined in the new provider system (legacy field)
expect(glm!.baseUrl).toBeUndefined();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('GlmProvider', () => {
});

it('should have correct display name', () => {
expect(provider.displayName).toBe('GLM (智谱AI)');
expect(provider.displayName).toBe('Z.ai');
});

it('should have correct capabilities', () => {
Expand Down Expand Up @@ -142,7 +142,7 @@ describe('GlmProvider', () => {
) as unknown as typeof fetch;
provider = new GlmProvider(process.env, fetchImpl);

expect(provider.getModels()).rejects.toThrow('GLM API key rejected (HTTP 401)');
expect(provider.getModels()).rejects.toThrow('Z.ai API key rejected (HTTP 401)');
});

it('throws when probe fails at the network layer', async () => {
Expand All @@ -152,7 +152,7 @@ describe('GlmProvider', () => {
}) as unknown as typeof fetch;
provider = new GlmProvider(process.env, fetchImpl);

expect(provider.getModels()).rejects.toThrow('GLM probe failed: ENOTFOUND');
expect(provider.getModels()).rejects.toThrow('Z.ai probe failed: ENOTFOUND');
});

it('caches successful probe for 30s so repeated calls do not re-probe', async () => {
Expand Down Expand Up @@ -372,7 +372,7 @@ describe('GlmProvider', () => {
delete process.env.GLM_API_KEY;
delete process.env.ZHIPU_API_KEY;

expect(() => provider.buildSdkConfig('glm-5')).toThrow('GLM API key not configured');
expect(() => provider.buildSdkConfig('glm-5')).toThrow('Z.ai API key not configured');
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export type { RuntimeState } from './types/neo';
/**
* Supported AI providers
* - 'anthropic': Default Claude API provider
* - 'glm': GLM (智谱AI) via Anthropic-compatible API
* - 'glm': Z.ai (智谱AI) via Anthropic-compatible API
* - 'minimax': MiniMax via Anthropic-compatible API
* - 'kimi': Kimi (Moonshot AI) via Anthropic-compatible API
* - 'openrouter': OpenRouter Anthropic-compatible API gateway
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/settings/AddProviderModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const QUICK_ADD_PROVIDERS: BuiltInProviderPreset[] = [
},
{
providerId: 'glm',
displayName: 'GLM',
displayName: 'Z.ai',
authType: 'api_key',
description: 'Zhipu AI models',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/hooks/__tests__/useModelSwitcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ describe('useModelSwitcher', () => {
describe('getProviderLabel', () => {
it('should return correct label for known providers', () => {
expect(getProviderLabel('anthropic')).toBe('Anthropic');
expect(getProviderLabel('glm')).toBe('GLM');
expect(getProviderLabel('glm')).toBe('Z.ai');
expect(getProviderLabel('kimi')).toBe('Kimi');
expect(getProviderLabel('minimax')).toBe('MiniMax');
expect(getProviderLabel('openrouter')).toBe('OpenRouter');
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/hooks/useModelSwitcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export function groupModelsByProvider(models: ModelInfo[]): Map<string, ModelInf
/** Provider display labels for UI */
export const PROVIDER_LABELS: Record<string, string> = {
anthropic: 'Anthropic',
glm: 'GLM',
glm: 'Z.ai',
Comment thread
lsm marked this conversation as resolved.
kimi: 'Kimi',
minimax: 'MiniMax',
openrouter: 'OpenRouter',
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/lib/provider-brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const AGGREGATOR_PROVIDERS = new Set(['openrouter']);
// "(free)", "(preview)", or "(1M context)" that disambiguate models.
const KNOWN_PROVIDER_LABELS = [
'Anthropic',
'GLM',
'Z.ai',
Comment thread
lsm marked this conversation as resolved.
'Kimi',
'MiniMax',
'OpenRouter',
Expand Down
Loading