Skip to content

Custom model IDs are not restored when re-entering ModelStudio auth wizard #5636

Description

@pomelo-nwu

What happened?

When setting up Alibaba ModelStudio via the /auth wizard, at Step 3/3 — Model IDs, only the built-in default model IDs are displayed. If the user manually adds custom model IDs and completes the setup, those custom IDs are saved to settings.json correctly. However, when the user re-enters the auth wizard for the same provider later, the previously saved custom model IDs are not restored — only the built-in defaults are shown again.

More critically, if the user proceeds through the wizard again and submits, the previously saved custom model IDs are overwritten with the defaults, causing data loss.

What did you expect to happen?

When re-entering the auth wizard for a ModelStudio provider that already has saved model IDs (including custom ones), the Model IDs step should pre-fill with the currently saved model IDs from settings.json, not reset to the built-in defaults. This way the user can review, add, or remove models without losing their previously configured custom entries.

Client information

Client Information

Run qwen to enter the interactive CLI, then run the /about command.

$ qwen /about
# paste output here

Login information

Alibaba ModelStudio (Standard API Key / Coding Plan / Token Plan — any of the three presets with modelsEditable: true).

Anything else we need to know?

This issue specifically affects the CLI TUI auth flow. The desktop app already handles this correctly — it reads existing model IDs from settings.json via the ACP provider list endpoint and pre-fills them when re-entering the provider setup form.

The root cause is that the auth wizard's start() method always initializes the model IDs state with getDefaultModelIds(), which only returns the built-in models from the provider preset — without checking whether the user already has saved model IDs in settings.json.

中文

发生了什么?

通过 /auth 向导设置 Alibaba ModelStudio 时,在 Step 3/3 — Model IDs 步骤中,只显示内置的默认 model ID。如果用户手动添加了自定义 model ID 并完成设置,这些自定义 ID 会正确保存到 settings.json。但是,当用户之后重新进入同一个 provider 的 auth 向导时,之前保存的自定义 model ID 不会恢复,只显示内置默认值。

更严重的是,如果用户再次走完向导并提交,之前保存的自定义 model ID 会被默认值覆盖,导致数据丢失。

期望行为?

当重新进入一个已经有已保存 model ID(包括自定义的)的 ModelStudio provider 的 auth 向导时,Model IDs 步骤应该预填当前 settings.json 中保存的 model ID,而不是重置为内置默认值。这样用户可以在不丢失之前配置的自定义条目的情况下查看、添加或删除模型。

登录信息

Alibaba ModelStudio(Standard API Key / Coding Plan / Token Plan — 三个预设中任意一个,只要 modelsEditable: true)。

其他信息

此问题仅影响 CLI TUI 的 auth 流程。桌面应用已正确处理此场景——它通过 ACP provider list 端点从 settings.json 读取已有的 model ID,并在重新进入 provider 设置表单时预填。

根本原因是 auth 向导的 start() 方法总是用 getDefaultModelIds() 初始化 model IDs 状态,该方法只返回 provider 预设中的内置模型——而没有检查用户是否已经在 settings.json 中保存了自定义 model ID。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions