Skip to content

新增自定义提供商,如果适配器选用anthropic则看不到模型 #308

Closed

Description

@mobaicloud

Client or integration

Codex App

Area

Dashboard

Summary

新增自定义提供商,如果适配器选用anthropic则看不到模型,选择open-chat可以看到

选择open-chat可以看到模型,但是codex app中就无法对话。

Image Image

Reproduction

参考Summary

Version

2.7.31

Operating system

MacOS 15.7.7

Provider and model

No response

Logs or error output

❯ ocx sync
[opencodex] Provider model discovery for "llm-claude" failed with HTTP 404 [urlClass=provider-models, fallback=configured].

Screenshots and supporting files

Image Image

Redacted configuration

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. Ingwannu commented on Jul 23, 2026

    @Ingwannu
    Owner

    Confirmed on current dev. This is a real fallback bug, not just a dashboard refresh problem.

    A custom provider with adapter: "anthropic", defaultModel: "claude-sonnet-5", and no explicit models[] currently does this when its upstream /v1/models returns 404:

    Provider model discovery ... failed with HTTP 404 [fallback=configured]
    []
    

    The log says fallback=configured, but the implementation only seeds that fallback from provider.models; it ignores the already configured defaultModel for non-Vertex providers. The provider therefore has a valid callable default but publishes zero model rows and disappears from the Models page.

    I am fixing this by:

    1. using defaultModel as the configured fallback when models[] is empty;
    2. keeping a successful live /models response authoritative, so this does not inject unsupported models into healthy catalogs;
    3. adding a regression for an Anthropic-compatible provider whose /v1/models returns 404;
    4. pairing this with Feature: Provider model discovery control and empty provider visibility #310 so a configured provider remains visible even when it genuinely has no discovered/static models.

    I will update this issue with the merged commit and validation results, then close it once the fix is on dev.

  2. Ingwannu commented on Jul 23, 2026

    @Ingwannu
    Owner

    已修复并合并到 dev:#313(merge commit d56d2948)。

    修复内容:

    • 对未配置静态 models[] 的 Anthropic 自定义提供商,只有在实时模型发现失败时才回退到 defaultModel;
    • 成功返回的实时目录仍然是权威结果,不会被回退模型覆盖;
    • liveModels: false 且静态模型为空时仍保持零模型,不会意外暴露模型;
    • Provider 设置与 Models 页面也能正确显示并控制空提供商。

    验证:完整测试 3,614 passed / 0 failed,typecheck、privacy scan、GUI lint/build 以及 Linux/macOS/Windows CI 全部通过。这个问题可以关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions