zai-org / zai-org/feedback

登录账号后连接模式被强制重置为"个人套餐",希望保留用户已选择的 API key 模式

Open
#483 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

使用环境
  • ZCode 桌面端 3.10.2.6414,Windows 11 x64
  • 连接方式:Z.ai 供应商 + API key(GLM Coding Plan 套餐)
  • 账号本身无订阅,登录账号只是为了查看使用统计
现象

Model settings 里把 Z.ai 的 Connection mode 设为 API key 后,只要执行一次账号登录(包括重新登录),连接模式就会被自动改回 Individual Plan。

由于账号没有订阅,这个模式下 Z.ai 供应商显示 Disabled,选不了 GLM 系列模型,必须手动切回 API key。API key、Base URL 和模型列表本身没有丢,只是模式被重置;不重新登录时该设置能一直保持。

复现步骤
  1. Model settings → Z.ai → Connection mode 选 API key,填入 key,正常使用
  2. 登录 Z.ai 账号(或重新登录)
  3. 打开 Model settings:Connection mode 已变回 Individual Plan,供应商显示 Disabled
期望

登录不要覆盖用户已手动选择的连接模式。任一方案都能解决:

  1. 仅当账号确实有有效订阅时才自动切到套餐模式;
  2. 或提供"记住连接模式/默认 API key"设置项;
  3. 至少在登录改写模式时给出提示并支持一键恢复。
技术线索(供定位参考)

OAuth 登录成功回调(Root 层的 OAuth 轮询/回调处理)调用 setProviderFamilyDomain,其中 settingService.update 里 modelProviderFamilyModes 经 $5(t, modes) 无条件把该家族写成 oauth;而 API key 登录路径(ZUt)是保留 apiKey 的。建议登录路径同样尊重已存在的 apiKey 模式。

影响

不阻塞使用(可手动切回),但"登录只为看统计"的 API key 用户每次登录都要重踩一遍。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Root-layer OAuth polling/callback handler and trace its call to setProviderFamilyDomain, then inspect settingService.update and the $5(t, modes) handling mentioned in the issue. Compare this with the ZUt API-key login path. Done means logging in no longer overwrites an existing apiKey connection mode, while valid subscription behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Domain
authentication, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.