The Windows and Linux downloads (and the CLI builds) are the raw binary, so
what is embedded counts in full. 8.2 MB of the 12 MB under internal/gui/assets
is scripts, styles and svgs. `make assets-pack` (build/assetpack) writes them
to internal/gui/assets.zip (deflate; png/jpg/webm stored), and the release
targets and `make app` build with -tags packedassets, which embeds that zip
instead of the tree (assets_packed.go: a file is unpacked once, on first use,
and served seekable with no modification time, as an embedded one is). Plain
`go build`, `make build`, `make cli` and every test still embed the tree.
The zip is git-ignored and made before every release build.
Sizes (go build -trimpath -ldflags="-s -w", on mote, at e430e2750):
linux/amd64 nogui 73,203,874 -> 67,502,242 (-5,701,632)
windows/amd64 app 88,401,408 -> 82,755,584 (-5,645,824)
The macOS zip/dmg compress the binary already, so they gain nothing.
Run: assetpack, then `go test -tags packedassets -run TestPacked ./internal/gui`
(passes: every file byte for byte and no other; / and a range of the webm served;
no Last-Modified). The first try failed it with "packed has 0 files, the tree
301" (zip entries lacked the assets/ prefix), so it does go red on a bad pack.
go vet ./internal/gui on darwin, linux nogui, windows and -tags packedassets:
clean. gofmt clean.
Not run: the full suite and the GUI suite (default builds embed the tree as
before; api.go only lost the embed line), a real release through
magpie-releases (its release.yml calls these make targets), the Linux GTK
build (cgo).
The macOS -race gateway step split 3772 tests by sorted name into one
fixed share per core (3 on macos-latest), and the shares ran out of their
20 minutes with no test hung: run 42354008450 at 191f3c0af ended at 12m,
16m and over 20m (shard 2 in TestMediaJSONPastOldBodyLimit/images), and
42350695944 ran all three at ~19m20s. Two causes: the shares were uneven,
and a few tests scan tens of MB byte by byte, which the race detector
makes 14 to 30 times as slow.
Measured on mote (M5 Pro), -race, -test.v, old script, per test (plain
run in brackets): TestLoopGuardLeavesOrdinaryRepliesAlone 104s (7.6s),
TestLargeRequestEndpoints 104s (3.6s), TestRequestTailAfterOldLimit 33s
(4s), TestCodexBodyReadsPastOldLimit 14.6s (0.55s),
TestMediaJSONPastOldBodyLimit 10.7s (0.7s), TestCodexCompressedTailError
10.2s. Sums of test time per share: 487s, 641s, 761s.
- build/race-shards.sh: the tests go in ~118 chunks of about 32 (test N
in chunk N mod m, so TestCodex..., TestCompaction... spread out), and
each of the N workers takes the next chunk when it is done (xargs -P).
Workers end within a chunk of each other. Each chunk logs in its own
::group:: with its time; the five slowest are printed at the end. A
chunk whose process didn't finish counts as failed.
- oldBodyLimit (the pre-#118 64 MB) is 20 MB under -race
(race_on_test.go), 64 MB in the plain run. 20 MB still passes every cut
below 64 MB (bodyKept's 4 MB, the 8 MB and 16 MB reads); the plain Test
step on ubuntu and macOS still sends the full 64 MB.
- TestLoopGuardLeavesOrdinaryRepliesAlone is skipped under -race: one
goroutine feeds one loopGuard (loop_guard.go starts none), so there is
no race to find; the plain run reads the whole corpus.
After, per test on mote under -race: TestLargeRequestEndpoints 40.7s,
TestRequestTailAfterOldLimit 13.05s, TestCodexBodyReadsPastOldLimit
5.1s, TestMediaJSONPastOldBodyLimit 4.46s, TestCodexCompressedTailError
3.1s, TestLoopGuard skipped: ~210s less race time.
A/B in one window on mote (same commit, binaries built from base and
change, 3 workers, load 15 to 30): old script with old tests 12m59s
wall (red: TestTranslatedStreamKeepsClientAlive, the load-timing test
of #2711/#2737); new script with new tests 10m57s, green, slowest
chunk 62s. On 3-core CI the wall should be about the total over three
plus a chunk, instead of the slowest share.
Broken by hand (wsl-run, Linux): defaultBodyLimit 16<<20 under -race
turns TestCodexBodyReadsPastOldLimit, TestLargeRequestEndpoints and
TestRequestTailAfterOldLimit red (body rejected / 413); defaultBodyLimit
48<<20 in the plain run turns the same three red. So the race run guards
the read-whole path past 16 MB and the plain run still guards 64 MB.
TestCodexCompressedTailError and TestMediaJSONPastOldBodyLimit stay green
with either cap: they never guarded the limit (true before this change).
Run: gofmt -l; on mote GOOS=linux go vet -tags nogui ./..., GOOS=windows
go vet ./..., go vet ./..., go vet -race ./internal/gateway; the seven
touched tests plain on mote (all pass, 21.9s); the whole gateway package
under -race through the new script on mote twice (one red,
TestBurstTellsNoSpeed/responses_from_chat_burst, the load timing of
#2719; the second run green).
Not tried: the race run with a 48 MB cap (it would pass: under -race
nothing now covers 20 to 64 MB, the plain step does); a CI run before
the push.
Fixes#5361Fixes#5320
psikent (Discord #feedback, 11-03) sent a dark Launchpad where magpie's
icon was a near-black tile with a near-black, glassy bird. AppIcon.icon
gave the bird a fill for the light and dark appearances only, so in the
Clear and Tinted styles (System Settings, Appearance, Icon & widget
style), which draw from the tintable rendition, actool used the light
fill: the bird at 0.086 grey, whose luminance is what the system tints.
On a dark tile that is dark on dark. The bird now has a "tinted" fill of
white, so it takes the tint (or the clear glass) at full brightness.
Light and plain Dark are unchanged.
Not (a) or (c): the shipped Assets.car (v0.1.2816 in /Applications,
same sha as build/darwin/Assets.car) matched icon.json, its dark
rendition already a 0.957 bird on the dark grey tile, and the release
build (magpie-releases release.yml, `make app`) copies that file.
Run at this head, on mote (macOS 27.2, Xcode 27.2):
- xcrun actool on build/darwin/AppIcon.icon, as `make icons` runs it;
that output is this Assets.car (sha 72fe0ee3). The old one was made by
Xcode 26.5; StorageVersion 17 and the 25 renditions are the same, and
this Mac's macOS 26.2 assetutil reads it, the tintable group now
filled with Color-2 (white).
- A test bundle (build/darwin/Info.plist, magpie.icns, the Assets.car)
drawn by IconServices for appearances 0-3 x variants 0-3, and by
NSWorkspace iconForFile under AppleIconAppearanceTheme RegularLight,
RegularDark, ClearLight, ClearDark, TintedLight and TintedDark (mote's
setting put back after). The old Assets.car reproduces the report in
ClearDark and TintedDark; the new one shows a bright bird in all six,
and RegularLight / RegularDark look as before.
- Broken by hand: a colour-coded icon (light red, dark green, tinted
blue) showed Clear and Tinted draw from the "tinted" fill.
Not tried: drawing it on macOS 26 itself (no macOS 26 test box; mote is
on 27), and macOS 15 or older, which use the flattened renditions that
this change doesn't alter. IconServices' variant 1 with dark appearance
(no setting in the six themes maps to it) still draws the light bird on
a black tile, as before.
On Windows 10 magpie's icon looked a size smaller than its neighbours
in the taskbar, the tray overflow and Start's "Recently added"
(dzxx0496 on Discord, #general). Every Windows icon was the Mac's tile:
build/windows/icon-*.png (75cb19264, the exe's icon group #3, which
the window, the taskbar and the Start shortcut's IconLocation exe,0
all use) and internal/gui/icon.png (the tray) were build/icon/gen.go's
app(), on macOS's grid, the tile 80% of the canvas with 10% clear on
each side. Windows draws an app to the edges of its square.
- gen.go: app() and the new win() share tile(). win() is the same
white tile, shading and bird (.8 of the tile), a 32nd of the side
clear from 32px up (1px at 32 and 48, 8px at 256) so the rounded
corners' soft edge stays inside, and to the edge under 32px, where
that pixel would only blur it; corner radius .2 of the side (.225 on
the Mac). No new colour.
- build/windows: icon-16 to icon-256 drawn by win(), plus 20, 24 and
40 px, which Windows asks for at 125% to 250%; winres.json lists
them.
- The tray takes internal/gui/icon-windows.ico (16, 20, 24, 32, 40,
48, 64); Wails picks the SM_CXSMICON entry, where the 64px PNG was
scaled down by the system. icon.png, only the tray's, is gone.
- Makefile's icons target draws all of these.
Not changed: macOS (app() is byte for byte the same at 64, 256 and
1024: cmp against the committed icon-256.png and icon-1024.png; the
.icns, Assets.car and tray.png untouched). Linux: its tray is the
glyph with no tile, and its desktop icon (icon-256.png) keeps the
margin GNOME's and the hicolor theme's app icons have too.
What was run:
- mote: go test ./internal/gui: TestWindowsIconsFillTheirSquare (new),
TestTrayIconPerOS and TestTrayIconSize ok. Red, each filed and none
about icons: TestSettingsSaveKeepsWhatItDoesNotSend (#4514, red 3 of
3 at a fresh origin/main 733fac48f), TestMainWindowCorners/macOS_26_SDK
(#3949, macOS 27) and TestColdTurnsTaken once in the package run,
ok when run again (#4510). go vet ./..., GOOS=linux go vet -tags
nogui ./..., GOOS=windows go vet ./..., go build and GOOS=windows
go build: ok. gofmt -l prints nothing.
- Broken by hand: the old PNGs, winres.json and the old 64px picture
as the tray's .ico: TestWindowsIconsFillTheirSquare red, "tile
(25,25)-(231,231) in (0,0)-(256,256), want at least 15/16 of the
side, centred" and the same for each size, "icon-windows.ico has no
16px picture".
- make release-windows on mote at origin/main and at this change, both
exes on the Windows 11 box (xiaomi-gpu). Its console was locked at
the PIN screen, so no desktop screenshot: instead Windows itself
drew each exe and a .lnk to it through IShellItemImageFactory (what
Explorer, the taskbar and Start use) at 16/24/32/48/256, beside
Docker Desktop, Claude, Explorer, Edge and Notepad, and the tray
icon through CreateIconFromResourceEx at 16 to 40 as Wails makes it.
Before: the tile 80% of the square, the tray blurred. After: the
tile fills it as Docker's, Claude's and Edge's do; the tray is
crisp at each size.
Not run: go test -tags nogui ./... (the change is internal/gui's
embeds, which nogui leaves out, and build/).
Not tried: Windows 10 itself, and the real taskbar, tray and Start
with the desktop unlocked. Windows keeps an exe's icon in its icon
cache by path, so a user may see the old one until the cache renews.
Wails v3 sets a Windows window's icon from the icon group with numeric
resource ID 3 (NewIconFromResource(GetModuleHandle(""), 3) in
webview_window_windows.go). build/windows/winres.json named the group
"APP", and go-winres makes a numeric ID only of a "#n" key, so the exe
had no group 3: the window got no icon, and the taskbar and Alt-Tab drew
Windows' blank page. The group is now "#3".
internal/cli/winres_test.go fails while the group isn't under "#3".
Run:
- go-winres v0.3.3 make as the Makefile's release-windows, an amd64 build
of each on the Windows box (yeton@10.0.0.132): the new exe has group 3
and LoadImage(3) succeeds; the old one has neither.
- TestWindowsIconIsResourceThree red on the old winres.json, green now.
- gofmt -l, go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./..., sandboxed go test ./... at the rebased head.
Not run: the taskbar of the running app seen with the eye; the release
build (signed) wasn't made.
The Race step took 690s on ubuntu and 908s on macOS, almost all of it
internal/gateway: its 1046 tests can't call t.Parallel (t.Setenv rules
it out), so the package ran on one core under the race detector.
build/race-shards.sh compiles nothing itself: it takes the package's race
test binary (go test -race -c), splits its tests round-robin by name over
N processes run at once, prints each process's log in a folded group and
fails when any does. The gateway's TestMain already isolates every
process in its own temporary home, keychain stand-ins and PATH, so the
processes share nothing. The step runs it with one process per core
(getconf _NPROCESSORS_ONLN: 4 on ubuntu, 3 on macOS), the same -race
binary and the same 20-minute timeout; redact keeps its own go test -race.
Every test still runs under the race detector, once.
Locally (Apple silicon, 4 processes) the gateway's race suite passed in
4:39 against 567s of test time run one after another; one test,
TestLargeRequestEndpoints (seven 64 MB bodies, 198s), now bounds it.
* 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.
A vendor or relay can hand out a ready-made provider as a link. The app
registers the magpie scheme (Info.plist on macOS, HKCU on Windows, a
.desktop handler on Linux), a second launch hands the link to the running
one, and the window shows what the link would add, with the hosts the
prompts and key would go to, before anything is saved. `magpie import`
does the same in a terminal.
The Windows app cross-compiles (WebView2, no cgo) as a GUI program with an
icon, version info and a DPI-aware manifest; run from a terminal with a
command it borrows the console. The Linux app links GTK 3 and WebKitGTK
4.1. Off the Mac the app updates its own binary from its own build:
downloaded in the background, swapped in on restart or quit, and the
relaunched process waits for the old one before taking the gateway. The
window leaves room for traffic lights only on a Mac.
The product, module path (github.com/yetone/magpie), binaries, env vars
(MAGPIE_ADDR, MAGPIE_DEV_UI, MAGPIE_THEME, MAGPIE_DEBUG), config and cache
folders (~/.config/magpie, ~/.cache/magpie), bundle id (com.yetone.magpie),
gateway provider id and token, and every UI string now say magpie.
On first run magpie copies ~/.config/dial and ~/.cache/dial to the new
folders when they don't exist yet (copy, not move, so a still-running dial
keeps working; the old folders can be deleted by hand later).
The logo is a small round magpie in profile: one path for the header and
the tray, and the app tile adds the white belly and the blue-green tail.
The header mark is drawn in ink rather than the accent colour, which
fought the text in light mode.
The gateway glyph is gone. The mark is now a kingfisher in profile, facing
the wordmark: big head, dagger beak, short tail, one line for the wing, the
eye a hole. The header draws it in ink rather than the accent, which fought
the text in light mode. The icon generator rasterizes the same SVG path
(flattened cubics, even-odd fill), and the app tile is kingfisher blue.
Three inputs from the left, two of them curving in, meet at a hollow node
and one line leaves to the right: many models, one endpoint. Replaces the
detent ring, which read as a power button.
A control ring open to the upper right with a detached index reaching
through the opening: the instant a knob clicks into position. One glyph
on a 44-unit grid drives the window header SVG, the menu bar template
icon and the app icon; the generator draws it with round-capped strokes
so the three stay identical.
Wails v3 tray panel and window, TUI and CLI. Switches model, effort and
provider for Claude Code, Codex, Gemini CLI, OpenCode, Pi, Goose, Cursor,
Copilot CLI and Crush with format-preserving config edits. Providers page
and registry, stored keys, live vendor model lists, profiles.
Co-Authored-By: Claude <noreply@anthropic.com>