[Bug]: DeepSeek Harness (dsh) fails with INVALID_REQUEST when "CLI default" (default) model is selected
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Start with the trace the issue gives: the placeholder model in internal/httpapi/assistant_models.go, the splitting in assistantModelEngine in internal/httpapi/assistant.go, and the AgentCLIDeepSeek branch of ApplyAgentCLICredential in internal/runtime/agent_cli.go. Pull request #482 is already open against this issue, so check its diff before starting. Done means a dsh request with the CLI default selected no longer sends model "default" to the DeepSeek API.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Component / host
Platform — web / API
Edition
Platform
LoopForge version
main at b751e09 (v0.3.6-29-gb751e09)
What happened?
When using DeepSeek Harness (dsh) in AI Chat and selecting the CLI default model option (model ID "default"), every message fails with "AI 助手生成失败,请稍后重试".
Switching the model selector to an explicit model such as DeepSeek V4.1 Flash (deepseek-flash) works immediately with the exact same API key.
Root cause in code:
internal/httpapi/assistant_models.goreturns a placeholder entry{ID: "default", Name: "CLI default"}for non-CodeBuddy executors (executor=dsh, etc.).internal/httpapi/assistant_engines.go(assistantRequestModel) prefixes it to"dsh:default", andinternal/httpapi/assistant.go(assistantModelEngine) splits outengineModel = "default"without normalizing"default"to""for non-CodeBuddy CLIs.internal/runtime/agent_cli.go(ApplyAgentCLICredential,case AgentCLIDeepSeek) only checksif model != "", so it writes{"id": "agent-default-model", "config": {"provider": "deepseek-official", "model": "default"}}into.dsh/agentflow-model.jsonvia--patch, overridingdsh's own built-in default model.dshsends"model": "default"to the DeepSeek API, which rejects it with400 INVALID_REQUEST, andassistantGenerationFailuremaps it to the generic"AI 助手生成失败,请稍后重试"error.
(Note: Other non-CodeBuddy CLIs such as Codex in assistant_engine_codex.go and other AgentCLI branches in agent_cli.go also pass model = "default" through instead of omitting it.)
Reproduction
- Configure a valid DeepSeek Harness API Key in personal settings (official endpoint, empty Base URL) and ensure
dshis installed. - In AI Chat, switch the CLI selector to DeepSeek Harness and keep the model selector on
CLI default(default). - Send any message (e.g.
hello??). - Observe the failure (
AI 助手生成失败,请稍后重试), while switching toDeepSeek V4.1 Flashsucceeds.
Screenshots
| Scenario | Screenshot |
|---|---|
DeepSeek Harness + CLI default fails |
![]() |
Switching model to DeepSeek V4.1 Flash |
![]() |
DeepSeek V4.1 Flash replies normally |
![]() |
Sanitized diagnostics
assistant CLI session=<redacted>: DeepSeek Harness 运行结束:error; stderr=[llm-deepseek-api-key] model listing from https://api.deepseek.com/models loaded 2 model(s), skipped 0 row(s) | dsh: INVALID_REQUEST: The supported API model names are deepseek-flash, deepseek-v4-pro, but you passed default. (request_id: <redacted>)
Safety checks
- I removed credentials, private endpoints, internal identifiers, and personal data.
- I searched existing issues for duplicates.
中文说明
组件 / 宿主
Platform — web / API
版本形态
Platform
LoopForge 版本
main 提交 b751e09(v0.3.6-29-gb751e09)
现象描述
在 AI 对话中切换为 DeepSeek Harness(dsh) 并保持模型选择器为 CLI default(模型 ID 为 "default")时,发送任意消息都会报错 "AI 助手生成失败,请稍后重试"。
使用同一把 API Key,只要把模型手动切换为 DeepSeek V4.1 Flash(deepseek-flash),即可立即正常回复。
代码根因定位:
internal/httpapi/assistant_models.go为非 CodeBuddy 执行器(如executor=dsh)返回了占位模型{ID: "default", Name: "CLI default"}。internal/httpapi/assistant_engines.go(assistantRequestModel)将其拼成"dsh:default",随后internal/httpapi/assistant.go(assistantModelEngine)拆出engineModel = "default",但没有为非 CodeBuddy CLI 将"default"归一为空字符串""。internal/runtime/agent_cli.go(ApplyAgentCLICredential的AgentCLIDeepSeek分支)只判断了if model != "",直接把{"id": "agent-default-model", "config": {"provider": "deepseek-official", "model": "default"}}写入.dsh/agentflow-model.json并通过--patch注入,覆盖了dsh本身的内置默认模型。dsh把"model": "default"发给 DeepSeek 接口后触发400 INVALID_REQUEST,最终被assistantGenerationFailure兜底成"AI 助手生成失败,请稍后重试"。
(附注:同构的非 CodeBuddy CLI 链路,如 assistant_engine_codex.go 与 agent_cli.go 其他分支,同样存在未将 "default" 归一为空字符串的问题。)
复现步骤
- 在个人配置中填写有效的 DeepSeek Harness API Key(默认官方端点,Base URL 留空)并确保
dsh已安装。 - 在 AI 对话底部将 CLI 切换为 DeepSeek Harness,模型保持
CLI default(default)。 - 发送任意消息(例如
hello??)。 - 观察到报错
AI 助手生成失败,请稍后重试;将模型切换为DeepSeek V4.1 Flash后同一会话即可正常回复。
复现截图
| 场景 | 截图 |
|---|---|
DeepSeek Harness + CLI default 失败 |
![]() |
切换为 DeepSeek V4.1 Flash |
![]() |
DeepSeek V4.1 Flash 正常回复 |
![]() |
脱敏诊断日志
assistant CLI session=<redacted>: DeepSeek Harness 运行结束:error; stderr=[llm-deepseek-api-key] model listing from https://api.deepseek.com/models loaded 2 model(s), skipped 0 row(s) | dsh: INVALID_REQUEST: The supported API model names are deepseek-flash, deepseek-v4-pro, but you passed default. (request_id: <redacted>)
安全检查
- 已移除所有凭据、私有端点、内部标识符与个人数据。
- 已检索现有 Issue 确认无重复提交。
- Vorherrschende Sprache
- Go
- Sterne
- 141
- Forks
- 28
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 113
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Tencent/LoopForge
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: 官方镜像未安装 wecom-cli,企业微信通知报「通知服务未安装 wecom-cli」Evtl. vergeben @newexploreor hat das vor 1 Tag übernommen. Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Tencent/LoopForge#156 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
【架构优化】合并 gitwork/workbranch.go 中 push/pull 重复的默认提交身份注入为 withFallbackIdentityEvtl. vergeben @fx-kurumi hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 40/100
Maintainer antworten meist innerhalb von 1 Tag
-
【架构优化】从 runtime.installNPMCLI 中拆出 npm 参数拼装 npmCLIInstallArgs 与安装结果启用 activateNPMStageEvtl. vergeben @fx-kurumi hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 30/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in Tencent/LoopForge
Ähnliche Issues
-
team:library-maintainers
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
padok-team/burrito#1208 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
bazel-contrib/rules_go#4784 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Уязвимые компоненты в GoOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
POSIdev-community/aictl#40 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
prime-radiant-inc/evener#6306 ·
Maintainer antworten meist innerhalb von 1 Tag


