Skip to content

fix: relabel GLM provider display to Z.ai - #2273

Open
lsm wants to merge 2 commits into
devfrom
space/rename-glm-provider-display-to-z-ai-glm-is-the-model-name
Open

fix: relabel GLM provider display to Z.ai#2273
lsm wants to merge 2 commits into
devfrom
space/rename-glm-provider-display-to-z-ai-glm-is-the-model-name

Conversation

@lsm

@lsm lsm commented Jul 27, 2026

Copy link
Copy Markdown
Owner

GLM is the model family (GLM-5, GLM-5.2…), not the provider/company (Zhipu AI, internationally branded Z.ai). The provider was labelled "GLM" next to models named "GLM-5" — confusing and redundant.

Change

Display-only rename of every user-facing provider label from GLM → Z.ai. Model names (GLM-5, GLM-5.2, …) are unchanged — GLM is the model name.

Surface Before After
Model-picker group header GLM Z.ai
Add-provider card title GLM Z.ai
Provider displayName GLM (智谱AI) Z.ai
Credential-probe errors GLM API key rejected Z.ai API key rejected

Unchanged (by design — no migration, existing configs keep working)

Provider id glm, model ids/aliases/family, registry routing, settings.json keys, env vars (GLM_API_KEY / ZHIPU_API_KEY), stored credentials, brand color #7DD3FC, and the ProviderLogo Z-mark.

Test plan

  • bun run check (lint + typecheck + knip + guards) passes
  • daemon glm-provider unit + related (provider-service, credential-discovery) pass
  • web useModelSwitcher, provider-brand, AddProviderModal, ProvidersSettings pass
  • grep confirms no user-facing GLM provider labels remain; remaining "GLM" strings are model names, env vars, or routing keys

Closes #770

GLM is the model family (GLM-5, GLM-5.2...), not the provider/company
(Zhipu AI, internationally branded Z.ai). The provider was labelled "GLM"
next to models named "GLM-5" — confusing and redundant. This is a
display-only rename; the internal provider id 'glm', model ids, aliases,
family, registry routing, settings.json keys, env vars (GLM_API_KEY /
ZHIPU_API_KEY), stored credentials, and brand color are all unchanged, so
existing sessions/configs keep working with no migration.

User-facing provider labels updated to "Z.ai":
- GlmProvider.displayName (was 'GLM (智谱AI)')
- credential-probe providerName (surfaces in health-check errors)
- buildSdkConfig missing-key error
- credential-discovery BUILT_IN_PROVIDER_ENV_MAP displayName
- useModelSwitcher PROVIDER_LABELS (picker group header)
- AddProviderModal preset displayName (description stays 'Zhipu AI models',
  matching the Kimi -> 'Moonshot AI models' precedent)
- provider-brand KNOWN_PROVIDER_LABELS (trailing-tag stripper)

Model names (GLM-5, GLM-5.1, GLM-5.2, GLM-5-Turbo, GLM-5V-Turbo, GLM-4.7)
are intentionally unchanged — GLM is the model name.

@lsm lsm left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Review by glm-5.1 (Z.ai)

Model: glm-5.1 | Client: NeoKai | Provider: Z.ai

Recommendation: REQUEST_CHANGES — posting as COMMENT because the PR is authored under the same account (lsm), so GitHub rejects REQUEST_CHANGES/APPROVE on my own PR.

What is correct

The display-only relabel is clean and accurate in every file it touches: provider displayName (glm-provider.ts), credential-probe providerName, buildSdkConfig missing-key error, PROVIDER_LABELS (useModelSwitcher.ts), AddProviderModal preset, credential-discovery.ts displayName, and KNOWN_PROVIDER_LABELS (provider-brand.ts). The doc comment in shared/types.ts is updated too.

Unchanged by design and verified intact: provider id glm, model ids/aliases/family, registry routing, settings.json keys, env vars (GLM_API_KEY/ZHIPU_API_KEY), stored credentials, brand color #7DD3FC. No migration — existing sessions/configs keep working.

I specifically verified the provider-brand.ts change is safe: KNOWN_PROVIDER_LABELS only feeds TRAILING_PROVIDER_TAG (strips trailing (Z.ai) suffixes — no GLM model carries one), and REDUNDANT_BRAND_PREFIXES has no glm entry, so model rows still render as "GLM-5", "GLM-5.2", etc. ✓ Acceptance criterion met on this axis.

Tests pass locally with assertions correctly updated: daemon glm-provider unit 42/42; web useModelSwitcher + provider-brand + AddProviderModal 102/102.

One missed user-facing provider label — P2 (blocks)

packages/daemon/src/lib/agent/query-runner.ts:524

const authError = new Error(
  'No authentication configured. Please set up API key for Anthropic or GLM.'
);

Here "GLM" is listed as a peer of "Anthropic" — i.e. as the provider/company — in a live, user-facing auth error (fires when no provider auth is configured; surfaced via errorManager.handleError as AUTHENTICATION). This is exactly the provider/company sense the rename targets, and it directly violates acceptance criterion #4 ("a grep for user-facing GLM provider labels confirms none remain that refer to the provider/company"). The completeness grep missed it because query-runner.ts was not in the Key files list.

Fix: Anthropic or GLMAnthropic or Z.ai. No test asserts this exact string, so it is a clean one-liner with no test coordination needed.

Considered and intentionally not flagged

glm-provider.ts:193getAuthStatus returns Set GLM_API_KEY or ZHIPU_API_KEY to enable GLM models. The env-var names are correct to keep, and "GLM models" refers to the model family (GLM-5, GLM-5.2…), which is accurate. Not a defect.

Fix the single line in query-runner.ts:524 and this is ready to re-review / hand to QA.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b81dc7dc3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/daemon/src/lib/credential-discovery.ts
Comment thread packages/web/src/lib/provider-brand.ts
Comment thread packages/daemon/src/lib/providers/glm-provider.ts
Comment thread packages/web/src/hooks/useModelSwitcher.ts
Review feedback on #2273 (P2): the no-auth-configured error in
query-runner.ts listed "Anthropic or GLM" — GLM as a peer of Anthropic
is the provider/company, which should read Z.ai. Missed in the first
pass because query-runner.ts was outside the task's Key files list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant