liby233 on Discord: in WSL magpie wired dsh in ~/.dsh/config.yaml, and dsh
saw magpie's models only once they were written to its settings.yaml.
With no ~/.dsh/profiles, dshAt fell back to the "pre-0.1.5" config.yaml.
No dsh on npm reads that file. 0.0.1-rc.1 (the first), 0.0.1-rc.5,
0.1.0-rc.8, 0.1.1-rc.1/rc.2, 0.1.2-rc.1, 0.1.3-alpha.2 and 0.2.1-rc.5 all
boot $DSH_HOME/profiles/<name> (grepped from their npm tarballs). A dsh
makes no profile until one is first booted, so a fresh CLI install,
in a distro or not, was wired in a file that nothing reads.
- With no profile, and a dsh that is not from before profiles, magpie
writes profiles/web/cordis.patch.yml as dsh's template, as it does
for Desktop (#2279). dsh's initProfile adds package.json,
pnpm-workspace.yaml and cordis.yml next to it and keeps the file.
- "Before profiles" is judged by the CLI's version where it is known
(locally from its package.json; in a distro the WSL probe now asks
dsh --version). Otherwise config.yaml is used only when it holds an
entry that isn't magpie's. That keeps the legacy path for a genuinely
old dsh.
- The sync carries a magpie model already wired in config.yaml (the
reporter's state) into the profiles and drops magpie's entries from
config.yaml. It does this whether or not dsh has since booted a bare
web profile, and only where no profile has a model or wiring of its
own.
- Disconnecting before dsh ever booted the web profile removes what
magpie made, as for Desktop.
Tests: TestDshCLIWithNoProfileYet and TestDshConfigYamlCarriedToProfiles
(new), plus wslMore's dsh row, now profiles/web. All three are red on the
old dsh.go: "names .../.dsh/config.yaml, not the web profile's patch
list", and the web profile is left as dsh's bare template after the sync.
Tests pin dshVersion, so a dsh on the test machine decides nothing.
Run (go test -timeout 45m, logs teed and grepped):
- gofmt -l internal/agent: clean. go vet ./internal/agent on darwin,
GOOS=linux and GOOS=windows (mote): ok.
- go test -run 'TestDsh|WSL' ./internal/agent: ok on mote (macOS),
magpie-desktop (WSL Ubuntu 24.04, nogui) and xiaomi-gpu (Windows 11).
- Full suite `go test ./...` on mote at this change on origin/main
8680ffa41: 82 packages ok; internal/gui red only in
TestSettingsSaveKeepsWhatItDoesNotSend (#4514) and
TestMainWindowCorners/macOS_26_SDK (#3949), both filed before this and
in code this change doesn't reach.
- Rebased again onto origin/main 70d50254c (it changed internal/agent's
new_session_effort and rename_group tests). At this pushed head: vet
(darwin, linux, windows) ok, and internal/agent, internal/cli ok;
internal/gui has the same two reds and no others.
- Rebased once more onto e484b1e93, which touches internal/provider only.
At that head (the pushed one): go build ./..., go vet internal/agent and
internal/provider, and go test -run 'TestDsh|WSL' ./internal/agent all
ok on mote.
- Real dsh 0.2.1-rc.5 from npm in magpie-desktop, in sandbox HOMEs under
~/dshprobe (never the live ~/.dsh), with this commit's CLI built there
(nogui):
A. Empty HOME, `magpie dsh magpie/relay/glm-4.6`: only
profiles/web/cordis.patch.yml was written, holding llm-pi-ai's
magpie route, agent-default-model and web-search-deepseek.
`dsh --profile web --dump-config` shows llm-pi-ai baseURL
127.0.0.1:3425/v1 and agent-default-model relay/glm-4.6. dsh added
package.json, pnpm-workspace.yaml and cordis.yml and kept magpie's
entries. `magpie dsh default` then left dsh's bare template.
B. origin/main's CLI wired config.yaml (the reporter's state). The
dump showed no magpie route. `dsh --profile web --dump-config`
booted web, then this CLI's `magpie sync` moved the route and model
into profiles/web and emptied config.yaml, and the dump showed them.
C. Wired and never booted: `magpie dsh default` removed profiles/.
Not tried: the reporter's own machine and dsh version, a running
`dsh web` session picking the model up live, the desktop app, and a
pre-npm dsh that reads config.yaml (none could be found).