Skip to content

Commit 22fd7f7

Browse files
committed
fix(session): give DeepSeek models a suitable system prompt
SystemPrompt.provider() selects a prompt by substring-matching model.api.id. DeepSeek ids (e.g. deepseek-v4-pro, deepseek-3.2) match none of the existing branches, so they fell through to PROMPT_DEFAULT (default.txt). That prompt imposes aggressive brevity ("fewer than 4 lines", "One word answers are best") and Task-first file-search delegation, which produce shallow answers and unnecessary subagent hops for DeepSeek V4 coding work. Route DeepSeek ids to PROMPT_KIMI (kimi.txt): a brand-neutral general-agent prompt with no extreme-brevity rules, that treats Task delegation as optional and encourages direct read/glob/grep exploration -- matching the behavior the issue asks for. Match with .toLowerCase().includes("deepseek"), mirroring the existing kimi/trinity branches and the DeepSeek matching already used in provider/transform.ts (some ids are capitalized, e.g. DeepSeek-OCR). No other model's routing changes. Fixes anomalyco#38234
1 parent 42f7094 commit 22fd7f7

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

‎packages/opencode/src/session/system.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export function provider(model: Provider.Model) {
3838
if (model.api.id.includes("claude")) return [PROMPT_ANTHROPIC]
3939
if (model.api.id.toLowerCase().includes("trinity")) return [PROMPT_TRINITY]
4040
if (model.api.id.toLowerCase().includes("kimi")) return [PROMPT_KIMI]
41+
if (model.api.id.toLowerCase().includes("deepseek")) return [PROMPT_KIMI]
4142
return [PROMPT_DEFAULT]
4243
}
4344

‎packages/opencode/test/session/system.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ describe("session.system", () => {
9090
)
9191
})
9292

93+
test("selects the Kimi prompt for DeepSeek model IDs", () => {
94+
const prompt = SystemPrompt.provider({ api: { id: "deepseek-v4-pro" } } as Provider.Model)[0]
95+
expect(prompt).toContain("interactive general AI agent")
96+
expect(prompt).not.toContain("One word answers are best")
97+
})
98+
9399
it.effect("skills output is sorted by name and stable across calls", () =>
94100
Effect.gen(function* () {
95101
const prompt = yield* SystemPrompt.Service

0 commit comments

Comments
 (0)