agent: Cline's advice on Windows names both the desktop app and the CLI/VS Code extension (#898 follow-up) — since #898 Running answers yes on Windows, where it can't ask, so Cline's first branch (its desktop app) always won there and one using the VS Code extension was never told to reload its window. On Windows the advice now says both. TestDshClineAdviceOnWindows (run by the Windows CI job) checks it; go vet (darwin, GOOS=windows) and go test ./internal/agent under a temp HOME pass.

This commit is contained in:
yetone committed 2026-10-05 20:02:08 +08:00
1 parent bf9bd9c935
commit 3fad3d21eb
2 files changed
+18

No files matched your search

+5
View File
@@ -42,6 +42,7 @@ import (
"encoding/json"
"os"
"path/filepath"
"runtime"
"strings"
"time"
@@ -175,6 +176,10 @@ func cline(home string) *Agent {
return syncJSON(models, "providers."+clineSlot, func() any { return clineModels(get(slot + ".settings.model")) })
},
Notice: func() string {
if runtime.GOOS == "windows" {
// Running can't tell the desktop app from the CLI there
return "Cline reads its provider as a session starts — open sessions keep the model they have; new ones use this. Reload VS Code's window for its extension; Cline's desktop app keeps the model picked in its own composer — pick magpie's there."
}
if Running(`Cline\.app/`, `(^|/)cline-app( |$)`) {
return "Cline's desktop app keeps the model and effort picked in its own composer — pick magpie's there; this sets Cline's CLI and VS Code extension."
}
+13
View File
@@ -70,3 +70,16 @@ func TestDshAndCodexAdviceOnWindows(t *testing.T) {
t.Fatalf("Codex says nothing about restarting: %q", n)
}
}
// Cline's desktop app and its CLI can't be told apart on Windows, where
// Running says yes to both: its advice names both, not the desktop app's
// alone, so one who uses the VS Code extension is still told to reload it.
func TestDshClineAdviceOnWindows(t *testing.T) {
if runtime.GOOS != "windows" {
t.Skip("the Windows answer is only given there")
}
n := cline(t.TempDir()).Notice()
if !strings.Contains(n, "Reload VS Code") || !strings.Contains(n, "desktop app") {
t.Fatalf("Cline's advice on Windows leaves one out: %q", n)
}
}