Repository navigation
fix: skip optional Anthropic model discovery on 404 and 405 - #3
Merged
timmy1688 merged 1 commit intoNov 5, 2026
Merged
Conversation
Collaborator
|
感谢,今晚回去看看,后续该项目可能会移动至dromara组织,欢迎一起共建,成为核心贡献者 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
DeepSeek 等 Anthropic 兼容端点可能提供正常的
/v1/messages,但没有/v1/models。原检测会将模型列表的 404 算作失败,导致 Messages 和 Messages 流式都通过时,顶层success仍为 false。现在只对 Anthropic 渠道的 models 检查实际返回 HTTP 404 / 405 增加可选检查语义:
status=skipped、skip_reason=models_endpoint_unavailable,保留原始 HTTP 状态和耗时,error留空。参考 sub2api 的处理边界:连接测试调用生成接口;模型目录同步在 404 / 405 且存在配置模型时,回退配置模型做能力补全。本 PR 保留 Five API 的逐接口诊断方式,以显式 skipped 表示缺少可选发现接口。
Validation
python -m pytest -q tests/test_channel_checks.py:35 passed,覆盖 404 / 405 跳过、生成失败、鉴权/限流/服务端错误、超时、无效 JSON、HTTP 200 内嵌错误、OpenAI 不跳过,以及仅跳过项不能判定成功。npm run build:类型检查和生产构建通过。python -X utf8 scripts/release_check.py、git diff --check:通过。验证使用模拟上游,不调用真实厂商;未运行 MySQL / Redis 集成测试。
Upgrade
无需数据库迁移、配置调整或新增依赖。渠道检测接口新增
skipped状态和可选skip_reason字段;顶层success按非跳过项汇总。设计文档和更新记录已同步。