DeepSeek-Reasonix icon indicating copy to clipboard operation
DeepSeek-Reasonix copied to clipboard

[Bug]: 无法加载第三方自定义模型,只能用官方的模型

Open csy87704403 opened this issue 5 months ago • 1 comments

Version line

v2 — Go rewrite (1.x), main-v2 (active development)

Exact version

最新版本

What happened?

Image无法加载第三方自定义模型,只能用官方的模型

Steps to reproduce

Image无法加载第三方自定义模型,只能用官方的模型

OS / platform

window11

Relevant logs or output


csy87704403 avatar Jun 16 '26 12:06 csy87704403

Bug Report: Multi-model providers missing context_window / price are silently hidden from chat model dropdown

Environment

  • Reasonix desktop app (version unknown)
  • Config file: reasonix.toml / global config

Description

Multi-model providers (defined with models = [...] format in [[providers]]) that are correctly listed in [desktop] provider_access and enabled via Settings > Model > Access do not appear in the chat window's model dropdown if they are missing context_window and/or price fields. No error message or visual hint is shown to the user.

Steps to Reproduce

  1. Define a multi-model provider in config (e.g. a local API gateway):
[[providers]]
name        = "Local"
kind        = "openai"
base_url    = "http://127.0.0.1:23333/v1"
models      = ["model-a", "model-b"]
default     = "model-a"
api_key_env = "LOCAL_API_KEY"
  1. Add it to [desktop] provider_access.
  2. Restart the desktop app, enable it in Settings > Model > Access.
  3. Open the chat model dropdown — the provider's models are not listed.
  4. Add context_window and price fields:
context_window = 200000
price       = { input = 0, output = 0, currency = "¥" }
  1. Restart — models now appear in the dropdown.

Expected Behavior

Any of the following would be better than silent omission:

Option A: Provide sensible defaults

When context_window and/or price are missing for a multi-model provider, apply built-in defaults instead of hiding the models:

# implicit defaults:
context_window = 4096
price = { input = 0, output = 0, currency = "¥" }

Option B: Strict validation with clear error

If these fields are truly required, fail loudly at config parse time — show a clear error message pointing to which provider and which field is missing, so the user knows exactly what to fix.

Option C: Relax the filter

Don't make the chat dropdown depend on context_window / price at all. Only validate these fields when they're actually needed (e.g. when making an API call or displaying cost). The provider is already correctly configured with base_url, api_key_env, and models — the dropdown should show it.

Notes

  • Single-model providers (model = "xxx" format) are not affected.
  • No console errors, logs, or UI hints are produced — models are silently filtered out.
  • provider_access and the Access settings toggle are correctly respected; the filtering happens at a different layer (likely in the model-selector population logic).

franvz9 avatar Jun 16 '26 15:06 franvz9

之前配置的模型丢失。重新配置三方模型不能正常使用

Image @GTC2080 现在什么模型都用不起了

July-X avatar Jun 17 '26 05:06 July-X

已确认这个问题真实存在,并已在 PR #4685 修复。

定位结果:

  • 缺少 context_window / price 的自定义多模型 provider,在 key 正常解析时不应被下拉框隐藏;这次补了对应回归测试。
  • 更关键的触发路径是本地/私有 OpenAI-compatible 网关不需要 API key,但 Settings 保存自定义 provider 时会自动写入一个生成的 api_key_env。如果这个 env 没有实际 key,后端会把 provider 当成未配置,然后聊天模型下拉框会静默过滤掉所有模型。
  • /models 获取模型列表和实际 chat 请求也会带上空的 Authorization: Bearer ,对 no-auth 本地网关不够稳。

修复内容:

  • no-auth 自定义 provider 可以正常出现在桌面模型下拉框。
  • loopback/private endpoint 即使保留了旧的 api_key_env 但没有 key,也不会被静默隐藏。
  • 官方托管端点仍然保留 key 要求,避免把明显不可用的官方模型放出来。
  • Settings 只有在用户实际填写 key 或显式 env 名时才保存 api_key_env。
  • 空 key 时不再发送空 Authorization 头。

已补充 Go 和前端回归测试,并完成 root/desktop Go 测试、前端 test/build、vet、gofmt 和 diff 检查。

GTC2080 avatar Jun 17 '26 05:06 GTC2080