From efa6fe65b43d2cff3b4bcd2d700add5e7cd74978 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 2 Oct 2026 04:49:18 +0800 Subject: [PATCH] =?UTF-8?q?dsh:=20a=20model=20through=20magpie=20that=20li?= =?UTF-8?q?sts=20no=20thinking=20levels=20offers=20none,=20rather=20than?= =?UTF-8?q?=20dsh's=20own=20four=20it=20then=20turned=20away=20(Dazzle-sys?= =?UTF-8?q?,=20#473:=20on=20LongCat-2.5-Preview,=20every=20step=20of=20Dee?= =?UTF-8?q?pSeek=20Harness's=20thinking=20slider=20failed=20with=20"takes?= =?UTF-8?q?=20an=20effort=20of=20=20for=20this=20model,=20not=20\"low\"")?= =?UTF-8?q?=20=E2=80=94=20the=20Agents=20page's=20effort=20field=20fell=20?= =?UTF-8?q?back=20to=20dsh's=20own=20off,=20low,=20high=20and=20max=20when?= =?UTF-8?q?=20a=20gateway=20model's=20catalog=20entry=20listed=20no=20leve?= =?UTF-8?q?ls,=20while=20setting=20one=20checked=20the=20model's=20own=20l?= =?UTF-8?q?evels,=20which=20were=20none,=20so=20the=20slider=20offered=20f?= =?UTF-8?q?our=20stops=20and=20each=20was=20refused=20with=20an=20empty=20?= =?UTF-8?q?list.=20Such=20a=20model=20has=20no=20levels=20in=20dsh=20eithe?= =?UTF-8?q?r=20(its=20route=20gives=20it=20no=20reasoningEfforts),=20so=20?= =?UTF-8?q?none=20is=20offered=20now=20and=20the=20Agents=20page=20shows?= =?UTF-8?q?=20no=20thinking=20control=20for=20it,=20as=20it=20does=20for?= =?UTF-8?q?=20Claude=20Code=20on=20Haiku=204.5;=20an=20effort=20asked=20fo?= =?UTF-8?q?r=20anyway=20(magpie=20dsh=20effort=20low)=20says=20the=20model?= =?UTF-8?q?=20has=20no=20thinking=20levels=20in=20magpie,=20never=20an=20e?= =?UTF-8?q?mpty=20list.=20dsh's=20own=20models=20and=20gateway=20models=20?= =?UTF-8?q?with=20levels=20are=20unchanged;=20no=20other=20agent's=20effor?= =?UTF-8?q?t=20field=20offers=20levels=20its=20setter=20refuses.=20TestDsh?= =?UTF-8?q?EffortModelWithoutLevels=20fails=20without=20the=20change.=20go?= =?UTF-8?q?=20vet,=20go=20build=20-tags=20nogui=20(darwin,=20GOOS=3Dlinux)?= =?UTF-8?q?,=20GOOS=3Dwindows=20go=20build,=20go=20test=20-tags=20nogui=20?= =?UTF-8?q?./...=20pass;=20panel-effort,=20claude-effort,=20click-scroll,?= =?UTF-8?q?=20old-webkit=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/agent/dsh.go | 10 +++++--- internal/agent/effort_test.go | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/internal/agent/dsh.go b/internal/agent/dsh.go index 9173e158..6e82bbe3 100644 --- a/internal/agent/dsh.go +++ b/internal/agent/dsh.go @@ -114,10 +114,11 @@ func dsh(home string) *Agent { Get: func() string { return dshGetEffort(dir) }, Set: func(v string) error { return dshSetEffort(dir, v) }, Options: func(cur map[string]string) []Option { + // a model through magpie that lists no levels has none in + // dsh (its route gives it no reasoningEfforts), so none is + // offered: dsh's own four were, and each was turned away if ref, ok := strings.CutPrefix(cur["model"], magpieID+"/"); ok && len(dshProfiles(dir)) > 0 { - if levels := dshLevels(ref); len(levels) > 0 { - return static(levels...) - } + return static(dshLevels(ref)...) } return static(dshEfforts...) }, @@ -1125,6 +1126,9 @@ func dshSetEffort(dir, v string) error { if viaGateway { levels = dshLevels(ref) } + if v != "" && len(levels) == 0 { + return fmt.Errorf("DeepSeek Harness has no thinking levels for %s: magpie knows of none the model takes", ref) + } if v != "" && !contains(levels, v) { return fmt.Errorf("DeepSeek Harness takes an effort of %s for this model, not %q", strings.Join(levels, ", "), v) } diff --git a/internal/agent/effort_test.go b/internal/agent/effort_test.go index 7674d0ea..a0270b90 100644 --- a/internal/agent/effort_test.go +++ b/internal/agent/effort_test.go @@ -151,6 +151,49 @@ func TestCommandCodeEffort(t *testing.T) { } } +// #473: a model through magpie listing no levels (LongCat-2.5-Preview) had +// dsh's own off, low, high and max offered on the Agents page, and each was +// turned away with "takes an effort of for this model". It has none in dsh: +// none is offered, and one asked for says so. +func TestDshEffortModelWithoutLevels(t *testing.T) { + home := effortHome(t) + if err := catalog.SaveLive("deepseek", "https://api.deepseek.com/v1", []catalog.Model{ + {ID: "pro", Name: "pro", Efforts: []string{"none", "low", "high", "max"}}, + {ID: "plain", Name: "plain"}, + }); err != nil { + t.Fatal(err) + } + patch := filepath.Join(home, ".dsh", "profiles", "web", "cordis.patch.yml") + writeFile(t, patch, "[]\n") + a := dsh(home) + f := a.Field("effort") + if err := a.Field("model").Set("magpie/deepseek/plain"); err != nil { + t.Fatal(err) + } + cur := map[string]string{"model": "magpie/deepseek/plain"} + if got := f.Options(cur); len(got) != 0 { + t.Fatalf("offered %+v for a model with no levels", got) + } + err := f.Set("low") + if err == nil || strings.Contains(err.Error(), "of for") || !strings.Contains(err.Error(), "deepseek/plain") { + t.Fatalf("low: %v", err) + } + if err := f.Set(""); err != nil || f.Get() != "" { + t.Fatalf("default: %v %q", err, f.Get()) + } + // every level offered for any model is one dsh takes + for _, m := range []string{"magpie/deepseek/pro", "magpie/deepseek/plain", "deepseek-v4-pro"} { + if err := a.Field("model").Set(m); err != nil { + t.Fatal(err) + } + for _, o := range f.Options(map[string]string{"model": m}) { + if err := f.Set(o.Value); err != nil { + t.Fatalf("%s offered %q and turned it away: %v", m, o.Value, err) + } + } + } +} + func TestDshEffort(t *testing.T) { home := effortHome(t) if err := catalog.SaveLive("deepseek", "https://api.deepseek.com/v1", []catalog.Model{