Skip to content

fix: 修正火山方舟(VolcEngine)渠道获取模型列表端点路径 404 - #7203

Merged
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
captainold:fix/volcengine-fetch-models
Sep 9, 2026
Merged

fix: 修正火山方舟(VolcEngine)渠道获取模型列表端点路径 404#7203
Calcium-Ion merged 1 commit into
QuantumNous:mainfrom
captainold:fix/volcengine-fetch-models

Conversation

@captainold

@captainold captainold commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

问题描述

火山方舟(VolcEngine, type=45)渠道点击「获取模型列表」(GET /api/channel/fetch_models/:idfetchChannelUpstreamModelIDs)固定失败,前端报错 获取模型列表失败: status code: 404

根因

fetchChannelUpstreamModelIDs 对 VolcEngine 拼接的模型列表 URL 是 {baseURL}/v1/models

case constant.ChannelTypeVolcEngine:
    ...
    url = fmt.Sprintf("%s/v1/models", baseURL)  // https://ark.cn-beijing.volces.com/v1/models

但火山方舟的 OpenAI 兼容 API 根路径是 /api/v3(同一仓库 relay/channel/volcengine/adaptor.goGetRequestURL 中 chat/embeddings/images 均为 {base}/api/v3/...),上游不存在 /v1/models 端点,因此固定 404。

实测(真实渠道 API Key 直连上游):

URL 结果
https://ark.cn-beijing.volces.com/v1/models 404
https://ark.cn-beijing.volces.com/api/v3/models 200,返回标准 OpenAI 格式 {"data":[{"id":"..."}]}

修复

将 VolcEngine 分支的模型列表 URL 改为 {baseURL}/api/v3/models。上游 /api/v3/models 返回体与 OpenAIModelsResponse/parseOpenAIModelIDs 完全兼容,无需其他改动。

ChannelSpecialBases 的自定义 OpenAIBaseURL 分支保持原样未动,避免引入未经验证的变更。)

验证

本地按此补丁构建镜像后,火山方舟渠道「获取模型列表」成功拉取到账号全部有权限的 doubao/seed 模型;推理链路(/api/v3/chat/completions)不受影响。

影响面

仅影响 VolcEngine 渠道的"获取模型列表/上游模型巡检"功能(该功能 404 失败本身无副作用,不会清空已配置模型)。其它渠道不受影响。

Summary by CodeRabbit

  • Bug Fixes
    • Fixed model-list retrieval for VolcEngine channels by using the correct API endpoint when no custom base URL is configured.
    • Prevented model-list requests from failing with a 404 error under the default configuration.

VolcEngine (type=45) 渠道 fetch models 时拼接 {base}/v1/models,
但火山方舟 OpenAI 兼容 API 根路径是 /api/v3,不存在 /v1/models,
导致「获取模型列表」固定返回 404。改为 {base}/api/v3/models。
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 2d74f121-01fb-4fc5-93b3-58911599d512

📥 Commits

Reviewing files that changed from the base of the PR and between 3a9f41e and 1c0d4dc.

📒 Files selected for processing (1)
  • controller/channel_upstream_update.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The VolcEngine fallback model-list URL now uses /api/v3/models. Channels with a configured OpenAI-compatible base URL continue to use /v1/models.

Changes

VolcEngine model listing

Layer / File(s) Summary
Correct fallback endpoint selection
controller/channel_upstream_update.go
The VolcEngine fallback URL now uses {base}/api/v3/models. The special base URL branch remains {OpenAIBaseURL}/v1/models.

Estimated code review effort: 2 (Simple) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 1c0d4

VolcEngine model discovery now uses the API v3 endpoint instead of the previously failing v1 path, while custom OpenAI-compatible base URLs retain their existing behavior. No merge-blocking risk remains.

Suggested reviewers: seefs001

Poem

A rabbit checked the model door,
And found the old path led no more.
/api/v3 now points the way,
While /v1 keeps its special stay.
The models hop in bright array.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the VolcEngine model-list endpoint path fix and the resulting 404 issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Calcium-Ion

Copy link
Copy Markdown
Member

火山支持获取模型列表了?文档发来看看

@Calcium-Ion

Copy link
Copy Markdown
Member

确实支持了,火山史诗级更新

@Calcium-Ion
Calcium-Ion merged commit 876903a into QuantumNous:main Sep 9, 2026
1 check passed
TanTaolov added a commit to TanTaolov/new-api that referenced this pull request Sep 10, 2026
- 064ed94 feat(billing): 支持按请求固定的表达式计价
- 7cf9b47 fix(web): 保持模型定价内容在单一滚动区域内
- a205741 fix(alibaba): 修正 Wan 模型协议与用量统计
- 12be997 fix(web): 统一服务端错误通知
- d52bdc0 feat(billing): 新增基于时间的定价编辑器与表达式预览
- 876903a fix: 修正火山方舟渠道获取模型列表的端点路径 (QuantumNous#7203)
- c79b74b fix(frontend): 去重 /api/status 请求 (QuantumNous#7189)
- 4fc9d1f fix(options): 重建 options 表主键,防止定价写入重置已有行
- 9bf328d fix: 在 Sora 视频查询中保留 provider 字段
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants