ac4af582301a4e8a29245dbba767eba31334ddf9
68
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
61394481c7 |
agent: DeepSeek Harness Desktop is found on Linux (AUR, .deb, AppImage entry)
xianhongtao (magpie 0.1.3232, Arch Linux) has DeepSeek Harness Desktop
from the AUR (deepseek-harness-desktop 0.2.2rc.1-1) and no dsh CLI.
magpie knew the app on macOS and Windows only, so it said "DeepSeek
Harness CLI not found ~/.dsh/profiles/web/cordis.patch.yml".
HasApp for dsh now also finds the Linux app (linuxApp, desktopapp_xdg.go):
- a folder holding the Electron executable deepseek-harness with
resources/app.asar beside it: /usr/lib/deepseek-harness-desktop (the
AUR's) or /opt/DeepSeek Harness (electron-builder's .deb/.rpm);
- or the app's desktop entry in the XDG data dirs (XDG_DATA_HOME first,
then XDG_DATA_DIRS, the first file of a name wins, Hidden=true hides
it): Name=DeepSeek Harness, Type Application, MimeType holding
x-scheme-handler/dsh, and its Exec program there (on PATH, or an
absolute executable file: an AppImage anywhere). Scans of a folder are
kept by its mtime, trusted only when read over a second after it
changed and for a minute at most.
Linux only; macOS and Windows keep their own checks.
Siblings: everything reading HasApp for dsh follows: the profile a fresh
~/.dsh gets (profiles/desktop), the desktop lead and notices, cliHeld and
CLIMissing (so the GUI's and the CLI's "CLI not found" go away). The
"running" check for noticeDsh2 also knows deepseek-harness, the app's
Linux executable. With both profiles present (the reporter's case) Path
stays profiles/web as on macOS; the desktop lead picks the model shown.
Run (mote, through mote-run):
- go test -count=1 -race -run 'TestDshLinux|TestDshDesktop|TestCodexLinux|Lody' ./internal/agent/: ok
- go test -count=1 ./internal/agent/ ./internal/gui/ ./internal/cli/: ok
- gofmt -l clean; go vet ./...; GOOS=linux go vet -tags nogui ./...;
GOOS=windows go vet ./...; GOOS=linux/windows go build: ok
Run (wsl-run, magpie-desktop, Ubuntu 24.04): the TestDshLinux tests
-count=3: ok. The first WSL run caught a stale scan of a folder made
again within the same mtime tick; the 1s rule fixes it.
Broken by hand (mote), each red, then restored:
- installed() without onLinux: all three new tests red ("the AUR's app:
app false, CLI missing true", "the AUR's entry, its program on PATH,
not found", the profile = profiles/web, want profiles/desktop);
- no scheme check: "another app's entry taken for DeepSeek Harness's";
- no Hidden check: "an entry the user hid still counts".
Not tried: a real AUR, .deb or AppImage install of DeepSeek Harness
Desktop (the fixtures are the AUR PKGBUILD's entry and layout as the
reporter gave them, and AppImageLauncher's entry shape); the GUI suite
(no GUI file changed). The full suite runs after the push.
Reported-by: xianhongtao (Discord)
|
||
|
|
49f207c784 |
agents: DS Bot, wired in the DSH home it runs on
DS Bot (github.com/Fei2411/DS-Bot, Apache-2.0, dsbot.app) is a DSH plugin and an Electron app built on it. The app ships its own DSH (0.2.2-rc.1 in 0.3.0) and runs it with DSH_HOME at a data folder of its own, booting the profile ds-bot, and never reads ~/.dsh: magpie's dsh row didn't reach it. It is a row of its own now, ds-bot (dsbot.go), wired by dsh's code on its folder (dshOn, split out of dshAt): magpie's routes and start in profiles/ds-bot/cordis.patch.yml, the key in that folder's .env and .credentials.yaml. The folder is $DS_BOT_HOME, else locations.json's dataDir in the app's userData ($DS_BOT_SHELL_DATA, else <config>/DS Bot, or the legacy DeepSeek Bot), else ~/.ds-bot, as the app's first-run.mjs and legacy.mjs choose it. A locations.json that can't be read or names no folder is unknown: nothing is read or written. The routes there list the models shown for DS Bot on the Agents page (dshListFor), and the serving round fills a profile the app makes there as it does ~/.dsh's (dshHomesRounds). Found by DS Bot.app (io.github.fei2411.dsbot) or its Windows per-user install (guid from its electron-builder.yml). Three notices, translated into zh, zh-TW, ja and de. DS_BOT_HOME and DS_BOT_SHELL_DATA are in agentenv's sandbox list. Run: - go test ./internal/agent/ ./internal/agentenv/ ./internal/gui/ ./internal/cli/ ./internal/appdir/ on mote: ok but internal/gui TestMainWindowCorners/macOS_26_SDK, red on mote's macOS 27 whatever the change (#3949). - go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... on mote: ok. gofmt -l: clean. - node --test i18n-keys, i18n-en-no-cjk, agent-notice-lang (chromium), and agent-notice-lang in webkit: all pass but i18n-keys "a plugin's words are its own", red on main for three plugin words (#5332, #5426, #5482). - Real DS Bot 0.3.0 (DS-Bot-0.3.0-mac-arm64.zip) on mote, all in a sandbox HOME with DS_BOT_HOME, DS_BOT_SHELL_DATA and DS_BOT_WORKSPACE under it: a magpie built from this tree (nogui), MAGPIE_ADDR 127.0.0.1:3572, a fake OpenAI upstream on 3571 added as a provider. `magpie ds-bot magpie/fake/m1` before the app was ever opened wrote the profile; the app's first start kept it (agent-default-model still magpie's) and added its own files beside it. Its Chief Bot offered "Magpie: m1 · fake, m2 · fake"; picking m1 and sending "ping" over CDP went through magpie to the fake (POST /v1/chat/completions model m1, stream) and "pong from fake" showed. `magpie ds-bot default` then took every magpie entry out and the .env with it. Only my own pids (app, serve, fake) were stopped. Broken by hand, each red, then put back: - dsbot's desktopApps entry out: TestDsBotWired (not detected). - dshListFor always "dsh": TestDsBotOwnModels. - dshHomesRounds without DS Bot's home: TestDsBotProfileMadeWhileServing. - a bad locations.json taken for ~/.ds-bot: TestDsBotDataFolder. On the old code the tests don't build (no ds-bot row at all). Not tried: the Windows app (install path and registry guid read from its electron-builder.yml, not from an installed copy); Linux (its AppImage and deb aren't looked for; the data folder its first start makes finds it); a real vendor behind magpie; a default Bot model set in DS Bot (the notice says it wins, per its models.js). Not done: usage gives DS Bot no User-Agent of its own (its DSH's requests likely count as dsh's), and the Sessions page doesn't read its data folder's sessions. Reported-by: rnhung |
||
|
|
be5e8f29f1 |
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 ( |
||
|
|
844c355059 |
dsh: the model shown is the start of the profile in use, and the round's log says what it wrote (#5222)
#5222: with DeepSeek Harness Desktop and four profiles, the desktop
profile started on hy4free while web, headless and open-design started
on deepseek-v4.1-flash, and magpie's log said "wrote dsh's route again"
every half minute or so. Read against dsh 0.2.1-rc.2's own source and
reproduced in a sandbox HOME with dsh's real save (saveSelection through
ConfigEditor.edit and its yaml 2.9.1 library):
- dsh saves a model picked in it into the profile in use alone. The
profiles drifting apart is dsh's design, and each start is the user's
own: magpie copies it nowhere.
- magpie never wrote over that pick. After dsh's save the next round
wrote once, moving magpie's web search entry to follow the new start,
and then wrote nothing. The log called that "wrote dsh's route again",
which read as magpie rewriting agent-default-model.
- magpie read the start from the web profile alone, so with the desktop
app in use the Agents page showed a model its sessions don't start on,
and picking what it showed changed nothing there.
- A session dsh already has keeps the model of its last request until a
model is picked in it (selectionFor in dsh-api-session-controller), as
noticeDsh1 says. The reporter's 429s were OpenCode Zen Free's own free
limit, reached by a session still on it; the gateway didn't change the
model.
Now the model and effort fields read the desktop profile when DeepSeek
Harness Desktop is installed (dshLead), else web's as before, and effort
levels are checked against that model. The round logs "dsh's web search
in <file> follows the model it starts on now" when that entry is all it
moved; "wrote dsh's route again" is kept for the route itself.
Run (mote, on origin/main 7dd2434d3; rebased onto
|
||
|
|
35c47f762f |
agent: the window's drift poll parses dsh's YAML once per change, not per field and per look
The window asks /api/drift every 15s. On the owner's live magpie a heap profile showed Drift and Values allocating ~3.3 GB in 37 minutes, most of it DeepSeek Harness: settings.yaml (80 KB) parsed again for each field GetYAML read (465 MB of it), and each profile entry's YAML parsed again on each of dshCheck's looks (dshHomeHas, dshOver, dshConfigIndex, dshRoutesIn, dshConfig). - edit.loadYAML memoizes the parsed root through filememo, keyed by the file's stat, and shares it with GetYAML, GetYAMLMap, GetYAMLList and GetYAMLText, which only read it. Writes go through their own parse as before. BlockList skips the decode for a text that starts as a block list (blockSequence), which every dsh patch list does. - dshNodeShared parses an entry's text once and shares the node with the read-only lookers (dshConfig, dshConfigIndex, dshRoutesIn, dshOver's patch side). The writers (dshOver's base, the route and start writes) keep dshNode's own copy. 512 entries kept at most. Run on mote (macOS 27.2): - Probe on copies of the owner's real ~/.dsh (settings.yaml, config.yaml, the desktop and web profiles; probe not committed, copies deleted): a.Values() + a.Drift() per poll, 20 polls: 16381 KB / 223788 allocs per poll with the edit change alone -> 4355 KB / 2588 allocs. - TestGetYAMLParsesTheFileOnce (new): a look at a 3000-entry file allocates under a tenth of its size; sees SetYAML, another process's write, a removed file and a list-topped file. TestBlockSequenceAgreesWithADecode (new): ~24 texts against yaml's own decode. - TestDshLookParsesAnEntryOnce (new): with dshConfig and dshConfigIndex put back on dshNode by hand: "27388 allocations, want a few", red. Restored: ok. It also checks a writer's change never shows in a look. - go test ./internal/agent ./internal/edit: ok (164.2s, 5.9s). go vet both: ok. gofmt -l: clean. Not tried: the full suite (only internal/agent and internal/edit call these); a live window poll after the release. |
||
|
|
3defaf6622 |
dsh: a new desktop profile gets magpie's routes when the start is the user's (zyh6036 on X)
DeepSeek Harness Desktop 0.2.1-rc.5's picker listed only "DeepSeek 账号". The app reads $DSH_HOME/profiles/desktop (apps/desktop/src/paths.ts) and makes it from an empty template on its first start. dshFillNewProfiles gave such a profile magpie's routes only when a wired profile started on one of magpie's models; with the web profile wired but started on one of dsh's own, it returned early and the desktop profile stayed bare. Now a bare profile gets the routes alone in that case (no start written, the user's pick stays theirs), and nothing is filled when no profile is wired. Run: - go test ./internal/agent -run TestDshFillNewProfiles on mote at |
||
|
|
cdfdb62c69 |
agent: a model field's list is joined with the catalog once while neither changed
Each agent's model field returned append(its own models,
viaMagpieShared(...)...), a copy of the whole catalog's options for
each field of each agent on every poll: Picks was 94.7 MB of 496 MB
over forty polls of the Agents page with real accounts. withVia keeps
the joined list per agent and prefix while the own models read the same
(sameOption, field by field) and the catalog's list is the very one
kept (same array), and joins it again when either changed. The list is
read only and clipped, as viaMagpieShared's is; every caller of a
field's Options reads it, Picks clones it before it drops anything.
The 52 `return append(own, viaMagpieShared(...)...)` sites call it.
omp's and Reasonix's planner edit the joined list after the append, and
Grok's writes Same into its copy, so they keep their own copies.
TestWithViaKeepsTheJoinedList: the same own models give the same array,
own models changed in a value or only an icon are joined anew, a
provider saved since is listed, and nothing joined is the catalog's own
list. TestSameOptionReadsEveryField sets each field of Option alone and
fails when sameOption doesn't see it. Broken by hand: never answering
from the kept list ("the same own models joined the catalog again"),
and FastFor left out of sameOption ("sameOption doesn't read
Option.FastFor").
Run on mote: both tests alone 3 of 3; internal/agent, internal/tui and
internal/cli ok; internal/gui red only on TestSettingsSaveKeepsWhatItDoesNotSend
(#4514) and TestMainWindowCorners (#3949); gofmt, vet and GOOS=windows
and linux vet clean. Real accounts in a sandbox HOME, forty polls:
Picks 94.7 MB -> 51.2 MB, state 190.8 MB -> 154.0 MB, state and drift
replies byte for byte the same as before. Footprint peak 136 MB.
|
||
|
|
1cf66e4b17 |
agent: a tool asked on Responses says strict: false, its optional parameters stay optional (#3055)
What changed: OpenAI's Responses API takes a function tool whose strict is left out as a strict-mode one and normalizes its schema, where every property is required, so a tool's optional parameters came back filled (#3055, ArakawaHenri). pi-ai (dsh's llm-pi-ai, Pi and its kin) says strict: false on an ordinary tool only when the model's compat says supportsStrictMode, which it takes as false where the compat is left out. magpie now says it: every model of a dsh route whose api stands as openai-responses carries compat.supportsStrictMode, by the api the route has now (the one the user picked in dsh's Models page kept), not by its name, beside the keys they set there (dshKeepCompat); and piModelJSON says it for a model best served on Responses, which Pi's and StepCode's models.json carry (Pencil's entries stay on Chat throughout). omp's models.yml is left alone: omp turns a models.yml away over a field its schema doesn't name (16.3.5 over a max), so the compat needs an omp version of its own pinned first. docs/subsystems/agent-wiring.md says so. Run: new TestDshTellsAResponsesToolsStrictIsOff and TestPiTellsAResponsesToolsStrictIsOff fail without the change (the first with "a model asked on Responses isn't told strict is off: Compat:<nil>", the second with "resp/gpt-5.5 is asked on Responses and isn't told strict is off") and pass with it; removing only the dsh case turns the first red and only it, removing only the piModelJSON compat line turns the second red and only it. go test ./internal/agent/ (TestMothX fails the same with both files back at the baseline here, so not from this change), gofmt -l on the changed files (nothing), go vet ./..., GOOS=linux GOARCH=amd64 go vet -tags nogui ./..., GOOS=windows GOARCH=amd64 go vet ./..., go build . (darwin arm64), GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -tags nogui ., GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -tags nogui ., GOOS=windows GOARCH=amd64 go build -o /dev/null . Landed (yetone). Broken by hand on mote: with the dsh case and piModelJSON's compat line taken out, both new tests are red ("a model asked on Responses isn't told strict is off: … Compat:<nil>", "resp/gpt-5.5 is asked on Responses and isn't told strict is off"). Run at the pushed head: go test ./... -timeout 45m on mote with this branch on |
||
|
|
bb478f0e50 |
agent: a look that only ranges over magpie's models reads the list kept
magpieModels gives each caller its own copy of the list it keeps per
agent. Most callers only range over it, or count it, and a range copies
each model anyway, so the copy guarded nothing for them (the models'
own lists were shared before too: the copy was shallow). sharedModels
is the list kept, read only; every `range magpieModels(` and
`len(magpieModels(` in internal/agent (39 files) takes it. Callers that
keep the list, append to it or hand it on still get their copy.
Real accounts (sandbox copy of the owner's HOME, network blocked), 40
polls of /api/state, /api/providers and drift, pprof alloc_space
between two heap snapshots,
|
||
|
|
dd7442f283 |
agent: a look at the via-magpie options shares the kept list
viaMagpie handed every caller its own copy of the options list it keeps per stamp, and a window poll asks for it from most agents' fields and pickers. In a real-account sandbox (abr.sh, 20 polls of drift, state and providers on v0.1.2463) those copies were 33.7 MB of slices.Clone, plus ~8 MB more on the way, of the 713 MB the polls allocated. viaMagpieShared returns the kept list itself, clipped, so an append makes the caller's own array. The 58 callers that only read it, or append onto it, now take it; viaMagpie (a copy) stays for the ones that change it. TestKeptListSharedWithoutACopy checks that 20 shared looks return the kept array, and that an append onto a shared look and a write into get's copy leave the kept list as it was. Run on mote at this tree: - gofmt, go vet (darwin, GOOS=windows, GOOS=linux with gateway), go build ./...: ok. - Broken by hand (shared returns slices.Clone): the test is red, "a shared look copies the kept list". - go test -count=1 ./internal/agent: ok (480s). Not run: internal/gateway and internal/gui packages on this tree. |
||
|
|
544b91ca87 |
dsh: magpie's routes wait for a slow reply as long as the gateway does (tim on Discord)
tim's first "who are you" to gemini-3.8 through the third-party plugin
magpie-gemini-web 0.8.0 took minutes in dsh and ended in 499 ("the agent
canceled the request"). dsh hung up: llm-pi-ai gives a turn up after 5
minutes with no pi-ai event (DEFAULT_STREAM_IDLE_TIMEOUT_MS, every
dsh-llm-pi-ai from 0.1.5 to 0.2.2), and the gateway's ": keepalive"
comments (keepQueued, keepQuiet) are not events. The plugin serves one
request at a time (maxConcurrency 1), dsh's own session title goes to the
same route model in parallel, and the plugin's backend sends no byte
before its first token, so the turn's 5 minutes ran out in magpie's queue
and the backend while the gateway (10 minutes for headers) and the plugin
(240s per wait, then its own 504) were still waiting.
Every one of magpie's dsh routes (patch lists and deepseek-acp's
settings.yaml, all through dshPutProviders) now has streamIdleTimeoutMs:
600000 (dshIdleWait), the gateway's upstreamHeaderWait. A value already on
the route, set in dsh's Models page or by hand, stays. Codex's
comment-blind limit is still met in the gateway (agentQuietMost); dsh's is
a route setting. The plugin's own slowness is its maintainer's and is not
changed here.
Verified:
- New tests TestDshRoutesWaitAsLongAsTheGateway and
TestDshRouteKeepsTheUsersIdleWait (internal/agent/dsh_idle_test.go),
green on mote. Broken by hand: without the field the first fails
("route magpie waits 0ms for the next event, want 600000"); without the
keep the second fails ("sync 1: the user's 120000 became 600000").
- Real dsh 0.2.1-rc.2 (headless, sandbox HOME/DSH_HOME, the route as
magpie writes it, a fake Chat server on 127.0.0.1:3561 that answers
after 8s): streamIdleTimeoutMs 3000 -> "TIMEOUT: pi-ai stream idle
timeout after 3000ms"; 600000 -> "hello there", exit 0. With headers
sent at once and ": keepalive" every second it still timed out at 3000,
so comments don't feed the watchdog. dsh-llm-pi-ai 0.1.5-rc.3,
0.1.7-rc.2, 0.2.0-rc.2 and 0.2.1-rc.5 (npm pack, read) all take the
field per provider, max MAX_TIMER_DELAY_MS.
- gofmt -l clean. On mote: go vet ./..., GOOS=linux go vet -tags nogui
./..., GOOS=windows go vet ./..., go build, GOOS=linux go build -tags
nogui, GOOS=windows go build: all ok.
- Full suite, go test -tags nogui -count=1 -timeout 45m ./..., on the
Linux box (wsl-run, magpie-desktop; mote had two full suites running)
at
|
||
|
|
49b8c64559 |
dsh: deepseek-acp gets magpie's route in settings.yaml, and the key store is owner-only
liby233 on Discord: dsh in an editor over ACP (deepseek-acp, CodeG, the
desktop app) listed only DeepSeek's own models. Checked against the real
packages from npm (deepseek-acp 0.9.0, dsh 0.2.1-rc.5): deepseek-acp
mounts FileSettings on $DSH_HOME/settings.yaml alone, never profiles/,
and loads the pi-ai plugin only when that file mentions "llm-pi-ai". Its
credentials-local store throws when .credentials.yaml is readable beyond
its owner ("run chmod 600"), so a 0644 store stops it from starting.
- settings.yaml gets llm-pi-ai.providers.magpie, built by the same code
as the profiles' route (dshPutProviders), at 0600 when magpie creates
it. It gets no agent-default-model of magpie's. The user's routes,
other sections, comments, mode and the api they chose for magpie's
route are kept. Disconnect takes only magpie's route out, and the
section too when nothing else is left in it.
- dsh 0.2 renames settings.yaml to settings.yaml.imported (over the one
before) at each full start and imports it into the profile. The
serving round, Sync, Set and Unwire write it again. The user's own
import from before magpie's first write is copied once to
settings.yaml.imported.kept, so magpie's import never overwrites it.
- .credentials.yaml is made owner-only (go-rwx) on every write and every
Sync, whoever made it 0644. In a WSL distro, a file written through
\\wsl.localhost comes out 0644, so the chmod runs inside the distro:
wsl.exe -d <distro> -e chmod go-rwx <path>. A failure is logged and
doesn't fail the write.
Run:
- internal/agent on mote (ok) and its Dsh/WSL tests on Windows
(xiaomi-gpu, ok); gofmt; go vet on darwin, GOOS=linux -tags nogui
and GOOS=windows.
- The new tests (dsh_acp_test.go) were broken by hand, each turning red:
dshSettingsAgain disabled, ownerOnly disabled, dshKeepImported
disabled, and the round's call removed.
- Real runs on mote in a sandbox HOME (~/runs/realdsh-home), never a
live ~/.dsh. After magpie's Pick, real deepseek-acp's session/new
listed magpie::deepseek/pro and magpie::deepseek/flash; without
settings.yaml it listed only DeepSeek's. With a 0644 store its boot
failed with the credentials-local error, and it started once magpie
had made the store 0600. `dsh --profile web --dump-config` shows
agent-default-model magpie and the route. `dsh headless` ate
settings.yaml into the headless profile, and magpie's round
(dshWiredOnce) wrote it again, after which ACP listed magpie's models
again.
- On magpie-desktop: `wsl.exe -d magpie-desktop -e chmod go-rwx` takes
a file written through UNC from 644 to 600.
Not tried:
- magpie's own write into a real WSL distro end to end; only the
command form above, and fakeWSL in tests.
- A WSL distro has no serving round, so after dsh eats settings.yaml
there, it comes back only on magpie's next Sync or model pick.
- A dsh from before profiles (config.yaml only) is left as before.
Also: fakeWSL answers the chmod without recording it, since it is neither
a start nor a probe (TestWSLMoreAgentsStopped counts starts).
|
||
|
|
73a12e8bf6 |
wsl: a distro's agent folder that is a link is opened where it leads (#4502)
On Windows, adding a skill or switching RTK on for an agent in WSL failed with `mkdir \\wsl.localhost\<distro>\root\.codex: Cannot create a file when that file already exists` (linusxiong). In the distro ~/.codex is a link to /mnt/c/Users/<user>/.codex. Through \\wsl.localhost Windows can't follow a link the distro has: a mkdir of it says it exists, and nothing below it can be made, written, read or listed. ggbdpq found and explained the link (thanks); their patch, which takes that EEXIST as "there", wasn't used: the writes below the link fail next (its test passed because a symlink here is followed). The fix, for every agent folder and every writer through \\wsl.localhost: - The WSL probe asks `readlink -f` in the distro where each agent folder, its skills folder and the folders beside them lead (wslLinkPaths -> distro.Links; a $HOME that is itself through a link is left alone), and which drive each Windows mount is (win:/mnt/c C: -> distro.Drives). - distro.open opens a path at or below a link where it leads: on a Windows drive, the drive's own path (C:\Users\<user>\.codex); elsewhere in the distro, through \\wsl.localhost again. native spells it back through the link, so the agent is told its own path. - A link readlink couldn't resolve is never guessed at: distro.open errors, and the agent is unreached (Agent.Unreached: its notice says why; every field Set and Sync returns it). - Writers: the agents' own files (place.join/place.open, every filepath.Join(at.home, ...) in internal/agent), the library's WSL targets (wslOpen/wslOpened; one "wsl" problem per agent and nothing written), RTK (rtkAt, rtkInstall checks agent.WSLOpen before its mkdir), the Sessions page's WSL reads (sessions.WSLHome.Open) and the Copilot CLI sign-in read (provider.CopilotWSLHomes -> CopilotWSLDirs). - Not changed: magpie's image MCP server opens arbitrary paths an agent in WSL gives it the same way; filed as #4578. Links deeper than the probed paths (other than <agent dir>/skills) aren't resolved. A distro probed by an older magpie has no Links until probed again (each run). Run: - Real Windows box (xiaomi-gpu, distro magpie-desktop, sandbox /tmp/x4502/home with .codex -> /mnt/c/Users/yeton/runs/x4502-target/.codex, .claude -> /tmp/x4502/data/claude, .pi -> a missing folder), a throwaway Windows test running the real probe with that HOME: probe said link:.codex /mnt/c/..., link:.claude /tmp/x4502/data/claude, link:.pi, win:/mnt/c C:, win:/mnt/d D:. The old way, MkdirAll(\\wsl.localhost\ magpie-desktop\tmp\x4502\home\.codex\skills\pdf) = "Cannot create a file when that file already exists" (the report's error). distro.open wrote SKILL.md to C:\Users\yeton\runs\x4502-target\.codex\skills\pdf and to \\wsl.localhost\magpie-desktop\tmp\x4502\data\claude\skills\pdf, both read back with cat in the distro through the links; .pi said "~/.pi in WSL magpie-desktop is a link magpie couldn't follow". Sandbox and target removed after. - New tests with a fake distro whose ~/.codex and ~/.claude are links to /mnt/c/... that don't exist here, so, as through \\wsl.localhost, nothing below them can be made: TestWSLFolderIsALinkToC, TestWSLFolderLinkUnresolved, TestRTKWSLFolderIsALink, TestRTKWSLFolderLinkUnresolved (library); TestWSLProbeLinks (runs the probe script), TestWSLOpenThroughLinks, TestWSLAgentFolderIsALink (config and a Claude session read on C:), TestWSLAgentFolderLinkUnresolved (agent). - Broken by hand: the library tests on the base (with a no-op FakeWSLDrives) fail with "mkdir .../home/me/.codex: file exists", the report's error; with ggbdpq's patch applied they still fail (the skill mkdir, and RTK's hook not written). - mote: go build ./...; go vet of agent, library, sessions, provider for darwin, GOOS=windows (and linux for agent, library); gofmt -l clean; go test -timeout 45m ./internal/agent ./internal/library ./internal/sessions ./internal/provider: all ok. - Windows (win-run): the same four packages. The new tests pass (the RTK ones skip: the fake distro runs sh). 32 tests are red, all already red at the base |
||
|
|
e2a65cbc9b |
dsh: a start on a found group's old id moves onto the id its route lists (zyh6036 on X)
zyh6036 on X: DeepSeek Harness Desktop showed no model after magpie turned dsh on and the app restarted, while the profile's patch file was full of magpie's gateway. Cause: a dsh start (agent-default-model) magpie had set to a found routing group keeps the id the group had then, group/auto-<slug>. Since |
||
|
|
5cc2eea2fe |
dsh: a dsh CLI that has booted no profile yet is wired in its web profile, not config.yaml (liby233)
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 |
||
|
|
0c4e3455ee |
agents: a line magpie writes into a TOML, YAML or env config has a note above it saying so
Jevik_AI on X deleted magpie's folders by hand. Codex's config.toml kept openai_base_url = "http://127.0.0.1:3425/backend-api/codex", with nothing in the file naming magpie, and every Codex turn failed with a 502. Each line magpie writes that points at the gateway, or at magpie's model list, now gets a comment line of its own just above it: # magpie: Codex on magpie's local gateway; Disconnect in magpie or # `magpie uninstall` undoes it, or delete this line and the model line model_provider = "magpie" - Only a line the write adds or changes, or one that had a note, gets one. A line of the user's own that magpie leaves alone gets none. - The note is never on the value's line. Grok App's providers.rs reads the rest of a line as the value, and an end-of-line comment broke TestGrokApp in a first try. - Every write takes the notes out and puts back the ones still needed, so a note goes with its line and Disconnect leaves none. - No note in JSON. A YAML note that would change what the file reads as isn't added. - Wired in run (agent.MarkWritten); tests leave edit.Mark nil so their exact bytes stay. Run at this commit's tree (worktree, sandbox HOME, private GOCACHE): - gofmt -l clean; go vet darwin, GOOS=windows, GOOS=linux -tags nogui ok. - go test -tags nogui -run Mark ./internal/edit ./internal/agent: ok. - ./internal/agent and ./internal/edit whole with edit.Mark forced on for every test (a snapshot with lineNote set in agent's TestMain): edit ok; agent fails only TestDshRouteKeepsTheAPIPickedInDsh and TestDshSearchThroughGateway, which compare exact bytes and see the note line. With Mark unset (as shipped) they pass. - Real Codex: built magpie from this tree, `magpie codex fakeai/fake-1` in a sandbox HOME. config.toml got the three notes above model_provider, model_catalog_json and openai_base_url; `codex mcp list` and `codex features list` (codex-cli 0.162.1) read it, rc 0, and Python's tomllib reads the same values. `magpie codex default` took them out. - Broken by hand: a note on every line, not only changed ones -> TestMarkTOML and TestMarkOnlyWhatMagpieWrites red. - The notes' line filter is withoutNotes, unexported: an exported Unmarked put a word the routing plugin translates into a Go file, and i18n-keys' "a plugin's words are its own" went red on it. It passes now. Full suite: run with the uninstall commit that follows, recorded there. |
||
|
|
f6ed2c99bc |
effort: a vendor's light and extra_high are low and xhigh, in dsh, Pi and the gateway
nianshou5 (Discord) runs Trae's DeepSeek V4.1 Flash through the Our Free Model plugin (github:mu-zi-lee/magpie-our-free-model). Its variants are Trae's own names, light, high and extra_high, and dsh offered only default and high: dshModelLevels (and Pi's piThinkingLevels) matched a model's efforts to pi-ai's level names only, so light and extra_high were dropped. The gateway dropped them too: effortOf read "light" as no effort, and NearestEffort fitted an agent's low or xhigh to the plugin's high. catalog.EffortAliases names light as low and extra_high as xhigh (EffortLevel). NearestEffort places a model's levels by the level they name and returns the model's own word; the gateway's effortOf reads an alias as its level. dsh's reasoningEfforts and Pi's thinkingLevelMap map dsh's low/xhigh to the model's own word (modelEffort), which llm-pi-ai sends on the wire as written (resolveModelReasoning in dsh-llm-pi-ai reads each value as "the spelling dispatch sends"). Levels a user kept are untouched: only the names a model lists are mapped. Tests: TestDshOffersTraeNamedLevels (agent), TestNearestEffortTakesVendorWords (catalog), TestPluginThinkingOff's new fake-trae subtests (gateway, a real plugin host with the fake plugin listing light/high/extra_high). Broken by hand: modelEffort without the alias, dsh levels [high] (the report's picker); NearestEffort without EffortLevel, low/xhigh sent as high; effortOf without the alias, light/extra_high sent as nothing. Run on mote at this tree (base |
||
|
|
e54a7d50b9 |
agent: a stopped WSL distro's files are never opened, which started it again (#3896)
The reporter stopped Ubuntu-24.04 with "Detect agents in WSL" on, and magpie started it again within seconds. Opening any path under \\wsl.localhost\<distro> starts a stopped distro, and every /api/state did that: - wslAgentsOf built every WSL kind at a stopped distro's place, found or not, only to ask Detected(). Two builders read files even at a cold place: hermesActive read ~/.hermes/active_profile and dshAt listed ~/.dsh/profiles. Now only the kinds the probe found are built (the same test: wslAgent's detect is k.found), and both builders read nothing when the place is cold. - The Agents page asks every agent's pickers for options, and a stopped distro's agent kept the live options for fields with no asleep options of their own: Codex's memories and subagent effort read ~/.codex/config.toml (19 times a call), Grok Build's model read models_cache.json and config.toml, dsh's model listed its profiles. Each now has asleep options built from magpie alone: Codex's memories as its model, its subagent effort from magpie's catalog, Grok's from the live catalog, dsh's own models taken as 0.1.5 on (as its effort already was). TestWSLColdPlaceOpensNothing builds every kind at a stopped distro over a home with each kind's files, runs Values, Notice, Drift, Wired and every field's Options, and fails on any path under it the os package was asked to stat or open (-test.testlogfile). Red on the old code: the hermes and dsh reads from building, then the 19 Codex, the Grok and the dsh reads from the options. Run at the pushed head: tree |
||
|
|
466cafa0cf |
idle: the loops that look every few seconds wake together on the clock's beat (#3185)
An idle magpie serve still woke ~6 times a second with nothing to do. Its loops each kept a ticker of their own, started at their own instant: awake.Keep (5s), the plugin config's KeepFresh (5s), the middleware observer (5s), OTel's session watch (5s idle), the Codex daemon check (15s), dsh's wiring (30s), the model lists' look (1m). Every one woke the process apart, a few threads each time. internal/beat's Next(every) fires at the next multiple of every on the clock, so the 5s loops come due at one instant, the 15s and 30s ones on every third and sixth of it, and the runtime runs timers due together in one wakeup. Each loop now waits on beat.Next instead of its ticker. No channel is shared between callers (a synctest bubble's channel reached from another crashes the process, #3632). Run at this head ( |
||
|
|
3b5a2f612d |
dsh: Max reaches GLM-5.3 as max, asked adaptively with its level
01huadalang on Discord (10-24): DSH Desktop on magpie-anthropic, zcode
GLM-5.3 at Max; magpie's Routing log showed 77 of 78 requests at low,
one at high, never max.
What DSH sends, from the real app (DSH Desktop 0.2.1-rc.3's app.asar,
pi-ai 1.1.0 and dsh-llm-pi-ai, run read-only through node with
magpie's GLM-5.3 entry): at Max and at High alike, max_tokens 128000
and thinking enabled, budget_tokens 16384. pi-ai's clampReasoning turns
xhigh and max into high before thinkingBudgetForLevel, so no
thinkingBudgets setting can give Max a budget of its own. At Low it
sends 2048; with reasoning off, no thinking field.
What magpie did with it: 16384 is read as high (effortOfBudget) and
sent as output_config.effort high, so Max could never reach max. The
"low" rows were not reproduced: no request DSH builds at Max reads as
low here, and Z.ai refused none of the shapes (live, below), so no
refusal memory lowered it. A 2048 budget (a session or a subagent DSH
runs at Low; dsh-tool-subagent lets the model pick reasoning_effort)
reads as low, and that is the likeliest source. It is asked of the
reporter.
The fix, zero-config: Z.ai's GLM-5.2 and GLM-5.3 (the GLM half of
effortInOutputConfig) are written into dsh's magpie-anthropic route
with compat.forceAdaptiveThinking (gateway.AdaptiveWithEffort, beside
AdaptiveThinking). MiniMax-M3.1-Flash, the other half, is left on its
budget: adaptive wasn't tried on MiniMax (no key), so it is on #3496. pi-ai then sends thinking adaptive and
output_config.effort from magpie's thinkingLevelMap, max as max
(checked against the real asar: low/high/max each go as themselves).
The gateway already passes adaptive thinking with output_config.effort
through for these models (fitted to their levels, withOutputEffort;
TestGLMEffortInOutputConfig pins it), so the gateway only gains
AdaptiveWithEffort. No client name is keyed on, and a budget alone is
read as before. An adaptive-to-budget rewrite in withOutputEffort was
tried first and dropped: TestGLMEffortInOutputConfig pins adaptive
passing through, and Z.ai takes it.
Live, Z.ai GLM-5.3 with the zcode key (sandbox script, key never
printed): adaptive and enabled+effort both accepted; effort max
thought 1237-1427 chars against 426 at high, so max is a real tier.
Run, at this head rebased on origin/main
|
||
|
|
34f9686bd2 |
agent: dsh's desktop app is DeepSeek's own DeepSeek Harness; the community DeepSeek Hermes is not it
WuSix on Discord (Windows 11), on v0.1.1337: the desktop app still isn't in magpie's Agents, and the repo |
||
|
|
0c679c6404 |
agent: DeepSeek Hermes, dsh's web UI in a window, is found and wired as dsh
WuSix on Discord: magpie's Agents page didn't find the "DeepSeek Hermes"
desktop app, so its models were added in the app by hand.
DeepSeek Hermes is motongv/deepseek-hermes-desktop 1.0.0, an Electron
window around `dsh web` (not Nous Research's Hermes Agent). Read from its
real release files: the macOS zip's Info.plist (bundle id
com.deepseek.hermes.desktop, 1.0.0) and the Windows NSIS installer's
header (InstallLocation under HKCU/HKLM Software\df9f5892-ad1c-5623-a260-
30fb0acc7e55, default %LOCALAPPDATA%\Programs\DeepSeek Hermes\DeepSeek
Hermes.exe). Both bundle @deepseek-ai/dsh 0.1.0-rc.6, which boots the
`web` profile in ~/.dsh (DSH_HOME). There is no Linux build.
Before: with no dsh CLI the dsh row was 未找到 CLI with its settings
hidden, an unopened app wasn't found at all, and a pick would have made
DeepSeek Harness Desktop's profiles/desktop, which Hermes never reads.
Now:
- desktopapp: installed() also takes the Windows exe under the app folders
or the registered InstallLocation; HasApp uses it.
- dsh: DeepSeek Hermes counts as dsh's app. With it (and no Harness
Desktop) magpie writes profiles/web/cordis.patch.yml and the key in .env
only. rc.6's dsh-credentials-local reads only the flat store and refuses
to start on the version 1 .credentials.yaml magpie writes for Harness
Desktop ("the value for "version" ... must be a string"), so that store is
not written, and one magpie wrote before (nothing but its key) is
removed. A store with the user's own keys is left alone. With Harness
Desktop also installed, its profile and store are used as before.
- noticeDsh6 for an unopened Hermes, in zh, zh-TW, ja and de.
Run:
- Real rc.6 in a sandbox HOME (npm --before=2026-08-17), never the live ~/.dsh:
- `dsh -p headless` with magpie's route and the key in .env only against
a fake gateway: POST /v1/chat/completions, model deepseek/deepseek-chat,
Bearer key, answered.
- With magpie's v1 store: `dsh web` exits on the error above; without it,
it boots.
- A web profile holding only magpie's cordis.patch.yml, `dsh web
--dump-config`: rc=0, dsh added package.json, cordis.yml and
pnpm-workspace.yaml, the patch was byte-identical after, and the
composed config has the magpie route, agent-default-model and
web-search-deepseek.
- New tests TestDshHermesFound/Windows/Wired. On the old code (
|
||
|
|
ca4a1cde0d |
dsh: maxTokens leaves dsh half its window, or a quarter for output where that is more (#3298 item 3)
|
||
|
|
489d816213 |
agent: dsh's wiring round does nothing when nothing it reads changed
A user's live heap profile showed 35.7 GB allocated in 48 minutes with
~157 MB live. 12.1 GB of that was one path: KeepDshWired -> keepDshWired
-> dshWiredOnce. It runs every 30 s, and each time it rebuilt the whole
catalog and every route, only to write nothing. Within it:
magpieModels("dsh") 9.5 GB, dshRouteAgain 4.8 GB, dshPutRoute 3.8 GB, and
Exposed/Catalog/heldOf/entriesOf ~7.7 GB under them. heldOf caches only
during a Hold.
What changed:
- provider.StampNow (hold.go) records what the catalog is built from,
without building it:
- held.gen, which Changed and a plugin's change move
- filememo.Gen
- the environment
- the stat stamps of providers.json, settings.json and the catalog's
cache file, which another process's writes move
- keepDshWired keeps a dshRounds between rounds.
- It builds magpieModels again only when the stamp moved, or when its
models are dshModelsFor (5 min) old. The 5-minute rebuild covers what
no stamp sees: another app's account file, or a model retired by date.
- It skips the round when these are all the same as at the last round,
and that round wrote nothing and left the files as it found them:
- the bytes of dsh's files: every profile's cordis.patch.yml, the
home layer, settings.yaml, .env, .credentials.yaml, config.yaml
- the gateway URL
- the hash of the models
- A read error other than "missing" hashes as unknown, so the round
runs.
- dshWiredOnce (Sync, Connect, tests) still always does a full round.
- No singleflight and no new lock: the round already runs under dshWrites.
- docs/subsystems/agent-wiring.md says so.
Not done: caching Exposed/Catalog/entriesOf outside a Hold. Their output
depends on time (retiredNow, disabledNow) and on files other apps write,
and nothing signals a change in either, so nothing would bound how stale
the cache gets.
Measured with a throwaway test in a sandbox HOME, on top of 4f044c24c:
12 providers from a real models.json, 270 models, 3 dsh profiles.
- Before, per round: 132.61 MB, 900,624 allocations (~265 MB/min).
- After, nothing changed: 0.26 MB, 119 allocations.
- After, models older than dshModelsFor: 30.77 MB, 88,336 allocations.
The dsh parse and write are skipped because the models' hash is the
same.
- Averaged over time: ~6.7 MB/min, against ~265 MB/min before.
New tests:
- TestDshRoundWithNothingChangedBuildsNothing: AllocsPerRun must be at
most 300; it is 77 now.
- TestDshRoundAfterAChangeWritesAgain covers each change:
- a provider saved
- a setting saved
- the patch list written over
- providers.json written by another magpie
- a change no stamp sees, picked up after dshModelsFor
Broken by hand, each went red:
- skip always off: the allocation test, at 2099 allocations
- stamp check removed: the provider, setting and another-magpie cases
- roots left out of the stamp: the another-magpie case
- aging removed: the unseen-change case
- file bytes left out of the sum: the patch-list case and
TestKeepDshWiredWritesTheRouteAgain
Run at this tree. It is built on origin/main
|
||
|
|
822f2b3042 |
agent: dsh lists a vendor's reply limit at most a quarter of the window, so it has room to compact (#2823, LoKi on Discord)
dsh takes a model entry's maxTokens as the output of every request. Before deciding when to compact, it reserves that output plus 65536 of headroom out of contextWindow (dsh-compaction-basic resolveCompactSpec). When a vendor's reply limit is close to its window, dsh compacts at a sliver of the window, or can't compact at all. magpie now lists a vendor's figure held to a quarter of the window (dshMaxTokens). It does this on every pi-ai route and in the legacy llm-deepseek entry, the same rule VS Code and Copilot in JetBrains already use. A Max output the user set stays as they set it (outputOr). LoKi's patch capped only an output >= the window. That misses #2823's own case (a group at 500000 / 393216) and outputs above window - 65536, such as 131072 / 65536. The quarter rule covers all of them, and a cap can only lower the reservation. Run: real dsh 0.2.0-rc.2 headless, sandbox HOME/DSH_HOME, a fake OpenAI SSE server with a tool-call step so pre-step compaction runs, and an observe-only loader hook on resolveCompactSpec. origin/main |
||
|
|
f191d6423b |
agent, library: a dsh patch list that opens with a YAML document start marker is edited, the marker kept (#2667)
What changed - dshParse (internal/agent/dsh.go) and dshRead (internal/library/dsh.go) let a patch list open with "---", YAML's document start marker, where before they failed the file as "not a list of entries magpie can edit". The marker goes in the head and is written back with it. - The marker counts only at the left edge, with at most a comment after it, and only before anything but blank and comment lines. A second "---" (a second document), one after the first entry, an indented one, "----", "--- x" or one after "[]" still fail the file instead of being kept as if they were the list's. ggbdpq's patch took a bare "---" anywhere before the first entry, so "---\n---\n- a" (two documents) was edited as one list. - The only line-scanning YAML readers with this check are these two; the rest go through yaml.v3 (edit.GetYAMLTop/SetYAMLTop read node lines and take a leading --- already). Run (macOS arm64, go1.26.8, load average 130-270 from other sessions) - New tests: TestDshDocStart and TestDshDocStartOnlyFirst (agent), TestDshDocStartPatchList and TestDshDocStartOnlyFirst (library). The #2667 fixture is the reporter's bytes. - Broken by hand, each red: marker never taken (all four red with the reported error); no only-once guard (both OnlyFirst red on "---\n---\n- id: a"); library alone reverted (library red, agent green); anything after "--- " taken (both OnlyFirst red on "--- x"). - gofmt -l: clean. go vet ./... (darwin), GOOS=linux and GOOS=windows go vet -tags nogui ./...: clean. - go test -tags nogui -timeout 45m ./... under set -o pipefail, sandbox HOME, at 244538d6d (this change on |
||
|
|
51adf96958 |
agent: a compat switch set by hand on a DSH model stays through a model refresh (#2504)
h4rk8s: a compat parameter set in DSH's Models page (maxTokensField, say)
went each time magpie wrote its routes again, because the route's
"models" list was put whole, and a model that only works with it failed
again.
dshPutRoute now carries every compat key from the model as it is in the
file onto the same model as magpie writes it, when the model is on the
same route and that route is still on the same protocol (api). A model
new to the route, or one on a route whose api changed, starts without
them. A switch magpie sets itself (forceAdaptiveThinking) is put as
magpie has it now. Name, contextWindow, maxTokens are still written from
the catalog.
Run:
- TestDshRefreshKeepsHandSetCompat: red with the dshKeepCompat call
removed ("the hand-set compat went: map[]"), green with it; two syncs
in a row keep it, deepseek/flash takes none, the stale name/context are
rewritten.
- TestDshKeepCompatNotAcrossProtocols: an api change drops it.
- gofmt -l clean; go vet -tags nogui for darwin, linux, windows.
Full suite: go test -tags nogui -timeout 45m ./... (pipefail, suite-lock) at the four #2494/#2504/#2505/#2490 commits on origin/main
|
||
|
|
0889fdb844 |
agent: a model picked for dsh says that a session made before keeps its model, also with no dsh running, and how to switch it there (#2359, IanLi592)
IanLi592 picked a non-DeepSeek model for DeepSeek Harness in magpie, went on in a workspace's session made earlier, and it still went to DeepSeek on their DeepSeek key. That is dsh's design: magpie writes agent-default-model in the profile's cordis.patch.yml, which dsh reads for new sessions only; a session keeps the provider/model in its own log (dsh-agent-default-model README: "An existing session whose request log already names a selection keeps that selection"; dsh-client-ui-model- selection: switch with /model or the composer's model control). Read in dsh 0.2.0-rc.2's installed packages. magpie told them so only while dsh was running (Running gate in dsh's Notice), and said "one already open", while a closed session reopened later keeps its model too. For dsh 0.1.5+ (a profile patch exists) the notice is now given after every pick, and says a session made before keeps its model, open now or reopened later, until /model or the model button by its message box picks another. Before 0.1.5 the restart advice stays as it was, given while dsh runs. Session logs are dsh's and stay untouched. Strings in zh, zh-TW, ja, de and NOTICES. Tested: TestDshPickSaysOldSessionsKeepTheirModel (sandbox home with a web profile, Running stubbed false). With dsh.go and i18n.js put back it fails: "a pick says nothing of the sessions dsh already has: \"dsh's web search goes through magpie, ...\"". go test -run 'TestDsh|TestEveryNoticeIsTranslated' ./internal/agent ok; agent-notice-lang and i18n-keys GUI tests pass in Chromium and WebKit (14/14 each); gofmt clean; vet darwin/linux/windows on internal/agent ok. Not tried in the real dsh app (the notice is magpie's text; dsh's behaviour is from its own package docs). Rebased onto 370eaba97: dsh's Notice keeps the base's first branch (a desktop app never opened says noticeDsh5 alone, #2279), then this commit's profile-before-Running order; the zh/zh-TW/ja/de NOTICES entries keep the new noticeDsh5 string beside the reworded noticeDsh1. TestDsh and TestEveryNoticeIsTranslated: ok. Full suite: SUITE_LINE |
||
|
|
2a1637f4f6 |
agent: DeepSeek Harness Desktop is wired when installed but never opened, and found in any folder it was installed to on Windows (#2279, liangjinyuan-sihan)
DeepSeek Harness Desktop already reads magpie's route: its lib/main.js
(0.2.0-rc.2, the latest on its update feed, read from download.deepseek.com's
dmg and Windows installer) resolves $DSH_HOME, else ~/.dsh, and runs on
profiles/desktop, so the CLI's wiring applies. Three gaps remained:
- Installed but never opened, there is no ~/.dsh: the row wasn't listed,
and connecting wrote the legacy config.yaml the app never reads. magpie
now writes profiles/desktop/cordis.patch.yml from dsh's own template
(PROFILE_PATCH_TEMPLATE) with its routes; the app's initProfile writes
only missing files, so its first start keeps them. The notice says it
starts on this when first opened (noticeDsh5, in all 5 languages).
Disconnect before that first start removes what magpie made, when
nothing else is there; afterwards only magpie's entries go.
- On Windows the installer lets the user pick the folder and registers it
under HKCU\Software\1bf39983-50d0-5fe0-9ef4-cece76f67c5e InstallLocation
(read from the NSIS script of dsh-latest-windows-x64.exe). magpie reads
that, so a custom folder is found, and the Uninstall entry's
DisplayVersion gives the version shown.
Tests: TestDshDesktopNeverOpened (pick on a never-opened app writes the
desktop profile, a user's key in .credentials.yaml and the user's own start
survive Disconnect, the app's first start is told apart),
TestDshDesktopRegisteredFolder (registry stubbed; exe must be there; WSL
twin has none).
Run on this tree, rebased onto
|
||
|
|
66b8999e0d |
dsh: Reconnect puts magpie's key over one in dsh's key store that magpie refuses, and Disconnect puts it back (#1419, DannyJRu)
DannyJRu (dsh desktop 0.2.0-rc.2 on Windows, magpie 0.1.1226): the row said "已不经过 magpie:配置已变更", its tooltip that ~/.dsh/.credentials.yaml holds another MAGPIE_GATEWAY_KEY; Reconnect showed its success toast and the row stayed red. dshCreds left any value there that isn't magpie's own token or LAN secret, so Apply again could never fix what the check reported, and the check sent the user to dsh's Models page instead. The store wins over .env in dsh, and MAGPIE_GATEWAY_KEY is the name only magpie's route reads, so a value there the gateway refuses fails every turn through magpie. Now a model picked here, which is what Reconnect (Apply again) does, replaces such a value with magpie's key and stashes it; Disconnect puts it back. The sync and the serving round still leave it (no silent overwrite of a value the user set), a caller key the gateway takes stays (#1332), and so does any key when dsh points at a magpie on another machine, which only that one can judge. The check now says Apply again fixes it (Disconnect puts the old one back), except for a gateway on another machine, where the old advice stands. TestDshApplyReplacesAKeyTheGatewayRefuses: the sync leaves a refused key and the check reports it; a model set replaces it, keeps the store's other refs, and the check is quiet; Disconnect puts it back; a caller key the gateway takes isn't replaced. It fails on the old dsh.go. go test -run Dsh ./internal/agent passes; gofmt clean; GOOS=linux and windows go vet -tags nogui pass. Not tried with the real dsh desktop app on Windows; why the reporter's store holds a refused value isn't known (an old caller key, or one typed in dsh's Models page), and they are asked to confirm. |
||
|
|
f96b7e842c |
agent: dsh's web search asks the searcher picked under Settings › Web search, not the model dsh starts on (我只会玩单机 on Discord)
magpie's web-search-deepseek row in dsh's cordis.patch.yml was written with the model dsh starts on (ref). The gateway then sent each search to that model, which can't search itself and asked the searcher in turn: two requests per search, and timeouts when the start model can't take concurrent calls. The user had picked "6 Luna" under Settings › Web search, and it was never written. gateway.NamedSearchModel gives the searcher Settings names as "<provider>/<model>" (empty when none is named, search is off, the one named can't be used, or it searches with no model). dshSearchModel uses it for the row on Set and on dshRouteAgain's ~30s pass, so a change in Settings reaches dsh's file, and clearing it gives the start model back. A row the user wrote themselves (no # magpie) stays untouched. Run: go test -tags nogui ./internal/agent -run TestDsh (ok); TestDshSearchAsksNamedSearcher fails with dsh.go and dsh_search.go reverted; gofmt -l clean. Not tried with a real dsh, nor whether a real searcher model answers dsh's web_search end to end. |
||
|
|
814a5ed73c |
agent: dsh asks each of magpie's models on its own API, a route per protocol (01huadalang on Discord)
dsh's llm-pi-ai sets one api for a whole route, so magpie's single "magpie" route asked every model over Chat Completions. A GPT served on Responses, or a Claude served on Messages, was translated from Chat, and its sealed reasoning was lost between tool calls. 01huadalang asked for a group per protocol. What changed: - dshPutRoute writes up to three routes from each model's catalog APIs (dshRouteOf): magpie (openai-completions, as before, for Chat models, Gemini-native ones, groups and agent-bridged sign-ins), magpie-responses (openai-responses, gateway /v1) and magpie-anthropic (anthropic-messages, the gateway root, forceAdaptiveThinking where gateway.AdaptiveThinking). A route left with no models is taken out. An api the user picked for a route in dsh's Models page is kept, and so are keys they added to it. - The start (agent-default-model) names its model's route on a pick, an effort change, and the home layer's mirror. Sync moves a start on one of magpie's routes to the route its model is now on (dshStartOnItsRoute), keeping its mark, effort and other keys. A start on the user's own route stays. - dshCheck checks each route's baseURL against its own api, and asks the route the start names to list its model. - Disconnect, dshOurs, dshKeepPick and dshFillNewProfiles know all three routes. sessions' dshGatewayProvider counts dsh sessions on any of them as magpie's. - docs/subsystems/agent-wiring.md: a line on the routes. Known limit: a dsh session resumed on a model that has since moved routes asks for the model to be picked again once, since dsh finds a model by route and id. Run: - go test -tags nogui ./internal/agent (whole package, default order) and ./internal/sessions -run TestDsh: pass. New tests TestDshRoutesAModelOnItsNativeAPI, TestDshSyncMovesAStartToItsModelsRoute, TestDshCheckSaysAStartOnAnotherRoutesModel and TestDshGatewayProviderTakesEveryRouteOfMagpies. With dshRouteOf forced back to the single route, the three agent tests go red. - Real dsh (headless, sandbox HOME and DSH_HOME) on patches magpie wrote, pointed at a fake gateway: the start on magpie answered from /v1/chat/completions, the one on magpie-responses from /v1/responses (reasoning.effort high), and the one on magpie-anthropic sent /v1/messages with thinking adaptive and output_config.effort high. dsh accepted all three routes. Its Anthropic turn then ended on my fake's SSE, not on the wiring. - gofmt -l clean. go vet -tags nogui for darwin, GOOS=linux and GOOS=windows on internal/agent and internal/sessions. |
||
|
|
20582866a5 |
agent, gui: an agent's advice after a change reads in the window's language (#1508, NovaTrailX)
A Chinese window said "ZCode 已接入 magpie. ZCode reads its providers at
start-up — restart ZCode …": the notice an agent gives after a change
(state.notice) was English text written in place in each agent's file, and
i18n.js had no entry for any of them.
What changed:
- internal/agent/notice.go: a notice is a template registered with
newNotice ("Restart {agent} to …"), filled with say(kv...); Notices()
lists every one. All the agents' notices (claude, codex daemon, zcode,
agy, cursor-local, wsl, AstrBot's added today, …) are now such templates, the issue's list
being a sample of them.
- i18n.js: every template has a zh, zh-TW, ja and de translation, and
NOTICES lists them. tNotice() reads a notice of several joined: longest
template first, a {slot} never runs over a sentence's end, and a notice
with any part that has no template (a plugin's own) reads as given
rather than half in each language. withNotice() joins the status line
and the notice with 。 in zh/ja.
- app.js: the six places that showed state.notice use withNotice.
Tests:
- TestEveryNoticeIsTranslated: every Notices() template is in NOTICES and
in each language table, with the same slots. Fails with the zh ZCode
line deleted from i18n.js (tried).
- TestNoticesAreTemplates: an AST scan for English written in place as a
Notice. Fails with zcode.go's literal put back (tried).
- tests/agent-notice-lang.test.cjs: every template, filled, alone and
joined, plus a plugin's notice, and connecting ZCode as the reporter
did; en, zh, zh-TW, ja, de at 1100 and 420px, Chromium and WebKit:
22/22. Its zh subtests fail without the zh line.
Run: go test -tags nogui ./internal/agent ./internal/gui; gofmt -l;
GOOS=linux and GOOS=windows go vet -tags nogui ./internal/agent
./internal/gui; the full GUI suite (node --test, both engines, -concurrency 6,
machine load ~140): 5130/5195, 64 failing in 22 files. Rerun alone, 16
files pass; mobile-web, old-webkit, panel-usage and routing-context/
group/keys-fold fail the same on the base commit,
|
||
|
|
603dc0c44f |
dsh: Disconnect keeps the model picked in dsh 0.2, which saves it into magpie's agent-default-model entry (#1392)
What dsh 0.2.0-rc.2 changed (read in @deepseek-ai/dsh-settings and
dsh-agent-default-model from npm): ~/.dsh/settings.yaml is gone. On its
first boot dsh renames it to settings.yaml.imported and merges its sections
into the booted profile's patch list (profiles/<name>/cordis.patch.yml);
nothing reads the .imported file afterwards. A /model pick is no longer
kept in settings.yaml either: agentDefaultModel.saveSelection goes through
ConfigEditor.edit, which replaces the config of the profile's last
agent-default-model entry. That entry is magpie's, so the user's pick sits
under magpie's "# magpie" mark. Profile paths, the home layer, .env and
.credentials.yaml are unchanged.
What broke: Disconnect took that entry for magpie's own, dropped it and put
back what magpie stashed from before it connected, so the model picked in
dsh (or imported from settings.yaml) was lost. Seen with real dsh
0.2.0-rc.2: after the import, Disconnect left `[]` and dsh started on its
shipped deepseek-flash instead of the imported deepseek-v4-flash.
Fix: dshKeepPick, run per profile before Disconnect takes magpie's wiring
out, hands a marked agent-default-model that is off magpie's route back to
the user (mark removed, old stash discarded). An entry on magpie's route,
or one on the pre-0.1.5 wiring, is still magpie's. dshStart still reads a
settings.yaml not yet imported, which dsh will put over the booted profile.
Run: TestDshPickSavedIntoMagpiesEntryOutlivesDisconnect (fixture from the
patch real dsh 0.2.0-rc.2 wrote) fails on the old code ("the pick made in
dsh was lost", the stashed deepseek-v4-pro came back) and passes. Real dsh
0.2.0-rc.2 under a temp HOME/DSH_HOME, fake gateway on 127.0.0.1:3561:
`dsh headless "say hi"` sent POST /v1/chat/completions, Bearer magpie,
model deepseek/pro to it, before and after a settings.yaml import; after
Disconnect `dsh headless --dump-config` keeps deepseek-v4-flash;
reconnecting sends deepseek/flash to the fake gateway. go test -tags nogui
./... (temp HOME, pinned caches) passes, -race -count=5 -run TestDsh
passes, gofmt -l clean, go vet and GOOS=linux/windows go vet -tags nogui
./internal/agent pass.
|
||
|
|
8e0e7d3c40 |
dsh: the desktop app's profile made while magpie runs gets magpie's route within a round, not at magpie's next start (star on Discord)
star on Discord reported DeepSeek Harness Desktop with the red
"已不经过 magpie" line. One way there that a desktop user meets: the
CLI's web profile wired, then the desktop app opened for the first time
while magpie runs. dsh makes profiles/desktop/cordis.patch.yml as its
empty template ([]), dshCheck says the desktop profile has none of
magpie's models (Drift "unwired"), and only dshSync — the catalog sync,
at magpie's start or a catalog change — filled new profiles, so it stayed
so until Reapply or a restart. The reporter's exact detail is cut off in
the screenshot, so this is a likely cause, not a confirmed one.
dshWiredOnce, the 30s serving round, now runs dshFillNewProfiles over a
profile that is dsh's empty template, beside the wired ones: magpie's
route and start go in as the catalog sync would put them. A profile with
entries of its own and no route is the user's and is still left alone.
Run: TestDshDesktopProfileMadeWhileServing fails on the old code ("the
round left the desktop profile bare"), passes with the fix, and checks a
user's own unrouted profile is not written. go test -tags nogui
./internal/agent ./internal/gui under a temp HOME with pinned caches: ok;
go test -race -run TestDsh -count=3: ok. gofmt clean; go vet darwin,
GOOS=linux -tags nogui, GOOS=windows; go build darwin, linux nogui,
windows: ok. Not tried with the real desktop app live.
|
||
|
|
ee3f83b59d |
agents: DeepSeek Harness Desktop installed is no missing dsh CLI — its version shows instead of 未找到 CLI (star on Discord)
star on Discord: "DeepSeek Harness 就是现在已经有桌面版了,但是他还是非要找CLI". With DeepSeek Harness Desktop in use and no dsh on PATH, the Agents page said 未找到 CLI and Install another agent offered npm's dsh: CLIMissing (#843) took ~/.dsh without a CLI for an uninstall. The desktop app (DeepSeek Harness.app, com.deepseek.dsh, 0.2.0-rc.2 from download.deepseek.com) keeps the same ~/.dsh — its own profile, profiles/desktop/cordis.patch.yml, and .credentials.yaml — and needs no CLI; its terminal command (Manage dsh Command…) is optional. - desktopapp.go: dsh's app is known by its bundle id on macOS and by %LOCALAPPDATA%\Programs\DeepSeek Harness\DeepSeek Harness.exe on Windows (electron-builder per-user NSIS, productName DeepSeek Harness, getWindowsInstallationDirName); HasApp says either is installed. - install.go: CLIMissing is false with the agent's desktop app installed, so the GUI row, Install another agent and /api all follow; the app's version shows through the existing CLI().App path. - dsh.go: the restart notice also sees DeepSeek Harness.app running. The red "已不经过 magpie" line in the report is a separate dshCheck finding, not caused by the missing CLI: a desktop-only ~/.dsh shaped from the app's real new-profile template wires cleanly (Check "", no Drift; TestDshDesktopOnlyWired). The reporter's exact detail is cut off in the screenshot and is not reproduced. Run: TestDshDesktopAppIsNoMissingCLI fails on the old code ("with the desktop app: missing true, offered true"; with the Windows path removed, "with the Windows app: missing true, offered true"), passes with the fix. go test -tags nogui ./internal/agent ./internal/gui under a temp HOME with pinned caches: ok. gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows on both packages; go build darwin, GOOS=linux -tags nogui, GOOS=windows: ok. Not tried: the real desktop app running live (not installed here; its userData isn't redirected by a sandbox HOME), a real Windows install. |
||
|
|
172f45a5e6 |
agent: dsh's check stays quiet when its key store holds a caller key of this gateway's (#1332) (#1339)
The drift check asked only whether refs.MAGPIE_GATEWAY_KEY equals the key magpie writes into .env, so a caller key the gateway itself issued — which dsh's store prefers and the gateway authenticates — was named as "another MAGPIE_GATEWAY_KEY" and the user was told to remove it there, while delete → disconnect → re-apply wrote the very same state back. The check now asks the gateway's own Authenticate first: a key it takes means dsh is going through magpie, and only a key it would refuse (a foreign one, a switched-off one) is drift. The .env side needs nothing: the serving round rewrites .env to magpie's key, so a stray value there heals itself. TestDshStoreHoldingAGatewayCallerKey (a key from access.Update add-key in the store's refs) failed without the change with the "holds another MAGPIE_GATEWAY_KEY" drift; with it the check is quiet, and a key the gateway doesn't take still reports. Verified: go test -tags nogui ./internal/agent -count=1; the three dsh store tests under -race -count=10; gofmt -l clean; go vet -tags nogui ./internal/agent; go build and GOOS=linux/GOOS=windows go build -tags nogui. Generated-by: GLM-5.3-Flash (ZCode) |
||
|
|
1d1c9e07d2 |
agent: without dsh, the dsh round every 30 s doesn't build magpie's whole catalog for no patch list (H20 on Discord: magpie idles near 500 MB)
dshWiredOnce built magpieModels("dsh") before looking for a profile, so every magpie, dsh or not, built the catalog every 30 s and threw it away: 93% of what a magpie at rest allocated (pprof heap?gc=1 delta over 120 s, a linux nogui `magpie web` in Docker on a copy of a real config with 13.5k Codex and Claude Code sessions mounted read-only). That garbage kept the heap at its GC goal, about twice what it keeps. It now returns before the catalog when there is no profile; with one, nothing changes.
Same measurement, this commit and the warm-up one together: idle allocation 73 MB per 2 min -> 6.8 MB (3.8 MB of it the profile read itself); RSS at rest after the first minutes ~250 MB -> ~203 MB, the heap no longer climbing 125 -> 192 MB between GCs. TestDshRoundWithoutDshBuildsNoCatalog fails without the change (475 allocations a round) and passes with it. go test -tags nogui ./internal/agent (Docker golang:1.26.8, non-root, temp HOME), go vet -tags nogui ./internal/agent for linux, windows and darwin, and gofmt -l pass. Not measured on macOS: a fresh build there hangs at exec behind syspolicyd today.
|
||
|
|
a0cc4562e7 |
agent: a dsh patch list that lost its route to dsh's own save is written back quietly (#1029)
dsh reads a patch list live and keeps the model its sessions start on across its own saves of the file (its desktop app writes the list anew from a snapshot as it saves), but such a save has been seen to take magpie's route out while keeping the start: the providers beside magpie's stayed, the start still named magpie's, and the row went red "no longer goes through magpie" until Apply again — which the next save reddened again. The start naming a model of magpie's is what says magpie was not taken off: taking it off is the switch's doing and it takes the start with it, and a list whose start is dsh's own or the user's stays as it is. So dshRouteAgain writes the route back beside the user's own where the start survives it, and dshCheck says nothing for the loss where a round can repair it — said with no catalog to write from, it stands as before. yetone's review of #1029: the home layer is only written into where it already holds an llm-pi-ai entry of its own — its config replaces every profile's whole entry (dshOver), so one magpie added there would take the user's own providers out of dsh's list (#804) — and the loop over the other profiles no longer skips itself with no catalog: only a profile the round can write back is passed over, and one taken off magpie for real is still said. A list still on the old wiring is dshMove's, not the round's to write beside. Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com> |
||
|
|
5839e08189 |
dsh: the gateway key also goes into dsh's own key store, which the desktop app reads (#969, pan17: in the DeepSeek Harness desktop app every turn failed with llm-pi-ai: no credential for provider route "magpie"; its profile resolves MAGPIE_GATEWAY_KEY, which is not set — store MAGPIE_GATEWAY_KEY through the credentials service (the web Models page writes it) or export it (MISSING_CREDENTIAL), while magpie showed dsh connected) — the route was in the desktop profile (magpie writes every profile; the GUI names only the first, profiles/web, which read as "magpie wrote the npm dsh's config"), but magpie put the key only in ~/.dsh/.env. In dsh 0.2 the .env files are layers the product CLI's boot (dsh-app-boot) loads; dsh-credentials-local resolves inherited environment > $DSH_HOME/.credentials.yaml > project .env > home .env, and "a composition the product CLI did not boot has only the inherited environment as its layer". So the desktop app never saw the key. magpie now also writes refs.MAGPIE_GATEWAY_KEY into ~/.dsh/.credentials.yaml, dsh's own store, which its Models page writes and every dsh reads. Details: a new store is made owner-only, version 1 (dsh refuses a store other users can read); the user's other refs, records and comments are kept; a different key of the user's under magpie's name is left alone (the check already reports it); a store in dsh's pre-release flat layout isn't touched; going back to dsh's own models takes magpie's key out. The check now asks for Apply again when the store lacks the key; a dsh wired by an earlier magpie gets it from the catalog sync magpie runs as it starts. The output of a fresh write and a merge into a store with refs, a grant record and a comment both parse with dsh 0.2.0-rc.2's own parseCredentialsDocument. TestDshDesktopGetsTheKeyFromItsStore (web+desktop profiles as on the reporter's machine) and TestDshStoreOfTheUsersOwn fail without the change and pass; -race -count=5 on the dsh tests. Fixtures that stood for "wired" with .env alone now hold the store too. Not tried with the real desktop app (not installed here; the reporter is on Windows); they're asked to confirm. go test ./internal/agent/, go vet, darwin, linux (nogui) and windows builds pass.
|
||
|
|
6f1da2c585 | agent: DeepSeek Harness's own models say they go straight to DeepSeek (#955) — #834 had every agent's own models say which way they go, Codex's, Grok Build's and Antigravity CLI's custom ones; dsh's three (DeepSeek-V41-Flash, V4-Pro, V4-Flash) still said nothing (EZN7L2C3: DeepSeek Harness 未看到同样的直连入口). Since dsh 0.1.5 magpie is a custom provider beside dsh's own llm-deepseek row, which is left to dsh, so its own models go to DeepSeek on its own key: they now say direct, DeepSeek. Before 0.1.5 magpie took that row over, so nothing is said there. TestOwnModelsSayTheirPath fails without it. go vet, go test ./internal/agent ./internal/gui, GOOS=windows build pass; agent-own-path, agent-path-same and claude-picker-fold pass in Chromium and WebKit, en and zh (no GUI code changed). | ||
|
|
fbaf27bce1 |
agent: dsh's web search goes through magpie while dsh is on one of magpie's models (Packing1 on Discord)
dsh's web search is a plugin of its own, web-search-deepseek, which signs each search to DeepSeek's Anthropic API with DEEPSEEK_API_KEY, so a dsh that reaches its models through magpie alone failed every search asking for that key. While dsh starts on a model of magpie's, magpie writes a marked web-search-deepseek entry in each profile: the gateway's /v1 as baseURL, MAGPIE_GATEWAY_KEY as apiKeyEnv and that model. The gateway answers the plugin's web_search_20250305 request as Anthropic does, by the model's own search or magpie's (web_search_tool_result blocks). A row of the user's, or a DEEPSEEK_API_KEY dsh has in .env or its key store, is left as it is. The entry goes with dsh's own model or Disconnect, and moves with the gateway's address. The row's Notice says when magpie has nothing to search with. TestDshSearchThroughGateway is new and fails without the change. Tested end to end in a sandbox (own HOME and DSH_HOME, gateway on 3493, the real DeepSeek account): real dsh 0.2.0-rc.2 headless called web_search, got eight results through magpie, and answered https://golang.google.cn/blog/go1.26; magpie dsh default took the entry out of all three profiles. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass. |
||
|
|
e77a373792 | agent: every agent in a WSL distro under NAT is given the LAN sharing key, not "magpie" (whqtian on Discord) — v0.1.972 gave it to omp only, and OpenCode in WSL was still written "apiKey": "magpie" with Windows' address, which the gateway takes from loopback only. keyAt(gw) is the key for a gateway URL: the LAN sharing key when the URL isn't this machine's and sharing is on, else gateway.Token; OpenCode (and MiMo Code), Crush, Pi/omo, Codex, Claude Code, Kimi Code, Hermes, Grok, MiniMax Code, Droid, Morph, dsh, Qoder/Qoder CN and omp write it, their Checks compare against it (an old "magpie" there shows as drift), and ourKey still sees a LAN-keyed config as magpie's. TestGatewayKeyBeyondLoopback fails without the change. go vet ./..., go test -tags nogui ./internal/agent ./internal/gui ./internal/gateway ./internal/access ./internal/provider under a temp HOME, GOOS=linux/windows go build pass. | ||
|
|
f5d777c58b | fix(dsh): 保留家级模型选择并修正补丁配置继承 (#838) | ||
|
|
165fee0df5 | agent: an agent's own provider named as one of magpie's isn't magpie's, in every agent that spells a model provider/model (the rest of #835) — OpenHanako's own deepseek/deepseek-v4-pro read as magpie's deepseek, and so did a model of any agent's own provider whose name magpie has a provider by: Pi's, Crush's, Hermes's, OpenCode's relay/glm-4.6 with magpie's relay had the row connected on the agent's own model, and Disconnect from magpie put that model back and left the row connected. An agent says how magpie's values are spelled in it (Spelled, replacing #835's Prefixed): magpie/<ref> for Antigravity CLI, Pi, OmO, Aside, Goose, Zed, VS Code, Crush, DeepSeek Harness, Command Code, fx, omp, Hermes, Mister Morph, Kimi Code, Empryo, MiniMax Code, Droid, Qoder, Qoder CN, Grok Build, AtomCode, Cline and OpenHanako, whose every Get spells magpie's so (a sandbox Set of magpie/relay/glm-4.6 read back as that in each); for OpenCode, MiMo Code and OpenChamber also a provider of the config's own that sends to magpie's gateway, as openCodeRef names a model there. A stopped WSL distro's agent keeps its live one's. Left as they are: Claude Code, Claude Desktop, Codex, Gemini CLI, Cursor, Copilot, Devin (magpie's are bare refs there), Muse Code (a model with / is magpie's by design: Meta's have none), Alma (its own are providerId:model), Air (magpie's only). TestOwnProviderNamedAsMagpies (26 agents: own relay/glm-4.6 not connected, Connect, Disconnect puts it back and the row is off) fails on the old code in each; TestOpenCodeGatewayProviderIsMagpies. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. | ||
|
|
9761248de3 | agent: dsh's home patch layer, ~/.dsh/cordis.patch.yml, gets magpie's route and start model when it overrides the profiles' (#804, liuweifeng) — dsh applies $DSH_HOME/cordis.patch.yml over every profile's own, so a llm-pi-ai or agent-default-model entry there replaced what magpie wrote in profiles/*/cordis.patch.yml, and dsh ran the home layer's old snapshot while magpie read as connected. When the home layer has a llm-pi-ai entry, magpie's route is written in it beside the user's routes (a sync, a model picked, the 30 s round, and taken out on Disconnect); when it has an agent-default-model, the model and effort magpie set go there (the user's one stashed and put back when magpie's goes). A home layer without those entries is left as it is. Reading goes by the home layer too (the model and effort shown, Joined, the checks), and Check says when the home layer's llm-pi-ai lacks magpie's route. TestDshHomePatchLayer and TestDshHomePatchLayerUnwire fail on the old code. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass (TestProvidersAnswerWhileListsComeIn and TestUserPath flaked, pass alone). | ||
|
|
21702d01ff |
Add German translation; harden paths against unset env vars (#770)
* Add German translation and harden paths against unset env vars Add a German locale to the GUI, tray menu, usage alerts and website home page, and refuse to start when the home folder is unset or relative so nothing is written under the working folder; the pi plugin no longer adopts the user's PI_CODING_AGENT_DIR, and an inherited APPIMAGE no longer selects portable mode. Scripts refuse to run from the wrong folder or empty a shared out folder, and a new internal/testenv sandboxes every test package from the user's real files, which also fixes the Claude picker and Termux installer tests on Windows. * Makefile: know magpie's folder by its go.mod, so paths with spaces work The check compared $(CURDIR) with $(dir $(abspath …)), which make splits on spaces, so a checkout under 'My Projects' or 'John Doe' refused every target. It now reads go.mod relative to the working folder and wants magpie's module there: make -C and a symlinked Makefile work, make -f from another folder still stops before any recipe runs. * i18n: German for the strings main added since, with a parity test 75 strings main added (group order, patterns, slow-start wait, usage caps, RTK savings …) get their German, and two that main dropped go. gui-de.test.cjs checks, as gui-ja does, that de has every zh string with its placeholders and tags, and that the window reads in German when picked or on a German system. * appdir: ignore relative folder variables when reading, keep them for children CheckEnv no longer unsets anything. magpie reads the XDG folders, APPDATA/LOCALAPPDATA and every agent's folder variable through appdir.Getenv/LookupEnv, which pass over a relative value; the environment stays as it is, so the agents magpie starts get the variable as the user set it. That covers what proc.UserPath lends from the login shell too, which is set after main's check and reached the desktop app unchecked. On Windows a path rooted on the current drive (\Users\x, Git Bash's /c/x) counts as usable, and magpie version and help answer without a home, before run makes any folder. * Sandbox the tests main added since internal/wslrun gets testenv's TestMain, and four tests main added that set HOME alone set their home with testenv.SetHome, so on Windows they don't read the runner's profile through USERPROFILE. * agentenv: PI_CONFIG_DIR and OPENCODE_DB take relative names on purpose omp puts $PI_CONFIG_DIR under the home and OpenCode a relative $OPENCODE_DB in its data folder, so neither depends on the working folder: appdir no longer passes them over. * i18n: German for the Library's multi-select and System One's decision API The 19 strings main added since (#791's skill multi-select, the decision API snippets) get their German; the one main replaced (four APIs → five APIs) goes. * appdir: tidy the import into magpie's group; say what Go makes of /c/x The appdir import joins the group of magpie's own imports where a file has one. rooted's comment now says that Go takes a Git Bash path like /c/x as \c\x on the current drive, not C:\x. |
||
|
|
2dc8e249cb | agent: dsh on a DeepSeek model picked in its own /model stays connected while magpie's route is in its list (Fate on Discord: DSH went back to Not connected) — magpie connects dsh by putting its route among dsh's custom providers and starting it on one of magpie's models; a model of DeepSeek's own picked in dsh is saved in its settings.yaml over the patch list, and the Agents page, which called an agent connected only when its model field was magpie's, showed it Not connected, though the route, its key and magpie's models in dsh's /model were all still there. dsh now has Joined (the first profile's patch list has magpie's route), as Codex signed in with ChatGPT does, so it reads Connected · pick magpie's models with /model, and a pick off magpie while joined isn't drift ("changed outside magpie"). Disconnect in that state has an Unwire that takes the route, the start magpie wrote and the key out of every profile and .env and leaves the model picked in dsh; on one of magpie's models it does nothing and the model set back does it all, as before. TestDshOwnPickStaysConnected (connect, a DeepSeek pick in settings.yaml: wired, no drift; Disconnect: the template as it was, no key, the pick kept) fails on the old code. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. | ||
|
|
6953627b10 | agents: DeepSeek Harness in a WSL distro (lgtm on Discord: wsl中安装的dsh,目前magpie还是扫描不到,可以添加上吗?) — dsh was this machine's only: dsh(home) read DSH_HOME and wrote the gateway's own address. It is now dshAt(place), as Empryo and the others are: its home is the distro's ~/.dsh (a distro's DSH_HOME can't be read), and the gateway it names in a profile's route, the legacy llm-deepseek entry and Check is the place's (gw threaded through dshSync, dshSet, dshSetEffort, dshCheck and the route writers). wslKinds lists it (dir .dsh, bin dsh); a stopped distro's thinking options come from magpie alone, as its patch lists can't be looked at. KeepDshWired stays this machine's: a distro's route is written again on a sync. TestWSLDshProfiles (a profile's route names 172.20.0.1, a sync and dshWiredOnce leave it) and dsh in wslMore (probe, pick, stopped) fail without it. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass. | ||
|
|
9845e3af51 | dsh: magpie's route keeps the protocol picked for it in dsh's Models page, OpenAI Responses or Anthropic Messages, where each round put Chat Completions back (01huadalang on Discord: 这些协议怎么改 responses,在 dsh 改了一会就会被 magpie 接管) — the route was written whole each round, api: openai-completions included (dshRouteConfig), so a route switched to OpenAI Responses in dsh's Models page went back to Chat Completions within the 30 s the loop takes. Each round now reads the route's api from the profile's patch list and keeps it when it is one of the three llm-pi-ai protocols the gateway serves (dshAPI: openai-completions at /v1/chat/completions, openai-responses at /v1/responses, anthropic-messages at /v1/messages); none, or one the gateway has no endpoint for (google-generative-ai), goes back to openai-completions. The base goes with the protocol (dshBaseURL): pi-ai hands it to the vendor's SDK as it is, and Anthropic's adds /v1/messages itself, so anthropic-messages is at the gateway's root and the two OpenAI ones at its /v1 (as omp and Pi have it); dshCheck asks for the same base, so a route on Messages isn't reported as pointed elsewhere. On Messages a Claude that thinks only adaptively gets compat.forceAdaptiveThinking, which llm-pi-ai offers there, since pi-ai asks every other model for a thinking budget it turns away. reasoningEfforts are as before on all three: llm-pi-ai (0.2.0-rc.2) makes them pi-ai's thinkingLevelMap, sent as reasoning_effort on Chat, reasoning.effort on Responses (off as the map's none, a model without none having off hidden) and output_config.effort for an adaptive Claude on Messages. TestDshRouteKeepsTheAPIPickedInDsh (a loop round and a sync on a route set to openai-responses, to anthropic-messages at the /v1 base, to google-generative-ai and to none; dsh's check clean, a second round writing nothing) fails without the change (openai-responses written back as openai-completions). TestDshResponsesReachChatVendor sends pi-ai's Responses request, with dsh's User-Agent, to the gateway for a model served on Chat Completions alone: it is asked in Chat with reasoning_effort high, the image, tool call and output carried over, and the reply comes back as Responses events. Read from the installed dsh's llm-pi-ai and pi-ai only; no dsh profile, live agent config or running magpie was touched. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState failed once on its TempDir cleanup, passes alone). |