From be5e8f29f1a649ca4de8a739424291eb01df4f93 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 6 Nov 2026 16:30:33 +0800 Subject: [PATCH] dsh: its own models are the two it ships, deepseek-flash named DeepSeek-V4.1-Flash (Kylin_Cloud on X) Kylin_Cloud (X, 11-06, v0.1.2606): DeepSeek Harness's direct models in magpie listed deepseek-v4-flash, which dsh doesn't have, and showed deepseek-flash as "DeepSeek-V41-Flash"; dsh's built-ins are only DeepSeek-V4.1-Flash and DeepSeek-V4-Pro. Cause: dshModels is a table copied by hand from dsh 0.1.5 (4091b9dfd), not generated from models.dev and not a label prettifier. dsh's own table is @deepseek-ai/dsh-llm-deepseek's DEFAULT_MODELS; packed from npm: 0.1.0-rc.8, 0.1.2-rc.1 deepseek-v4-flash, deepseek-v4-pro (+ vision-exp) 0.1.5-rc.3 deepseek-flash "DeepSeek-V41-Flash", v4-flash, v4-pro 0.1.6-alpha.2..0.2.0 deepseek-flash "DeepSeek-V41-Flash", deepseek-v4-pro 0.2.1-rc.5, 0.2.2-rc.1 deepseek-flash "DeepSeek-V4.1-Flash", deepseek-v4-pro The installed dsh here (0.2.1-rc.2) has the same two. So "V41" was dsh's own name from 0.1.5 to 0.2.0, kept after dsh renamed it, and deepseek-v4-flash left dsh in 0.1.6 while magpie kept offering it. No other code makes a label from "4.1": V41 is in dsh.go alone. Now dshModels is dsh's two, named as dsh 0.2.1 on names them. The WSL (stopped distro) picker reads the same table. A profile already starting on deepseek-v4-flash: magpie reads it as it is and doesn't rewrite settings.yaml or the patch list; it is no longer offered in the list. Since dsh 0.1.6 dsh itself refuses it (dsh-api-session-controller requireModel: "Select an available model before sending a message.", it checks listModels, i.e. DEFAULT_MODELS), so that start was already broken in dsh before this change; picking either model in magpie or in dsh fixes it. Siblings pinning the old three: internal/gui's TestAgentOwnModelsHidden (red under the full suite with the new table, now dsh's two) and the GUI fixture agent-models-own.test.cjs, which also had made-up labels. Run (mote, rebased on origin/main f47390bf3): - TestDshOwnModelsAreDshs: red on the old table (lists deepseek-v4-flash, "DeepSeek-V41-Flash"), and red again with only the label fixed (still lists deepseek-v4-flash); green with the change. - go test ./internal/agent: ok. - node --test agent-models-own.test.cjs (chromium + webkit, en/zh/de/ja, narrow and wide): 16/16 ok. i18n-keys: "a plugin's words are its own" red, the same three words already filed (#5327, #5332, #5426, #5482), not touched by this change. - go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., GOOS=linux/windows go build: ok. gofmt -l: nothing. - go test -timeout 45m ./... (shared lock): every package ok but gui and provider. gui: TestAgentOwnModelsHidden (fixed above), and TestMainWindowCorners (#3949) and TestPanelHiddenByWailsMarksPageOutOfSight (#5322), both filed; provider: TestRenewLoginsKeepsClaudeReading (#5481, filed). After the fix go test ./internal/gui: only TestMainWindowCorners (#3949) red. Not tried: a real dsh session started on deepseek-v4-flash (the refusal above is read from dsh's source); dsh before 0.1.5 (it had no deepseek-flash; every dsh on npm since 0.1.6 has it); Windows/WSL run. At the pushed head (rebased on b020ae102, which touches gateway, provider and agent's Claude Desktop only): go vet ./internal/agent ./internal/gui, go test ./internal/agent -run Dsh and ./internal/gui -run TestAgentOwnModels: ok. --- internal/agent/dsh.go | 10 +++- internal/agent/dsh_test.go | 50 ++++++++++++++++++++ internal/gui/agent_models_own_test.go | 2 +- internal/gui/tests/agent-models-own.test.cjs | 8 ++-- 4 files changed, 63 insertions(+), 7 deletions(-) diff --git a/internal/agent/dsh.go b/internal/agent/dsh.go index 7436f7485..bc2cad88e 100644 --- a/internal/agent/dsh.go +++ b/internal/agent/dsh.go @@ -75,10 +75,16 @@ const ( // dshModels are the models dsh reaches on its own, as it ships them — under // its own name, not DeepSeek: magpie's DeepSeek provider is a group of that // name too, and two would read as one listed twice (#115). +// +// They are @deepseek-ai/dsh-llm-deepseek's DEFAULT_MODELS, ids and names as +// dsh has them: deepseek-flash and deepseek-v4-pro since 0.1.6, with +// deepseek-flash named "DeepSeek-V4.1-Flash" since 0.2.1 ("DeepSeek-V41- +// Flash" from 0.1.5 to 0.2.0). deepseek-v4-flash was dsh's up to 0.1.5 only; +// a dsh of today answers it "Select an available model" (Kylin_Cloud on X). +// A profile that still names it keeps it: magpie doesn't rewrite it. var dshModels = []Option{ - {Value: "deepseek-flash", Label: "DeepSeek-V41-Flash", Icon: "deepseek-color", Group: "DeepSeek Harness"}, + {Value: "deepseek-flash", Label: "DeepSeek-V4.1-Flash", Icon: "deepseek-color", Group: "DeepSeek Harness"}, {Value: "deepseek-v4-pro", Label: "DeepSeek-V4-Pro", Icon: "deepseek-color", Group: "DeepSeek Harness"}, - {Value: "deepseek-v4-flash", Label: "DeepSeek-V4-Flash", Icon: "deepseek-color", Group: "DeepSeek Harness"}, } func dsh(home string) *Agent { return dshAt(here(home)) } diff --git a/internal/agent/dsh_test.go b/internal/agent/dsh_test.go index 0913cf7be..0ba0e1911 100644 --- a/internal/agent/dsh_test.go +++ b/internal/agent/dsh_test.go @@ -368,3 +368,53 @@ func TestDshToldTheWindowSetForACustomProvider(t *testing.T) { } } } + +// dsh's own models are the ones dsh ships, named as dsh names them +// (@deepseek-ai/dsh-llm-deepseek's DEFAULT_MODELS, 0.2.1 on): +// deepseek-flash is DeepSeek-V4.1-Flash, and deepseek-v4-flash, gone from +// dsh since 0.1.6, isn't offered (Kylin_Cloud on X). A profile that still +// starts on it is read as it is and not rewritten. +func TestDshOwnModelsAreDshs(t *testing.T) { + home := dshTempHome(t) + saveDeepseek(t) + dir := filepath.Join(home, ".dsh") + web := filepath.Join(dir, "profiles", "web", "cordis.patch.yml") + os.MkdirAll(filepath.Dir(web), 0o755) + os.WriteFile(web, []byte("# Your patch layer for this dsh profile.\n[]\n"), 0o644) + settings := filepath.Join(dir, "settings.yaml") + saved := "agent-default-model:\n provider: deepseek-official\n model: deepseek-v4-flash\n" + os.WriteFile(settings, []byte(saved), 0o644) + + want := map[string]string{"deepseek-flash": "DeepSeek-V4.1-Flash", "deepseek-v4-pro": "DeepSeek-V4-Pro"} + own := func(name string, opts []Option) { + t.Helper() + got := map[string]string{} + for _, o := range opts { + if !strings.HasPrefix(o.Value, magpieID+"/") { + got[o.Value] = o.Label + } + } + if len(got) != len(want) { + t.Fatalf("%s: dsh's own models %v, want %v", name, got, want) + } + for v, l := range want { + if got[v] != l { + t.Fatalf("%s: %s is %q, want %q (all: %v)", name, v, got[v], l, got) + } + } + } + + f := dsh(home).Field("model") + own("dsh", f.Options(nil)) + if f.Get() != "deepseek-v4-flash" { + t.Fatalf("the saved start: %q", f.Get()) + } + if b, _ := os.ReadFile(settings); string(b) != saved { + t.Fatalf("the saved start was rewritten:\n%s", b) + } + + // a stopped distro's dsh lists the same + d := distro{Name: "Stopped", Root: t.TempDir(), Home: "/home/me", Gateway: "172.20.0.1"} + k := wslKindOf("dsh") + own("dsh in a stopped distro", asleep(wslAgent(k, d), k, d).Field("model").Options(nil)) +} diff --git a/internal/gui/agent_models_own_test.go b/internal/gui/agent_models_own_test.go index feb5f5f51..39c8c2fd2 100644 --- a/internal/gui/agent_models_own_test.go +++ b/internal/gui/agent_models_own_test.go @@ -64,7 +64,7 @@ func TestAgentOwnModelsHidden(t *testing.T) { } return own, magpie } - all := []string{"deepseek-flash", "deepseek-v4-pro", "deepseek-v4-flash"} + all := []string{"deepseek-flash", "deepseek-v4-pro"} if got := call("GET", ""); !got.Own || got.OwnHidden { t.Fatalf("dsh's list: %+v, want its own models there and shown", got) diff --git a/internal/gui/tests/agent-models-own.test.cjs b/internal/gui/tests/agent-models-own.test.cjs index e60d0e7aa..0daeb9adf 100644 --- a/internal/gui/tests/agent-models-own.test.cjs +++ b/internal/gui/tests/agent-models-own.test.cjs @@ -15,9 +15,9 @@ const { chromium, webkit } = require("playwright"); const assets = path.resolve(__dirname, "../assets"); -const own = ["deepseek-flash", "deepseek-v4-pro", "deepseek-v4-flash"].map((v) => ({ - value: v, label: v.replace("deepseek", "DeepSeek").replace("-v4", "-V4").replace("-flash", "-Flash").replace("-pro", "-Pro"), - icon: "deepseek-color", group: "DeepSeek Harness", direct: "DeepSeek", +// dsh's own as internal/agent's dshModels lists them +const own = [["deepseek-flash", "DeepSeek-V4.1-Flash"], ["deepseek-v4-pro", "DeepSeek-V4-Pro"]].map(([value, label]) => ({ + value, label, icon: "deepseek-color", group: "DeepSeek Harness", direct: "DeepSeek", })); const magpie = ["pro", "flash"].map((m) => ({ value: "magpie/deepseek/" + m, label: "deepseek-" + m, ref: "deepseek/" + m, note: "DeepSeek · via magpie", group: "DeepSeek", icon: "deepseek-color" })); const list = magpie.map((o, i) => ({ id: o.ref, name: o.label, group: "DeepSeek", icon: "deepseek-color", inUse: i === 0 })); @@ -156,7 +156,7 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", assert.equal(await sw.getAttribute("aria-checked"), "false"); await close(); let rows = await picked(); - assert.doesNotMatch(rows, /DeepSeek-V4-Pro|DeepSeek-Flash/, "dsh's own still offered"); + assert.doesNotMatch(rows, /DeepSeek-V4-Pro|DeepSeek-V4\.1-Flash/, "dsh's own still offered"); assert.match(rows, /deepseek-flash/, "magpie's are offered"); // and so in the state read again await page.waitForTimeout(1800);