[BUG] "Fetch available models" fails on every route: Ark /models rejects x-api-key (401), postpaid baseURL yields 404
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript
Hướng nghiên cứu
Start by reading the provider route definitions and the model discovery adapter used by the plugin; the report names the anthropic-messages plan routes and postpaid routes with a /api/v3/compatible base URL. Check how discovery builds its authentication header and URL, then verify the expected /models paths and behavior against the route configuration. Done means discovery succeeds where supported, or the unsupported routes are clearly documented and the UI guidance matches.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
@volcengine/[email protected] on DeepSeek Harness Desktop 0.2.1-rc.2: the plugin loads correctly, the Ark providers appear in Settings → Models, and inference works — but "Fetch available models" (获取可用模型) fails on every route this plugin registers, even with a valid API key.
The reported 401 is misleading: the key is valid. The discovery request uses the wrong auth header for Ark's /models endpoint.
Environment
- macOS (Apple Silicon), DSH Desktop 0.2.1-rc.2 (bundled Node 24.21.0, pnpm 11.28.5)
@volcengine/[email protected], installed into thedesktopprofile- Routes visible in Settings → Models:
Ark Agent Plan,Ark Coding Plan,Ark Coding Plan (BytePlus),Ark (后付费),Ark BytePlus (后付费)
Steps to reproduce
- Install:
dsh plugin --profile desktop add @volcengine/ark-plan-apiand restart DSH. - Settings → Models → Ark Coding Plan → paste a valid Ark Coding Plan API key → Save.
- Click Fetch available models (获取可用模型).
Actual
https://ark.cn-beijing.volces.com/api/coding/v1/models?limit=1000 answered 401; check the API key
Expected
HTTP 200 and a model list (Ark returns 137 models for this key).
Evidence — same key, only the auth header differs
| Request | Result |
|---|---|
GET /api/coding/v1/models?limit=1000 + Authorization: Bearer <key> |
200 (137 models) |
GET /api/coding/v1/models?limit=1000 + x-api-key: <key> |
401 the API key or AK/SK in the request is missing or invalid |
GET /api/coding/v1/models?limit=1000 + both headers |
200 |
POST /api/coding/v1/messages + x-api-key: <key> |
200 (inference OK) |
POST /api/coding/v1/messages + Authorization: Bearer <key> |
200 |
Conclusion: Ark's /messages accepts both auth styles (so the key and the route are fine), but Ark's /models only accepts Authorization: Bearer.
Root cause
DSH's bundled @deepseek-ai/dsh-llm-pi-ai builds the model-discovery request per API style:
- for
api: anthropic-messagesit sendsx-api-keyonly (source comment: "Anthropic Messages usesx-api-key"); - the discovery URL is
${baseURL minus trailing /v1}/v1/models?limit=….
Because this plugin declares api: anthropic-messages for the plan routes, discovery is sent with x-api-key, which Ark's /models rejects with 401.
Second, separate problem: postpaid routes hit a non-existent discovery path
The postpaid routes declare:
baseURL: https://ark.cn-beijing.volces.com/api/v3/compatible
so discovery requests https://ark.cn-beijing.volces.com/api/v3/compatible/models → 404.
Ark's OpenAI-compatible model list lives at https://ark.cn-beijing.volces.com/api/v3/models → 200 (verified with the same key).
If /compatible is required for inference, this route has no correct discovery path at all.
Impact
- Only model discovery is broken. The model picker and inference work, because every provider's model list is already statically declared in the bundle's
cordis.patch.yml. - The UX is still damaging: the UI says "check the API key", so users conclude their key is invalid and cannot diagnose it. Related: #28 (plugin not visible at all on 0.2.0-rc.2 — different symptom; on 0.2.1-rc.2 the providers do appear and inference works).
Suggested fixes
- Plan routes (
anthropic-messages): make model discovery authenticate withAuthorization: Bearer(or send both headers) for these providers. If the adapter does not allow per-provider discovery overrides, document that "Fetch available models" is unsupported on plan routes and that the predeclared model list should be used instead (ideally disable/hide the button for those routes). - Postpaid routes: consider
baseURL: https://ark.cn-beijing.volces.com/api/v3(drop/compatible) so/modelsdiscovery resolves; otherwise document discovery as unsupported for this route. - Docs: state explicitly which routes support model discovery, since the model list is already declared and discovery is optional.
Notes
- Upstream DSH hard-codes the discovery auth header and discards the non-2xx response body (
answered 401; check the API key), so the real Ark error is invisible to the user. A DSH-side improvement would be to surface the body.deepseek-ai/deepseek-harnesshas Issues disabled (Discussions only), so this is not filed there. - No credentials are included in this report; requests were made locally with the reporter's own key.
中文摘要
@volcengine/[email protected] + DSH Desktop 0.2.1-rc.2:插件生效、Ark provider 可见、对话推理正常,但「设置 → 模型 → 获取可用模型」在所有路由上都失败。
- key 本身有效:用
Authorization: Bearer请求https://ark.cn-beijing.volces.com/api/coding/v1/models?limit=1000返回 200(137 个模型);/api/coding/v1/messages也是 200。 - 401 的真正原因:DSH 的
dsh-llm-pi-ai对api: anthropic-messages的 provider 做模型发现时只发x-api-key,而 Ark 的/models只接受Authorization: Bearer(实测x-api-key→ 401;两种头同时发 → 200;但/messages两种头都接受)。 - 后付费路由另有问题:baseURL 是
.../api/v3/compatible,模型发现请求.../api/v3/compatible/models→ 404;Ark 的 OpenAI 兼容模型列表在.../api/v3/models→ 200。
建议:① plan 路由的模型发现改用 Authorization: Bearer(或两种头都发),若不支持则在文档中说明并用内置模型列表;② 后付费路由 baseURL 考虑去掉 /compatible;③ 明确文档说明哪些路由支持"获取可用模型"。
- Ngôn ngữ chính
- jq
- Star
- 147
- Fork
- 18
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của volcengine/ark-cli
-
不支持查询模型单元的数量?Đang mở
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 22/100
volcengine/ark-cli#33 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
volcengine/ark-cli#31 · 1 bình luận ·
-
dsh-plugins/ark-managed-agents: client face crashes DSH Desktop boot on 0.2.0-rc.2 (MCP row is fine)Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
volcengine/ark-cli#29 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
volcengine/ark-cli#28 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
volcengine/ark-cli#27 · 1 reaction ·
Tất cả issue của volcengine/ark-cli
Issue tương tự
-
t/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dotnet/maui#39950 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
processing/p5.sound.js#132 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
drizzle-team/drizzle-orm#6639 ·
Maintainer thường phản hồi trong vòng 4 ngày