Commit Graph
6 Commits
Author SHA1 Message Date
Snowyy a3704c422b tests: keep the suite out of a real DSH_HOME, as the other homes already are (#454)
DSH_HOME beats HOME in DshDir and in dsh's own dir, so a suite that sandboxes HOME still reads and writes the developer's ~/.dsh.
2026-10-02 00:42:23 +08:00
yetone 0361189f9e test: every package's tests pass on Windows, and none writes outside its sandbox (the user: 把 Windows 上那几个失败的测试修掉) — on a Windows box the suite failed in most packages, and the root package hung for 25 minutes. Tests set HOME, which os.UserHomeDir ignores on Windows (it reads USERPROFILE), so they read and wrote the runner's own home; each now sets USERPROFILE beside HOME, and Devin's, Goose's, Crush's and Claude Desktop's tests set APPDATA/LOCALAPPDATA, where those keep their files there. said() read the command's output only once it returned, and a pipe holds a few KB on Windows, so magpie model --help blocked forever; it reads while the command writes. Unix permission bits (the gateway key store's 0600 too), exec bits and symlinks Windows lacks are checked only off Windows; TOML strings hold Windows paths as literal strings, JSON as marshalled ones; a URL's path is compared as one. The provider and usage packages run in a home of their own (TestMain, as the gateway's already does), since a CLI's identity kept by a refresh still going when its test ended landed in the runner's ~/.config/magpie — and on a Mac in the user's own. Two product fixes came out of it: imagemcp took a file:///C:/… root or image for the path /C:/…, which doesn't exist on Windows, and now makes a Windows path of it (a host for a UNC share); and session discovery could keep a new Cowork session hidden on Linux, where a folder's mtime is a kernel tick and its size doesn't change, so an entry added within the tick of the last listing left both as they were — a listing made within 2s of its folder's last change is read again, as git does for racy files. TestFilePath and TestRacyDirectoryListedAgain fail without the change. On Windows 11 every package passes (32 of 32) and a run of each package in a fresh home leaves nothing in home, APPDATA or LOCALAPPDATA; on Linux (WSL) and macOS go test -tags nogui ./... passes. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build pass. 2026-10-01 23:15:07 +08:00
yetone cdd1e8e7a4 group: a group's id can change — a group magpie found is group/auto-<model>, and agents could only pick it by that; now its id (any group's) is changed in the editor or with magpie group set auto-gpt-6-astra id=gpt-6-astra: the found one stays removed under the old id, the groups that have it in them and their rules follow, and an agent set to the old id is told it needs setting again (#83). magpie groups no longer says a group in a group is not served 2026-09-26 14:14:26 +08:00
yetone d4135b55e1 group: a routing group's models can be another group — group/<id> as a member, routed in its place by its own routing and rules, so Coder can be deepseek-v4-pro then Fast, a Coder rule can send a turn to group/fast and Fast's own rules pick within it; a group can't be in itself directly or through another (refused on save, left out of the picker), groups go at most 8 deep, and one can't be removed while another has it. The Routing tab shows a group in a group as a heading with its models under it, the packet going through it, and the log says what each group's rules and classifier decided 2026-09-26 13:41:17 +08:00
yetone 925e4a6ccd provider: a provider can serve only through routing groups — ticked, its models leave the list agents pick from (and /v1/models) while the groups they are in, and a request naming provider/model, still reach them (magpie provider listed <id> no); the routing groups come first in the list; a model list fetched from the vendor can be forgotten; magpie group add under a name in use replaces that group; and the Library gives MCP servers to Claude Desktop, the ones it runs as a command — a remote one is added in its Connectors, which the page says 2026-09-25 20:11:29 +08:00
yetone b3705cbb5a cli: routing groups are made, changed and removed from the terminal too (#55), where only the Routing view could — magpie groups lists them, yours then those magpie found (a removed one named with how to bring it back, a member no provider serves now marked so, the agents set to each); magpie group add <name> models=<m1>,<m2> routing=smart|order|rotate|usage stays=auto|session|turn|off makes one, its id taken from the name and numbered past one taken as the Routing view does; magpie group set <id> k=v… changes name, routing, stays and the models — models= the whole list in order, models+= and models-= one at a time — and changing one magpie found makes it yours; magpie group rm hides one magpie found, for magpie group restore to bring back; magpie group <id> shows one. Each saves through the same code the Routing view's does, so the file holds the same group and agents' model lists follow the change. A model is its provider/model id as magpie models lists it, or a bare model id one provider serves; one no provider serves, or several do, says which it could mean, and a routing or stays value magpie has none of says the ones it has, where the saved group would have quietly gone back to the default 2026-09-25 14:06:15 +08:00