Skip to content

fix(providers): get_credentials 按 active ASR provider 返回配置状态 #223

Closed

Description

@appergb

背景

后端与设置页已经支持多 ASR provider:Volcengine、SiliconFlow、Zhipu、Groq、OpenAI Whisper。但主界面和首次配置提示仍把 ASR 配置状态硬编码成 Volcengine 三件套。

这个 issue 只跟踪 active provider 配置状态合约,不同于 #219 / #220 的“切换 provider 时凭据输入框读旧 entry”问题。

现象

当用户选择并配置 Whisper-compatible ASR provider(例如 SiliconFlow / Zhipu / Groq / Whisper)后:

  • backend dictation 路径可以接受 asr.api_key。
  • 但 get_credentials() 仍只返回 volcengineConfigured。
  • providerSetup.ts 仍要求 volcengineConfigured && arkConfigured。
  • Overview 仍用 creds.volcengineConfigured 渲染 ASR provider 状态。

结果:非 Volcengine 用户可能已经配置完成,却仍看到 ASR 未配置,或者每次打开 shell 都被提示补 Volcengine 凭据。

代码证据

  • openless-all/app/src/pages/Settings.tsx:343-349:ASR preset 包含 volcengine / siliconflow / zhipu / groq / whisper
  • openless-all/app/src-tauri/src/coordinator.rs:1541-1552:Whisper-compatible provider 校验 asr.api_key
  • openless-all/app/src-tauri/src/coordinator.rs:1569-1571:is_whisper_compatible_provider(...)
  • openless-all/app/src-tauri/src/commands.rs:93-101:get_credentials() 仍只计算 volcengine_configured / ark_configured
  • openless-all/app/src/lib/types.ts:170-173:CredentialsStatus 只有 volcengineConfigured / arkConfigured
  • openless-all/app/src/lib/providerSetup.ts:5-7:配置完成条件硬编码 Volcengine + Ark
  • openless-all/app/src/pages/Overview.tsx:75-87:ASR 卡片读取 creds.volcengineConfigured

建议修复

  • 后端返回 active provider id 与通用状态,例如 asrConfigured / llmConfigured。
  • 如果仍需要兼容旧字段,可以短期保留 volcengineConfigured,但 UI prompt/overview 不应再依赖它判断 active ASR 是否可用。
  • Overview 显示 active provider 的名称和配置状态,而不是固定“火山引擎”。

验收标准

  • active ASR = volcengine 时,仍按 App Key / Access Key / Resource ID 判断配置状态。
  • active ASR = whisper / siliconflow / zhipu / groq 时,按 asr.api_key 判断配置状态。
  • 非 Volcengine ASR 配置完成后,不再弹出“ASR 未配置”的 provider setup prompt。
  • Overview ASR 卡片显示 active provider 的名称和正确状态。
  • 增加 providerSetup 或 IPC 映射的回归用例。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions