1ccacad63281094de8a3372d5a507d38f9969e5c
76
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e4197144a8 |
perf: every package's package-level regexps compile on first use
v0.1.3516 made gateway's and redact's patterns lazy. The other 299 package-level regexp.MustCompile calls, in 148 files across agent, provider, gui, library, codexcat, sessions, usage, plugin and the rest, now go through lazyre.New too, so a launch that never reaches them (`magpie statusline`, run by Claude Code on every message) doesn't compile them. Fields, maps and params that held them are *lazyre.RE. Measured on mote (M5 Pro), sandbox HOME, v0.1.3516-equivalent build (t42) against this one (t43): - GODEBUG=inittrace=1 sum: 7.39 MB / 69,837 allocs -> 4.62 MB / 46,765 - `magpie statusline`, 3 runs each: instructions retired ~212M -> ~176M, peak memory footprint 19.2-19.4 MB -> 16.8-17.0 MB Run: go vet ./... (darwin) ok; GOOS=windows go vet on each of the 30 changed packages ok; GOOS=linux go vet ok except ., internal/cli and internal/gui, which stop in wails v3's cgo files when cross-compiled (the same at main). New TestAllLazyPatternsCompile at the root compiles all 574 registered patterns (ok), so a bad pattern fails a test rather than a first use. Not run before push: the changed packages' own test suites; they run on mote after it. |
||
|
|
62a9ab743f |
update: Stable's "Up to date" names the newest version out (ylspcm on X)
ylspcm (macOS) on X: Check for updates always says up to date, but the
installed version is behind, so they reinstall from the site each time.
On Settings' Stable channel the feed answers Stable's weekly version.
An app installed from the site is newer than that, so every check
answered "Up to date" while newer releases were out on Every version,
and the Version row never named the channel. `magpie update` already
said "up to date on the stable channel"; the app didn't.
Now, on Stable with nothing newer there, the check also asks the feed
on every version (update.LatestEvery, before u.mu is taken).
/api/update says channel "stable" and, when it is newer than this one,
newest. The Version row reads "Up to date on Stable · {v} is out on
Every version" with Switch to Every version, which saves the channel
and the existing channel-change path checks again. With nothing newer
it says "Up to date on Stable". On every version nothing changes, and
there is no second request. en, zh, zh-TW, ja, de. reference.md's
Update channel section says so. The row's code fits in the core
script budget with four of renderUpdate's comments cut, no raise
(1,533,753 of 1,533,802).
The cause is inferred, not confirmed: the tweet gives no channel or
version. The live feed has every version at 0.1.3476 and Stable at
0.1.3078. The rest of the check (semver compare, bundle, mirrors, the
worker's 5-minute cache) gave "Up to date" only for a feed answering a
version at or below the running one.
Run on mote at this change on
|
||
|
|
3cabaab54f |
update: the install-folder check removes only folders it made, and refuses a folder it can't look at
Installable (the Windows install-location dialog's check) walked up from the chosen folder to the first one exists() said was there, and removed the topmost one below it with os.RemoveAll. exists() was os.Stat == nil, so a folder whose Stat failed for any other reason than "not there" (access denied, a share that doesn't answer) counted as one the check had made, and was removed with everything in it, up to a drive root. Now: - present(p) tells "there", "not there" (fs.ErrNotExist only) and unknown apart; statPath is os.Stat, swapped by tests. - Installable refuses with "can't tell whether X is there" when any folder on the way is unknown, before making anything. It makes the missing folders one by one with os.Mkdir, records only those it made (one made by someone else meanwhile, ErrExist, isn't recorded), and removes them deepest first with os.Remove, so nothing it didn't make, and no folder that got content, is removed. - settle's "is magpie.exe there" before installFresh (which renames over to) refuses too when the answer is unknown; the download runs on. - The other exists() callers were checked: RemoveStaleNew skips a staged file it can't look at, writeCom moves a magpie.com aside only when it is seen there, keepWebView only writes a note, installed() and EnsureCompanion remove nothing. Unknown already meant "leave it" there, so they keep exists(). Tests (internal/update/install_unknown_test.go): a Stat that answers permission denied for an existing ancestor holding a file, for the chosen folder itself holding a file, and for an installed magpie.exe; each asserts the folder and file survive (checked before the error). Plus folders made are removed while existing ones with files stay, and present's three answers. Run at this tree (parent |
||
|
|
9d366f15b9 |
update: a file the feed names off GitHub goes on to its github.com address, then the API
The feed is about to name usemagpie.ai's copy of each release file on
Cloudflare R2, with the file's github.com address beside it (`github`).
The app, `magpie update` and install.sh now try, in order: the feed's
url; github.com's address (Asset.GitHub), through the user's mirror when
one is set (a mirror is still only put before a github.com address); then
GitHub's API route, looked up from the github.com address, never through
a mirror. A route is left once it answers busy, or for the last tries
after connections that broke. The error names each route that failed.
Every file is checked against the feed's SHA-256 as before.
Run:
- mote: go test -count=1 ./internal/update ok; gofmt -l clean; go vet,
GOOS=linux go vet -tags nogui, GOOS=windows go vet of ./internal/update ok.
- wsl (magpie-desktop): go test ./internal/update ok; node --test
site/install.test.mjs ok.
- mote: node --test site/*.test.mjs 104/104.
- win-run: go test ./internal/update has one red, TestPackagedByDpkg,
the same on origin/main
|
||
|
|
c66cdbea97 |
update: a release file github.com won't serve comes through GitHub's API
On 2026-11-08 github.com answered 504 for every file of
yetone/magpie-releases (…/releases/download/<tag>/<file>) for hours, while
api.github.com/repos/yetone/magpie-releases/releases/assets/<id>, asked
with Accept: application/octet-stream, redirected to the same bytes.
Every self-update and the install script failed (kurutodenzeru, wjbdx,
isee1_1 on Discord). Retrying the same address (
|
||
|
|
a46190e1f5 |
update: a busy download host (502, 503, 504, 500, 429) is tried again
The owner's About page: "0.1.3316 下载失败 · download magpie-darwin-arm64.zip: 504 Gateway Timeout". Only a connection that broke was tried again; any status but 200/206 failed the download at once, though a 504 from GitHub's asset host (or a mirror's) is its edge timing out, and the next ask usually goes through. Such a reply is now a NetError: download asks again after each of retryWaits (2s to 30s), over HTTP/1.1 and keeping what came, as for a dropped connection. When every try is busy it says "download <file>: 504 Gateway Timeout, on every try", and the About row says the download broke off, a network problem, with Check to try again. A 404 or 403 is still asked once. Run (mote): go test ./internal/update ok; -run Update|Download|Mirror in internal/gui and internal/cli ok; GOOS=linux and windows go vet ./internal/update ok; gofmt clean. Broken by hand: with the busy case off, TestDownloadRetriesABusyHost fails at the first 504 and TestDownloadBusyEveryTryAndMissingOnce sees 1 try of 6. Not tried: a real 504 from GitHub; the host's answer is faked. |
||
|
|
e484b4ff26 |
update: a slow download still moving is never ended by a total time; Bun, Claude Code and pf-serve too
#5572: since |
||
|
|
80a47abba8 |
update: a download says its speed and each step after it, and a silent connection is tried again (esir_tech)
esir_tech on Discord: after clicking Update the progress sat on 17% and
looked stuck. Cause: nothing watched a download that stopped sending. A
connection GitHub's asset host keeps open but silent (seen from some
networks) held the percent still until the client's 10-minute timeout,
then failed. The waits between retries showed the same still percent, and
after the bytes the Mac's unpack and codesign check showed a stale 100%.
- internal/update: fetch cancels a body that sends nothing for 30s
(stallAfter) as a network error, so download's existing retry resumes it
with Range. A step callback (update.WithStep) names download, retry,
verify, unpack and signature.
- internal/gui: /api/update's downloading answer carries step, and speed
(bytes/s over the last ~5s; it falls to 0 when bytes stop).
- app.js: the pill says "Downloading… 50% · 1.5 MB/s", "Reconnecting…",
then "Verifying…", "Unpacking…", "Checking signature…"; its tooltip
carries the text where the tight header hides it. Settings' Version row
says the same after its MB count. i18n in zh, zh-TW, ja, de. Comments
cut to stay under the core script budget (not raised).
Run on mote (mote-run):
- go test ./internal/update ./internal/gui -run 'TestDownload|TestUpdate|TestStage|Budget': ok
- new: TestDownloadStallIsTriedAgain, TestDownloadStallEveryTimeSaysSo,
TestUpdateDownloadSaysStepAndSpeed, TestUpdateSpeedFallsWhenStalled
- GUI, chromium and webkit: update-download-steps (new: en, zh, zh-TW, ja,
de at 900 and 420px), update-download-percent, update-download,
update-row-steady, update-stuck, update-network, update-mirror: 178 pass
- i18n-en-no-cjk, header-relang: pass. i18n-keys "a plugin's words are
its own" is red on origin/main
|
||
|
|
1fd0bb9670 |
update: a download whose HTTP/2 transfer broke off tries again over HTTP/1.1
biubiu8802 on X (tweet 2118719081872540038): behind their proxy every
update failed with "download broke off, a network problem", while the
same proxy carried ordinary downloads. Confirmed in the code: download()
retried up to 5 times with Range, but each try went through
netproxy.Dispatch over HTTP/2 again; Dispatch moves a host to HTTP/1.1
only on a TLS record error (recordError: bad record MAC and kin), and
"unexpected EOF" or a stream reset is not one. So a proxy that cuts
HTTP/2 streams part way cut every try the same way.
- netproxy: OverHTTP1(ctx) sends every request under ctx through
Dispatch's HTTP/1.1 copy (route.h1), kept through With.
BrokeOff(err) says a transfer broke off (net.Error, unexpected EOF,
HTTP/2 stream error / GOAWAY / lost connection, a reset; not a
context that ended). AgainOverHTTP1 runs a download once more over
HTTP/1.1 after such a failure.
- update: the tries after a broken one go over HTTP/1.1, and still
resume with Range from the bytes kept.
- Siblings, the other big downloads through Dispatch's client: the
masking model and pf-serve (pii.fetch, one more try over HTTP/1.1
from what is on the .part file), Bun's zip (plugin getURLFrom),
Claude Code's binary (claudecode.download) and the Grok CLI
(grokDownload) each try once more over HTTP/1.1.
- docs/subsystems/providers-accounts.md names it.
Run (mote, Go 1.26.8, at this tree, base
|
||
|
|
49c9491b73 |
update: the Windows app asks where to install, the first time
The Windows exe opened from Downloads (or the Desktop, or temp)
installed itself into %LOCALAPPDATA%\Programs\magpie without a word.
Now, the first time, with nothing installed yet, Windows' task dialog
asks "Install magpie in this folder?". It shows the folder and offers
Install, Change… and Cancel, in the tray's language (en, zh, zh-TW,
ja, de).
- Change… opens the system folder picker. A picked folder gets
"magpie" added unless it is already named that (update.InstallDir).
- A folder other than the default is recorded at HKCU\Software\magpie
InstallLocation. So the next exe downloaded replaces the copy there
in place and asks nothing (installed(), forwards()).
- Cancel runs the exe where it is, as a portable copy, and nothing is
recorded.
- Uninstall forgets the record (update.ForgetInstallDir, a new System
step).
- The shortcut, App Paths, autostart, magpie://, the PATH entry and
self-update already take the running exe's folder, so they follow
the choice.
Program Files and other folders only an administrator can write to
are refused in the dialog (update.Installable test-writes and maps a
permission error to ErrNeedsAdmin). They are not elevated into.
magpie installs per user (HKCU Run, the user's PATH), and its
self-update replaces the exe without elevation (CanElevate is false on
Windows). So an admin folder would make every update fail, or would
need a UAC prompt on each one. A downloads folder is refused too.
Refusing is the simplest correct choice: it costs a user nothing they
had before, and keeps updates silent. Any folders the test-write made
are removed again.
Docs: gui-shell.md, "Where Windows installs magpie".
Run (mote, at this head on origin/main
|
||
|
|
f9e6061b85 |
claude: claude-magpie runs Claude Code through magpie, a plain claude left on the user's account
baranwang on X (11-06): `claude` stays on the user's own Claude account, `claude-magpie` goes through magpie, and nothing is switched back and forth. `claude-magpie` runs `magpie claude run [args…]`. That writes a settings file of magpie's own, <config>/claude-launch/settings.json, connected as Connect connects Claude Code (the gateway, its key, the shared LAN key when sharing is on, the model, the tiers) and starts `claude --settings <file> args…`. Claude Code puts a --settings file's env and model over the user's settings.json, a claude.ai sign-in and the shell's variables (tried on 2.1.318), so ~/.claude/settings.json is never rewritten. ANTHROPIC_API_KEY and the cloud switches (Bedrock, Vertex…) are blanked in the file, so neither the user's file nor the shell can take a request past magpie. The file is the agent `claude#launch`, listed nowhere: the Agents page, Check and Notice see only the user's file. It is set again when the gateway moved or its key changed. - /model in a claude-magpie session saves to the user's settings.json (Claude Code never writes a --settings file). After the session a magpie model picked there moves into the launch file, for the next claude-magpie, and the user's file gets its model back. A Claude alias (sonnet) stays. - Claude Code's own one-time `opus` -> `opus[1m]` rewrite of the user's file (migration_opus_to_opus1m), which the launch file's 1M opus tier sets off, is undone the same way. Found in the end-to-end run below. - claude runs as a child so that can happen: on Unix a stopped child stops magpie too (^Z, fg; proc.WaitFollowingStops reaps it with WUNTRACED, as cmd.Wait can't see a stop), and claude's exit code is magpie's. On Windows magpie ignores Ctrl+C while claude has it. - The command: a launcher beside the `magpie` command. Settings › Command line (AddCLI) writes it; `magpie claude launcher [add|remove]` adds it for a command put there before. It is a `#!/bin/sh` exec of magpie's stable path, or on Windows a .cmd running "%~dp0magpie". A file by that name without "written by magpie" is never written over. - Docs: agent-wiring.md, and the start page in en/zh/ja. Run at this commit (rebased on origin/main |
||
|
|
6abacd46c3 |
update: an Intel magpie under Rosetta updates to the Apple silicon build
cdredfox on Discord saw magpie at 150% of a core. Their goroutine dump
shows AstrLink Guard running in Go (guard.geluRow) in a darwin/amd64
build on an 8-core Mac. That is the Intel build under Rosetta: no
CoreML, and Go's kernels are translated, several times slower than
Apple silicon's build. AppAsset and BinaryAsset named runtime.GOARCH,
so every update fetched the Intel build again, with no way off it.
- internal/rosetta: Translated (sysctl.proc_translated), moved out of
pii so the updater reads the same thing. pii's translated is now that
var; its tests still replace it.
- update: arch() is arm64 for darwin/amd64 under Rosetta. AppAsset and
BinaryAsset (the darwin CLI) use it. goos/goarch/translated are vars
that tests set.
Checked before switching: Stage downloads the zip, ditto unpacks it,
sameSigner wants the same team, and Install renames it over the
bundle. Nothing there reads the architecture, and the CLI's
InstallBinary is a rename too. An arm64 build runs natively on every
Mac that runs Rosetta.
- pii: Status.Rosetta, set on AstrLink Guard's Now() only. Privacy
Filter's pf-serve is already Apple silicon's there (target).
- GUI: Settings > Privacy's local model line, while AstrLink Guard runs
under Rosetta, says "On, slowly under Rosetta: the next update
installs magpie for Apple silicon" in place of "On, on the CPU". It
is the same one sub-line, with no new element. en/zh/zh-TW/ja/de.
Not done, as decided: skipping tool outputs for the model, or capping
its cores.
Run (on mote unless named):
- go test -count=1 ./internal/update ./internal/rosetta ./internal/pii:
ok. On WSL magpie-desktop: the same three, plus go vet of them, ok.
On Windows (xiaomi-gpu): -run "Rosetta|Asset|GuardNow" on update and
pii, ok.
- go vet ./... (darwin) and CGO_ENABLED=0 GOOS=windows go vet ./...: ok.
A Linux cross vet needs cgo for Wails, and WSL has no gtk4, so Linux
vet covered the changed packages only. gofmt -l: clean.
- node --test privacy-model, i18n-keys, i18n-en-no-cjk (chromium +
webkit, 5 languages, 1100/640px): 91 of 92. The new rosetta case
passed in every engine, language and width. The one red is "a
download is cancelled" (chromium). It passes alone, 1/1 at origin/main
|
||
|
|
a9a8f11e7f |
plugin, proc: a plugin host is waited for when it ends, not when its stdout does
acezan on Discord (v0.1.2819, Linux x86_64, a systemd service): after 47 hours, 57 <defunct> magpie-bun children of magpie, growing toward the unit's TasksMax until a restart. One cause: the plugin host's only cmd.Wait ran in host.read after its stdout reached EOF. A program a plugin started that kept a copy of the host's stdout (Bun.spawn given Bun.stdout, which host.js's spawn guard doesn't catch, #5063; a daemon left behind) held that pipe open past the host's end, so EOF never came, Wait never ran, the host was never marked dead, and every host stopped (Restart, a moved proxy, hostStale) stayed a zombie until magpie quit. Reproduced on Linux (WSL magpie-desktop, Bun 1.4.2): one more Z-state bun under the test process per Restart, 1, 2, 3, 4 over four rounds. The other cause, magpie web's restart to update leaving the running host behind its exec (#3285), is the next commit. - proc.Output (new, internal/proc/output.go) gives a command's stdout and stderr pipes of magpie's own and waits for the command the moment it ends. Its readers then have OutputGrace (2s) to read the last lines; the pipes are closed after that, which ends a read held up by a grandchild. startOn uses it, and a reap goroutine fails the host when its child ends. host.read no longer calls Wait. The tests' fake hosts (no child) keep cmd.Wait. - Every other start that wasn't waited for now goes through proc.StartReaped (Start, then go cmd.Wait()). Process.Release doesn't reap on Unix: codexrelay.Start (a relay that can end while magpie runs), tui serveInBackground, uninstall's startAfter, update's runAfterExit and OpenBeside (no Wait at all), and Windows' Reexec. - TestEveryStartedCommandIsWaited (internal/proc) parses every non-test .go file. In each function, an x.Start() on a command needs an x.Wait(), or x handed on (a call's argument, a struct field), and .Process.Release() is refused. It found exactly the sites above. - docs/subsystems/provider-plugins.md says how the host is reaped. Checked and left as they are (each waits): the StartTree callers (provider/install, library mcp_run and mcp_check, gateway claude_warmup and claude_subscription), pii/serve, provider grok and claude_signin, claudetui child_unix and wslread, awake, every other bun start (bun.go, bunupdate, store, dist use Output/CombinedOutput). Run at 82460a2f9 (on origin/main |
||
|
|
db7c576706 |
update: a list of the newest 40 says how many releases there are in all
sujingshen on X, v0.1.2606 to v0.1.2762: the update sheet read "40 个版本" for about 156 releases. The app keeps only the newest update.MostNotes (40) and counted the list it kept, so the line named the cap, not the gap. update.NotesBetweenTotal returns the count of every release in the range beside the capped list. /api/update/notes and /api/whatsnew send it as `total` when it is more than the list, and mergedNotes then reads "156 releases · the newest 40 shown, v… – v…" (en, zh, zh-TW, ja, de). Settings' What's new, where withWaiting puts pending releases first and cuts again, sends no total, since that count was of the installed ones. Run on mote at this tree: gofmt -l internal clean; GOOS=windows go vet and GOOS=linux go vet -tags nogui of internal/gui and internal/update ok (the cgo Linux vet needs gtk4/webkitgtk dev packages neither mote nor magpie-desktop has); go test ./internal/update ok (new TestNotesBetweenTotalPastTheCap: 56 releases keep 40 with total 56, 6 keep 6 with total 6); go test ./internal/gui ok except TestMainWindowCorners, the macOS 27 red of #3949. GUI files in chromium and webkit: update-notes-ask 16/16 (new: a list cut short says how many, en and zh), whats-new 4/4 (new case: 156 in all), whats-new-range 12/12, whats-new-failed 4/4, i18n-keys 4/4. Not tried: a real update from an install 156 releases back. |
||
|
|
e43d67d743 |
test(update): TestRelaunchOpenTriedAgain waits the relaunch out before cleanup (#3881)
The test's polling loop returned as soon as the fake open had written `opened`, but the relaunch's shell writes its note for that try only after open returns: under load the test could be gone and TempDir's RemoveAll with it while the shell was still appending that note to the log in the third TempDir, and the cleanup failed with "unlinkat .../003: directory not empty" (yetone, at machine load 50-95). Once the note for the open that went through is in the log, the shell has nothing left to write (it only exits), so the test now waits for it before returning, the way the gateway's tests wait out the writes of what they started (#1524, #1543). The cleanup assertion itself is untouched: it is what guards against a test leaving files behind. Run: with a shell made to write 20000 files into the log's TempDir between the open that goes through and its note, the test failed with the issue's "directory not empty" every time without the wait and passed 5 of 5 with it (the write-tail injection was for the runs only, not committed). Without it, -count=5 and the package's -tags nogui suite pass. Reviewed and landed as one batch of 12 commits (gua's #4593, #3269, #3881, #2887, #3289, #2718, #2855, Edward4226's #2718 key-path sibling, and four review follow-ups). Run for the batch, whose last commit's tree is 5d58a75f3: - Full suite before the rebase (base |
||
|
|
b81956189a |
update: a Windows update held by a scanner recovers instead of failing 416 on every try (mycf_711 on Discord)
mycf_711 (Win11 26200, 0.1.2364 -> 0.1.2404): the first try failed at the
trial start with "fork/exec ...\magpie.exe.new: The process cannot access
the file because it is being used by another process", and every try
after it failed at once with 416. Both confirmed on xiaomi-gpu with the
old code and a real handle held on the download.
Cause: something (often an antivirus) holds the staged magpie.exe.new.
CreateProcess fails with a sharing violation and that was reported as a
BlockedError (a policy block, which stops the clock checks). download()
dropped os.Remove's error, so the held, complete file stayed, and fetch
resumed it with "Range: bytes=<size>-", which no host can satisfy.
Changes in internal/update:
- download clears the earlier file through clearFile; a held file gives a
clear error ("another program has it open...") instead of being ignored,
and every other Remove error is returned, not dropped.
- fetch: a leftover that is already whole and matches the hash is used with
no request; one that is whole but of other bytes starts over; a 416 starts
over from zero once.
- binaryStage takes a fresh name (magpie.exe.new-*) when the usual one is
held, and stagedFiles/RemoveStaleNew find and clear those too.
- the trial start waits while the download is held (waitHeld, as the aside
moves do); still held after the wait is an ordinary error that keeps the
download, not a BlockedError.
These run on macOS and Linux too (the held case can't happen there, the 416
and whole-leftover cases can).
Run at 003e55115 (on origin/main
|
||
|
|
0ac26fb52d |
update: a magpie a package manager installed leaves updating to it (shuhai on Discord, AUR magpie-bin)
shuhai (Arch) installs magpie from the AUR's magpie-bin, which puts the desktop build at /usr/bin/magpie. magpie's own updater saw a folder it can't write and pkexec on the machine, so it downloaded the release and, on restart, replaced the package's file as root. pacman's database then no longer matched the file, and the next `yay` upgrade (magpie-bin lags the releases, 0.1.2342 against 0.1.2357 today) put an older magpie back. The two updaters fought each other. Now magpie asks first who owns the binary it runs from (update.PackagedBy): pacman's local database, dpkg's .list files, rpm (`rpm -qf`, only where /var/lib/rpm exists), a Homebrew Cellar path or /nix/store. Only a system path counts (/usr but not /usr/local, /bin, /sbin, /opt), with merged-/usr aliases, and packages named magpie* are looked at first. A packaged binary: - GUI: the update is shown as available with "pacman installed magpie (magpie-bin), so pacman updates it, not magpie: yay -S magpie-bin" (apt, dnf, brew likewise; Nix with no command). Nothing is downloaded, there is no Download or Install, the Update pill isn't lit, and /api/update/install does nothing (state available, stuck "package"). - `magpie update` says the same and exits 1 before downloading. This takes the place of the Homebrew-only check it had. An unpackaged magpie (~/.local/bin, /usr/local/bin, a file pacman doesn't list in /opt) updates itself as before. Run: - mote: go test -tags nogui -run 'Packaged|Homebrew|NotWritable|InContainer' ./internal/update ./internal/gui ./internal/cli ok; full go test -tags nogui -count=1 -timeout 45m ./... at |
||
|
|
244cf49371 |
update: a restart magpie makes by itself comes back as it was, without taking focus
xyxyxy_15591 (Discord #feedback) asked for a silent auto-update: once an update is in, the window shouldn't pop up. With "Restart automatically" (Settings, beside Version) on, the window state was already kept (a closed window came back as the tray icon only), and What's New stays quiet after an in-app restart. What did show was magpie taking focus: - macOS relaunched with `open -n` and no `-g`, so LaunchServices brought magpie to the front even when only the menu-bar icon came back; - with the window open, showHere's Focus() activated the app (every OS); - joining the Dock activated magpie, and with Dock on Wails' Regular policy activated it at launch. Now a restart magpie makes by itself (AutoRestart, `magpie update` from a terminal) writes a one-shot restart-quiet mark (read once, good for 10 minutes). The next start reads it: `open -n -g`, no Focus(), the Dock joined without activating, Accessory policy at launch and the Dock set afterwards. A restart the user clicks removes any mark and comes to the front as before. `open` gets -g also whenever no window is wanted. No new setting: zero-config, the existing switch is the one asked for. Run (base |
||
|
|
482e883142 |
update: a Windows magpie on the Desktop leaves no magpie.exe.new or magpie.com there
nianshou5 on Discord (#help, Windows): magpie.com and magpie.exe.new showed on the Desktop and came back after being deleted. Both were written beside magpie.exe: - magpie.exe.new is the update the GUI downloads as soon as it is out and swaps in at the next restart. StageBinary put it beside the program whenever that folder was writable, so it sat on the Desktop until a restart, and a deleted one was downloaded again by the next check. - magpie.com (#3737) is written at every start while the app's folder is on PATH, and Settings > Command line's Add puts that folder on PATH, so deleting it on the Desktop lasted until the next start. Now: - StageBinary downloads into magpie's cache, in a folder of this program's own (update/<hash of the exe path>), when a rename from there reaches the program's folder (renamesInto, a real probe: the swap must stay one rename on one volume). With the cache on another volume it goes into a hidden .magpie-update folder beside the program (FILE_ATTRIBUTE_HIDDEN on Windows). A folder magpie may not write is unchanged (cache, moved in as administrator). The stage folder is removed after the swap or a failed download. - At start RemoveStaleNew looks in every place a download may be, magpie.exe.new beside the program included, and removes one no newer than the running version (same bytes, or an older file version); a newer one stays, as before. - Settled (the installed copy opened from a Desktop/Downloads one) also removes the update downloaded for that one, which nothing will put in now. - In a download folder (Desktop, Downloads, a temp folder, as isDownloadFolder already says) a start only keeps an existing magpie.com up to date and never writes a missing one; Add still writes it. Any other folder on PATH is as before. A Desktop magpie.exe that opens the installed one (Settle) already wrote none. Run: - Windows (win-run, xiaomi-gpu, sandbox HOME from testenv), a repro test with the running test binary standing for magpie.exe on a Desktop on PATH: at origin/main |
||
|
|
a3b9dd1127 |
windows: the app opened from Downloads installs itself in Programs\magpie
lucky_eagle_38 on Discord: Windows magpie is one exe that lands in
Downloads, the user moves it around, and the `magpie` command came from
a magpie.com ("ms-dos" file) magpie wrote beside it there. They asked
for a fixed install folder, with the command coming from PATH.
Before: wherever the exe ran, the Start menu Magpie.lnk, App Paths,
Open at login (HKCU Run "magpie") and updates named it there. Settings >
Command line put that folder on the user PATH and wrote magpie.com (or
magpie.cmd) beside it, and EnsureCompanion kept writing magpie.com there.
Now (update.Settle, first thing in gui.Run): the desktop app run from
Downloads, the Desktop or a temp folder (an exe opened inside a zip)
copies itself to %LOCALAPPDATA%\Programs\magpie\magpie.exe, per-user and
with no admin. It puts that folder first on the HKCU PATH with its
magpie.com (cliPlace, with WM_SETTINGCHANGE as before) and opens the
copy (Forward waits for its MAGPIE_STARTED, then passes that on, so an
update restart waiting on the download isn't rolled back). The copy's
shortcut.Ensure re-points the Start menu lnk and App Paths. Its updates
replace the installed exe in place. The download quits.
- Run again: the download opens the installed copy. If its RT_VERSION
is newer than the installed one, it first goes in place of that copy
(InstallBinaryAside, as an update does). An older or unversioned
download never replaces it.
- Open at login: the Run value is re-pointed only when it named the
download (autostart.Repoint). Task Manager's StartupApproved off flag
is kept.
- Leftovers beside the download (update.Settled, in the installed copy):
- Removed: what updates moved aside (.old). Also magpie.com and
magpie.cmd, but only when magpie wrote them for that exe (comRuns
and shimRuns check the marker and target).
- Never removed: the download itself and any other file.
- EnsureCompanion writes no magpie.com beside a download that forwards.
- WebView2's profile is keyed by exe name. The old profile
(%APPDATA%\magpie-windows-amd64.exe) is kept through a webview-profile
note beside the install, which appdir.WebView reads. magpie uninstall
removes that noted profile too (only a folder directly in %APPDATA%
with an EBWebView in it).
Not moved:
- an exe in a folder the user chose (D:\Tools, a USB drive, the home
folder, Documents, a subfolder of Downloads);
- a portable copy (a data folder or .portable beside it);
- any copy run with MAGPIE_NO_INSTALL=1;
- CLI runs (only the desktop app installs).
Left for old users: the Downloads entry an earlier Command line put on
the HKCU PATH stays. The user may have added it themselves, and it now
comes after the install folder. Taskbar pins still name the download,
which opens the installed copy.
Run:
- Real run on xiaomi-gpu (Windows 11) as a throwaway local user,
through a scheduled task (the user is deleted now; its profile hive
was still held at cleanup and is removed on the next unload):
- Seeded with the real v0.1.2124 in Downloads, its folder on PATH, its
magpie.com, a Run value with the off flag, the lnk and App Paths on
it, a .old, a user's own magpie.cmd and notes.txt.
- Then ran release-built (make release-windows) v0.1.2000 from
Downloads with `tray`:
- Programs\magpie got magpie.exe 0.1.2000, magpie.com and the note.
- PATH is that folder first.
- Run, lnk and App Paths now name it. The off flag is kept.
- Downloads lost magpie.com and the .old and kept the exe, the
user's magpie.cmd and notes.txt.
- The download exited 0, and the installed copy ran.
- Again: forwarded, nothing changed.
- v0.1.2001 from Downloads: it replaced the installed 0.1.2000.
- The registry PATH's `magpie` is Programs\magpie\magpie.com, and
`magpie version` gives v0.1.2001.
- Ran a copy at ~\Tools\magpie.exe: it ran there and the install was
not touched.
- The installed copy's `magpie update` went to the real v0.1.2126
in place (magpie.exe.old aside).
- win-run (Windows): go test ./internal/update ./internal/autostart
./internal/appdir ./internal/shortcut ok. ./internal/gui has 5 reds:
TestGatewayHeldByAContainer, TestLodyImportHandoff,
TestImportStatusUnreadableIsUnknown, TestAionUiImportRow and
TestUpdateThatWontStart. They fail the same alone on origin/main
|
||
|
|
eed140c4d9 |
update: a Mac update no longer leaves a second magpie in Spotlight (#3965)
Stage unpacked the new app to /Applications/.magpie-update/app/magpie.app
and Install moved the old one to .magpie-update/old.app. LaunchServices
registers a folder ending in .app in /Applications within seconds, and
Install only deleted the folder, so Spotlight kept listing the gone path
as another magpie.
- Stage ditto's the zip (one top folder, magpie.app, checked against the
real v0.1.2119 zip: no FinderInfo bundle bit, no __MACOSX) into
.magpie-update/unzip and renames magpie.app to .magpie-update/payload
at once, then has lsregister -u forget the unzip path in case it was
seen in that moment. codesign verifies a bundle named payload the same
(checked on the real zip: verify ok, a tampered copy fails).
- Install and InstallAsAdmin move the old app to <stage>/old, and remove
filepath.Dir(staged), which is still .magpie-update (or the cache's
update folder on the admin path); renames stay on one volume.
- ForgetOldStaging runs once from the GUI's updater start, in a
goroutine: lsregister -u on .magpie-update/app/magpie.app and
.magpie-update/old.app beside the app and in ~/Library/Caches/magpie/
update. lsregister is /System/Library/Frameworks/CoreServices.framework/
Frameworks/LaunchServices.framework/Support/lsregister (present on
macOS 27.2); failures are ignored, a 10s cap, marker in magpie's cache.
/Volumes/magpie (an old DMG) is left alone.
Run at this head (base
|
||
|
|
5be581a1c3 |
gui: a magpie folder the user can't write gets a one-click Repair (YouWhat)
YouWhat on Discord (macOS): adding a custom provider failed with "mkdir ~/.config/magpie: permission denied". ~/.config wasn't the user's (a command run under sudo makes it root's), so magpie couldn't make its folder. The app still ran because reads of a missing file mean "none", but every save failed. The GUI saves showed the raw error; the background writes (usage, quotas, caches) dropped theirs. Now: - appdir.Blocked() names the folder that keeps magpie from writing its config or cache folder: the folder itself, or the first one above it when it doesn't exist yet. Only folders inside the home folder are named. Unix only; on Windows it is "". - /api/state carries configBlocked. A failed save whose error is a permission refusal comes back with code config_blocked. The window asks once a load, and again over the editor whose save failed. "Not now" returns to that editor as it was left. The tray panel doesn't ask. - Repair (POST /api/config/repair): a folder the user owns gets u+rwx with no prompt. Another user's folder is chowned to the user, through the system's password prompt (update.AsAdmin, the updater's: osascript on a Mac, pkexec on Linux). That chown is not recursive for ~/.config, so the other apps' folders inside it stay as they are; magpie's own folder is chowned -R, since everything in it is magpie's. magpie web shows no prompt; it names the sudo command instead. Data never moves: every reader keeps the one path, so nothing splits. - Words in en, zh, zh-TW, ja and de. - The core-script budget goes up by 1,112 bytes (app.js stays under its own), with no room added. Run (on mote via mote-run, at this tree, based on |
||
|
|
6b253dbb3f |
windows: magpie.com is written again only when the launcher changes, not on every update
lucky_eagle_38410 on Discord (#general, 10-28): every run of the command line wrote a new magpie.com. magpie.com is the console launcher from |
||
|
|
2afacd7d18 |
windows: a terminal waits for magpie, through a magpie.com beside the app (#3737)
The Windows app is linked with -H windowsgui so a double click opens no console, and PowerShell and cmd don't wait for a GUI program. The prompt came back before magpie printed, and `magpie plugin login`'s password keys went to the shell as well as to magpie (tom047784 / TomXPRIME on Discord, 10-27; the handle error in the same report was |
||
|
|
cc9d68ffd3 |
agent: Antigravity CLI in a WSL distro is found and wired
mimi001234 (Discord, #general): agy installed in a WSL distro never showed on the Agents page. wslKinds had no agy, so the distro probe never looked for it. agy is now a WSL kind (bin agy, dir .gemini/antigravity-cli), with the model field offered for a stopped distro too. agy takes magpie only from how it is started, and no magpie runs inside the distro, so a magpie pick writes an agy shell function into the distro's own profiles: .bashrc, plus .zshrc or fish's config.fish when the login shell in the distro's /etc/passwd is zsh or fish. The function reads settings.json's model at run time. It adds --model only for a magpie model the user didn't name themselves, and sets GOOGLE_GEMINI_BASE_URL to place.gw() (the NAT address, never 127.0.0.1) and GEMINI_API_KEY to the distro's WSL key. Default removes the block. Check flags a function whose address has moved, and Sync rewrites it. update.ShellFunction gained ShellFunctionAt, DropShellFunctionAt and ShellFunctionInAt for profiles given by path (fnProfile is now ShellProfile). This machine's own agy function is unchanged. The restart notice is translated (de, zh, zh-TW, ja). agent-wiring.md and reference.md are updated. Run at |
||
|
|
9ae7912210 |
agent: plain agy starts Antigravity CLI on magpie in a new terminal
agy takes magpie's gateway, key (GEMINI_API_KEY, GOOGLE_GEMINI_BASE_URL)
and --model only from how it is started, so a user on magpie had to copy
the launch command at every start (bestony on Discord). Now:
- magpie agy run [args…] execs the real agy with the env and --model when
agy's settings.json is on magpie's model (a --model/-model the user
gives wins), and runs agy untouched otherwise. On Windows agy is a child
through proc and its exit code is passed through. It refuses when "agy"
on PATH resolves to magpie itself. magpie agy env prints what run adds
(PowerShell's function reads it, since the desktop exe has no console).
- update.ShellFunction puts a function named agy in a marked block
(# >>> magpie agy >>> … # <<< magpie agy <<<) of each shell profile
cliShells finds: .zshrc (ZDOTDIR), the bash profile a terminal reads
(.bash_profile, or .bash_login/.profile on macOS when that is missing),
config.fish once its folder exists, and the PowerShell 7 / Windows
PowerShell profiles where the execution policy runs them. Only the block
is written, in place, temp-and-rename, CRLF and BOM kept; a profile that
can't be read is not written; only files inside the home are. The
function falls back to `command agy` when the magpie it names is gone.
- Set to a magpie model writes the block, stepping out takes it out (the
file comes back byte for byte), and Sync at start writes it for users
already wired.
- Notice, Launch tooltip and the connect panel say plain agy works in a
new terminal, with the command for a terminal open now. Strings in
i18n.js for zh, zh-TW, ja, de. docs/reference.md and
docs/subsystems/agent-wiring.md updated.
Run at this head (base
|
||
|
|
6335625a60 |
update: a download that breaks off is tried five more times, from where it stopped
AIMetaPhD on X: on Windows, 0.1.1615 couldn't download 0.1.1618;
GitHub's asset host dropped the connection ("EOF"). The download was
tried three times, two and four seconds apart, each time from byte zero,
and then it gave up. The error also carried the full signed redirect
URL, which the GUI showed.
Now a try the network breaks off (the connect, or the body part way) is
tried again after 2, 4, 8, 16 and 30 seconds. Each later try asks with
Range for the bytes still missing. A host that sends 200 instead has the
file written again from the start, and a 206 whose Content-Range doesn't
start where the file ends is refused. The SHA-256 from the feed is
checked over the whole file read back from disk, so the bytes from
earlier tries are covered. A failure that isn't the network's (a 404, a
checksum mismatch, a write that fails) is not tried again, and the file
is removed. The error is a NetError that names the file and the cause
("the download of magpie.exe.new broke off (EOF)"), never the address.
Release timing was checked and is not the cause. v0.1.1618's
magpie-releases release was created at 16:32:48Z, its assets were
uploaded from 16:36:13Z to 16:36:17Z, and it was published at
16:36:18Z. The feed reads only releases/latest, which skips drafts, and
needs SHA256SUMS, so it couldn't name 1618 before its files were there.
The URL in the screenshot is the asset host's redirect, which exists
only for an uploaded asset.
Run: go test ./internal/update ./internal/cli (ok); gofmt -l clean;
GOOS=linux and GOOS=windows go vet ./internal/update. New tests run on
httptest servers: a body cut mid-stream twice (resumed with
bytes=102400- and bytes=307200-, file and progress whole), a resume
with the wrong bytes (checksum fails, nothing kept), a connection hung
up before any answer behind a redirect to a ?sig=&jwt= URL (six tries,
and the error holds no URL), and a 404 (one try).
Broken by hand: without the Range header the resume test is red
(ranges "" "" ""); with the NetError keeping the url.Error the address
test is red (the signed URL in the text); with three tries it is red
(tries = 3, want 6).
Not tried: a real self-update on this machine or the Windows box, or a
real cut connection to GitHub. The China mirror and the user's
UpdateMirror get the same Range header; a mirror that ignores it sends
200 and the file is written again from the start.
|
||
|
|
4a33cf0a98 |
update: a Stable channel in Settings → About, and magpie update channel
ssharpcc on X reads every changelog before updating, for fear of a ban
when behind, and with many releases a day that is a lot of reading.
Settings → About → Update channel (zh: 更新渠道, 稳定版 / 每个版本) picks
Every version, the default and today's behaviour, or Stable: one version
a week, the newest that had been out three days as the week began
(Monday 00:00 UTC), and an urgent release at once. usemagpie.ai chooses
it from the release list (the previous commit); a release is urgent when
a line of its notes starts with "**Urgent release:**", which
magpie-releases' release run writes from an `Urgent: <why>` trailer
(magpie-releases 73f6cff).
- settings: updateChannel, "" or "stable"; anything else is refused.
- update: on Stable the feed is asked with channel=stable; What's new
shows every release since the installed one (up to 1500) instead of
the newest 40, so a week's notes read as one list.
- gui: the row is segs, never a <select>; a save that doesn't send the
channel keeps it; switching asks the feed again at once, and a
download from every version newer than Stable's pick is dropped,
never restarted into. What's new's notes are kept per channel.
- cli: magpie update channel [stable|every] ("all" too), and it says
which with nothing after it.
- docs: reference.md's Update channel (the rule and the marker); the
privacy pages (en, zh, ja) name ?channel=stable on /api/latest.
The full Go and GUI suites were not run: the disk was at 3 GB free and
other sessions had GUI suites and a 45-minute gateway run going the
whole time.
Run, at this tree before the rebase:
- gofmt -l (clean); go vet on darwin, GOOS=linux -tags nogui and
GOOS=windows for ./internal/update/... ./internal/cli/...
./internal/settings/... ./internal/gui/.
- go test -count=1 ./internal/update/... ./internal/cli/...
./internal/settings/...: ok. ./internal/gui -run
'TestUpdateChannelSwitch|TestWhatsNewKeyedByChannel|TestCoreScriptBudget':
ok (the app.js budget passes).
- GUI, chromium and webkit: update-channel (22: en, zh, zh-TW, ja, de at
900 and 420 wide: default lit, Stable saved, kept by another save,
kept over a reload, Every saved back, no click scrolls, no sideways
scroll at 420), i18n-keys, gui-ja, gui-de, gui-zh-tw and every
update-*.test.cjs: 253 of 253 pass.
- The live feed: /api/latest?channel=stable answers 0.1.1327 (out
2026-10-22 21:55 UTC, the last before Friday 10-23 00:00) with 15
assets after the first real cron run filled the ledger (400 releases
back to 10-10); /api/notes 0.1.1200..0.1.1327 gives 124 notes, none
empty (1213 and 1218 were never published).
After rebasing on
|
||
|
|
761904b5ab |
whatsnew: Settings' What's new can show this version and the 10, 20, 50 or 100 before it (Linka)
Linka (linkaww, Discord, 10-25): 希望「关于 - 更新内容」加个可选项,查看
「上次更新以来 / 当前版本前 10 / 20 / 50 / 100 个版本」的更新说明.
Settings › About › What's new now has a pill in its head (the app's
menu, sess-pick, never a native select): "Since the last update", the
default and what it showed before, or "This version and {n} before" for
10, 20, 50 and 100. The dialog shown by itself after an update has no
pill and is unchanged.
- site/worker.js: /api/notes takes limit=, the newest that many after
upto, so a request for 11 isn't answered with 100.
- internal/update: NotesBack(ctx, upto, n, lang) asks upto and limit
n+1; Back(notes, upto, n) keeps upto and the n releases before it,
newest first, Install sections stripped, empties dropped. It is not
capped at MaxNotes (40), which only Between keeps.
- internal/gui/whatsnew.go: /api/whatsnew?all=1&last=N, for N in
10/20/50/100 only (anything else is the default). Cached per language,
the longest range asked kept, and a shorter one cut from it, so
picking 10 after 100 asks nothing and a reopen asks nothing. A failed
fetch is unknown: the reply carries error and whatever range was had
before.
- app.js: openWhatsNew(b, last) and wnRange. A pick that fails keeps
the notes last shown, says "Couldn't load the release notes" with Try
again above them, and Try again asks the same range.
- The archive helpers (archivedCalls, headersPanel, downloadArchive,
archiveBodyPanel), used only by the Usage page, moved to
plugins/usage/page.js as
|
||
|
|
8c62702442 |
whatsnew: Settings lists every release up to the waiting update, not its notes alone
小八 on Discord (10-24): on 0.1.1398 with 0.1.1409 out, Settings › About ›
What's new showed 0.1.1409, then 0.1.1398 and older; 0.1.1399 to
0.1.1408 were missing.
Cause: openWhatsNew (app.js) took /api/whatsnew?all=1, which lists the
running version's notes (or those since the last upgrade), and put the
waiting update's own notes (/api/update's u.notes) on top. Nothing asked
for the releases between the running version and the update. The site's
/api/notes had them (checked live: after=0.1.1398&upto=0.1.1409 returns
all ten, 0.1.1407 was never released).
Fix: /api/whatsnew?all=1 now puts first, while an update waits (ready,
available, downloading, found), the notes of every release after the
running version up to it (withWaiting, through fetchNotes as the restart
dialog's update/notes has them), each marked pending ("Not installed
yet"); the site out of reach leaves the update's own notes, as before.
update.Note gets Pending. The page shows what the app sends, so
openWhatsNew no longer asks /api/update or merges (app.js 265 bytes
smaller). Not changed: the restart dialog (confirmUpdate) already asks
update/notes for the range; the popup after an upgrade lists after..now
through Between, which was right; the site's degraded path (API refused:
the Atom feed's newest 10 plus the last whole list) can still leave a gap
when more than 10 releases came out since the list was last whole.
Run (worktree at origin/main
|
||
|
|
2b4c0664ee |
update: the fake open in the relaunch test keeps -n on Linux
TestRelaunchOpenTriedAgain was red on ubuntu CI at
|
||
|
|
27a8255fd7 |
update: the Mac relaunch opens a new instance (open -n), not a reopen of the gone one (Linka on Discord)
Linka's log (Discord, macOS 27.0.1, v0.1.1308) shows the cause of the
"magpie stays closed after updating itself" report that molvqingtai also
hit with the screen locked. After the old process's "Termination
complete", open found LaunchServices still holding the gone app as
running ("Specified target process 41267 does not exist"), so it sent
that process a reopen Apple event (aevt/rapp) instead of launching the
bundle, and failed with -600 procNotFound ("LAUNCH: Launch failed in
CSUI"). The retries from
|
||
|
|
a95f0b83ff |
gui: a restart to update hands the gateway to the new version (xuanwo on X)
Before, a restart to update ended the gateway, so it waited until no agent request was in flight (#577). An agent busy for hours held the update back, and Restart now cut its replies off. On a Mac and on Linux the restart now starts the new version beside the old one and hands it the gateway's listening socket. The new version takes every new connection at once. The old one stops accepting, finishes the requests it has (up to 15 minutes, as `make dev` already gave), then quits. Nothing an agent sends is refused or cut short. How (docs/subsystems/gui-shell.md, "A restart to update hands the gateway over"): - internal/handoff, new, darwin and linux. The old magpie opens a unix socket in a 0700 temporary folder and writes handover.json (fresh for 2 minutes) in its config folder. The new one finds it, says Hello, and gets the listening socket by SCM_RIGHTS with the address, its pid and a callbacks socket. Only the same program (same path, same uid) is given it. When TMPDIR is too long for a socket path (sun_path is 104 bytes on a Mac), the folder goes in /tmp (sockDir). - gateway: Inherit/Listen serve on the socket given, and acknowledge once serving. HandOff gives the old one handedOffDrain (15m) instead of the 2s an ordinary end gives. A Claude Code run of the old magpie whose helper calls its tools on the port gets those calls passed back to the old one over the callbacks socket (forwardCallback, mcpCall, ownCallback). The bridge's turns are counted on their own (Busy.Bridge, BridgeLast). - gui: restartInto calls beginHandover (OpenBeside `open -n` on a Mac, StartBeside for the binary on Linux). On the new version's ack, the old one hides its menu bar icon, panel, window and Dock icon (Mac), ends its backend, waits for its requests, and quits. OnShutdown leaves Codex's failover, the thread port and the install to the new one, which serves the gateway they point at. - Never two on screen. Mac: the old one lets go of its instance lock just before giving the socket and takes it back if the handover fails, then hides on the ack. Linux: Wails holds the D-Bus name until exit, so the new one serves the gateway at once but puts its tray up only once the old pid has exited (awaitExit, 16m at most). Until then the old tray stays. - What a handover can't carry: the subscription bridge's Claude Code turns live in the old process, so the restart still waits for those (restartBusy = blocking(Busy, true)), along with turns parked on tools. Every other request is not waited for. The update badge, the Updates page and Settings' "Restart automatically" say so, in every language in i18n.js. - A handover that isn't made restarts as before: socket not opened, new version not started, no hello in 60s, no ack in 90s. Because the restart didn't wait for the requests in flight, it now waits for gatewayBusy to be idle (fallbackWait, 15m at most) before it quits and relaunches, so a failed handover never cuts a request. - The overlap. The instance lock is handled as above. Both processes write: the sticky routing is flushed before the hand (FlushSticks), and files go through the existing locked or atomic writes. Counters (RPM, concurrency) are per process for the overlap (gateway-routing Constraints). OAuth refresh: the previous commit locks Codex's and the ChatGPT API's refreshes across processes. The rest were already locked or don't rotate (providers-accounts Constraints). - Not changed: Windows (no SCM_RIGHTS; it restarts as before and still waits for idle, #577), `magpie web` (re-execs in place), and `make dev` (its own Handover). MAGPIE_NO_HANDOVER=1 turns it off. Found by the sandbox run, fixed here: in run 2 the sandbox's long TMPDIR made the socket bind fail ("bind: invalid argument"). The restart fell back at once, cut the stream at chunk 6 (curl exit 18), and 4 of 381 requests got no answer over ~2s. Two fixes: sockDir (/tmp fallback), and the fallback that waits for idle. Tests (each red when broken by hand or on the old code): - gateway/handover_test.go: TestHandedOverGatewayFinishesItsStream (drainFor without handedOff: "the old one ended with a stream in flight"; takeAck off: "the new one never said it serves"). TestToolCallOfTheMagpieBeforeGoesToIt (mcpCall forward off: 404; ownCallback forwarding off: 401). TestInheritedForAnotherAddressIsLetGo, TestCallbacksSocketServesOnlyToolCalls, TestBridgeTurnsCount, TestSameAddr. - handoff/handoff_test.go: TestHandOverListener, TestNoAckKeepsTheSocket, TestTakeOnlyAFreshOfferForThisProgram, TestCloseRemovesOnlyItsPointer, and TestOpenWithALongTemporaryFolder (red on the old Open: "bind: invalid argument"). - gui/handover_unix_test.go: TestRestartHandsTheGatewayOver, cross- process. The test binary re-execs as the new magpie. A stream through the old one finishes whole, requests during the restart are all answered, the next ones reach the new pid, and the old one quits only after its stream. On the old restart it is red: "quit with a reply streaming". TestHandoverNotMadeRestartsAsBeforeOnceIdle ("never says hello", "doesn't start") is red on the code before the fallback drain: "quit with a reply streaming" / "the restart didn't try to hand over". - gui/handover_test.go: TestRestartWaitsForWhatAHandoverCantCarry, TestHandsOverOnlyWhereItCan. - update/relaunch_open_test.go: TestOpenBeside, TestStartBesideWaitsForNothing. - GUI: update-wait.test.cjs (the handover wording on the badge and page), update-restart.test.cjs (Settings' description). Real run, Mac, sandbox (env -i, HOME and XDG_CONFIG_HOME in a scratch folder, a long TMPDIR, MAGPIE_ADDR 127.0.0.1:63249, MAGPIE_UPDATE_FEED pointed at a fake feed). The app is -tags production, ad-hoc signed, bundle id com.yetone.magpie.sbhandover, built as 0.1.9001 and 0.1.9002. autoRestart is on. A fake upstream streams 100 one-second chunks. The real app found the update, downloaded and staged it, and restarted with the stream in flight (run 3, at this change's tree before the rebase): - 18:31:43, pid 59833 serves. 18:31:51, the new pid 60477 serves; v1 logged "magpie 0.1.9002 (pid 60477) serves the gateway now". - Requests: 375, failed 0. 19 were answered by 59833, then 356 by 60477. - The stream got all 100 chunks, END and [DONE] at 18:33:24, curl exit 0, 92s after the hand. 59833 exited within 3s of the stream's end. Run at the pushed head (7a5bca443's tree, on origin/main |
||
|
|
f3eb92924e |
update: the Mac relaunch starts the bundle's program when open never works (molvqingtai on Discord)
molvqingtai (Discord, 10-24): on macOS, magpie's restart after a self-update still leaves it closed on versions after |
||
|
|
fb23bca5c9 |
update: the Mac relaunch tries open again while it fails
molvqingtai's system log (Discord): v0.1.1314 updated itself at 00:43:49, the old process exited 0, and ~160ms later `open` of the bundle failed with -600 (procNotFound): LaunchServices still sent to the process that had exited (the screen was locked). runAfterExit ran open once, nothing looked at its status, and magpie stayed closed until a manual launch at 09:45. Relaunch now runs relaunchCommand: the same open, tried again after pauses of 0.5 1 1 2 2 3 4 seconds (13.5s, 8 tries) while it exits non-zero, and not again once it succeeds. The detached own-session shell (#2362) is unchanged. The new instance is not confirmed running beyond open's exit 0. Sibling, not changed: RelaunchBinary (Windows, Linux) starts the new binary itself while this one is still up, with no open after exit; on Windows with the old binary moved aside, startChecked already waits 20s for the new one to say it is up and puts the old back otherwise. ayu's "restart to update needs several clicks" is not this shape (candidates: the install held by another program, or the busy-gateway wait) and needs its own look. Tests (internal/update/relaunch_retry_test.go): a fake `open` first on PATH refuses its first tries with the -600 text. - TestRelaunchOpenTriedAgain: relaunchCommand after a gone pid opens on the third try. Old code: FAIL "open was tried 1 times and the new version never opened" (30.04s). - TestRelaunchOpenGivesUp: a refusing open ends after len(waits)+1 tries; one that works on the second is not run again. Broken by hand (no `&& exit 0`): FAIL "open tried 4 times, want 2". - TestOpenWaitsTotal: waits add to 10-15s. Broken (0.5 1): FAIL "waits add to 1.5s". Real open: the same loop with /usr/bin/open on a scratch .app that appeared after 2s failed 3 times ("does not exist", exit 1) and opened it on the 4th, the app got --args tray. Record for this push: 13 commits on origin/main |
||
|
|
86254d4049 |
tests: an unreachable upstream is 127.0.0.1:1, not a closed server's port
TestCodexOwnModelUnreached went red on ubuntu CI at |
||
|
|
40dee51751 |
update: on Windows a download an antivirus holds is waited for up to 30s, and a restart tried again doesn't trial-start it again (白菜 on Discord)
白菜 (Discord #general, 10-19): with magpie on the Desktop, every click on Update says it is restarting and then offers the update again; clicking again never gets it in, only a fresh download from the site does. Cause, as far as could be shown: the install starts the download suspended first (canStart, #894). An antivirus that checks a program as it starts holds the file a while after, and the move into place gave up after asideWaits' ~3s (#2272's fix). The swap failed, the old exe was put back, the state stayed ready and the pill said 更新失败, with the reason only in its tooltip. A click again ran the trial start again, so the antivirus held the same file again and it failed the same way every time. Change: - moveIn and moveAside go on trying, at the last pause (1.5s), while Windows says the file is held open (errors 32/33), up to heldFor (30s) from the first try. Other errors still stop after the short pauses. - InstallBinaryAside trial-starts a download once: the same path, size and mtime that passed isn't started again on a retry. A new download is. - A download still held after that says so ("another program still has the download open (often an antivirus checking it): let magpie through it…"), without the paths, in the version row and the pill's tooltip. It still unwraps to the *os.LinkError and the sharing violation. Tests: - TestMoveAsideWaitsOutALongHold (all OSes): 10 held tries then success. A permission error still stops at 4. - TestInstallBinaryWaitsOutALongHold (Windows): a real handle holds the download for 600ms against 2 short pauses. - TestInstallBinaryTrialsADownloadOnce (Windows): one trial for a retried download, a second for a new one, and the new error text. - Existing tests that hold a file for good set heldFor to 0. What was run: - Broken by hand (no wait past asideWaits, trial on every try): all three new tests red on the Windows box. TestMoveAsideWaitsOutALongHold is red on macOS too. Restored: green. - Windows box (10.0.26200, Defender on), cross-compiled update.test.exe in a sandbox USERPROFILE/APPDATA/TEMP: the whole internal/update package PASS (41 tests). - Real GUI on the box: a production build (v0.1.9000) at C:\Users\yeton\Desktop\magpie-windows-amd64.exe, a sandbox home, a local feed offering v0.1.9001. The .new was held open from PowerShell (FileShare Read) for 12s, then POST /api/update/install {when:now}: - origin/main's build: install failed, "rename … being used by another process", state ready, old process ran on; - this build: the new version started 1s after the hold was let go, and the Desktop exe's hash is 9001's. - The same setup without a hold, origin/main's build, worked: plain Desktop, and a Desktop folder named 白菜 测试 with "(1)" in the exe name. A non-ASCII path or the Desktop alone is not the cause. - gofmt clean. go vet ./... clean for darwin, linux -tags nogui and windows. - HOME=<sandbox> go test -timeout 45m ./... at load ~260-290: every package ok except these. - internal/agent and internal/gateway timed out at 45m. Already filed as #2544 and #2870. - internal/gui's TestSetAnswersWhileDevinAndProvidersHang (19.8s set under load) is filed as #1375. Rerun alone with the update, restart, install and relaunch tests: ok. - internal/update was rerun separately, because its source was swapped to origin/main's for ~1 min mid-run to build the comparison exe: ok. Not tried: - A real third-party antivirus (360, Huorong). The hold is injected. The user's version, antivirus and exact error are still unknown, and were asked for on Discord. - A OneDrive-redirected Desktop. |
||
|
|
c68270dae7 |
update: a Mac opened from the Dock or Finder comes back after "Update and Restart", not quits for good (#2362, danbo610)
update.Relaunch left the shell that waits for magpie to exit and then
runs `open` in magpie's own process group. launchd ends a job's process
group when its process exits, so the shell died with magpie and the new
version never opened.
|
||
|
|
c644d9f1d2 |
update: the downloaded binary is moved into place again while something still holds it after the trial start, not failed at once (#2272, JasonBuildAI)
InstallBinaryAside starts the download suspended (trialStart), ends
it, sets the running exe aside and renames the download over it. A
program that checks an executable as its process starts (an antivirus)
can hold the file a moment after the process has ended, and the rename
then fails with a sharing violation; the report says the first install
of every update failed this way. The rename (and the put-back of the
old exe on failure) now goes through moveIn, which tries again over
asideWaits (100 ms to 1.5 s) while Windows says the file is held
(errors 32/33), as moveAside already does for the running exe. Any
other failure is returned at once. The Windows CI step now runs the
trial tests too (TestTrialStart and the new ones).
What was run:
- Windows box (Windows 10.0.26200 x64, Defender real-time on, a
cross-compiled update.test.exe in a temp dir with a sandbox
USERPROFILE/APPDATA/LOCALAPPDATA/TEMP):
- TestInstallBinaryWaitsForHeldDownload (new; the download held open
for 150 ms): old update.go FAIL "rename ...magpie.exe.new
...magpie.exe: The process cannot access the file because it is
being used by another process."; new PASS (0.31 s).
- TestInstallBinaryRightAfterTheTrial (new; real trialStart, then the
install) and TestTrialStart pass on old and new code there.
- The whole update package passes; the CI pattern
^(TestInstallBinary|TestMoveAside|TestTrialStart) passes.
- Rollback tests now use 1 ms waits so a file held for good fails
fast.
- The real update, in a sandbox: v0.1.1243's magpie-windows-amd64.exe
run as `magpie update` twice in separate sandbox homes: both updated
to 0.1.1244, exit 0.
- macOS: gofmt -l clean; go vet darwin, GOOS=linux -tags nogui,
GOOS=windows clean; go test -p 4 ./... (see the last commit of this
push for the result).
Not reproduced: the hold itself. On this box the real trial-then-
install path succeeded every time (10/10 with a 12 MB exe, 10/10 with
a 74 MB magpie.exe, 2/2 real updates), and origin/main's TestTrialStart
passed 3/3. The fix is verified with an injected hold, not a real
antivirus one.
|
||
|
|
fbb7e2cbd4 |
gui, update: Settings' Restart automatically restarts into a downloaded update once no agent request is in flight (#2096, xiaozhu1337)
#2096 asks for a setting that installs and restarts whenever an update is there. Settings > About gets "Restart automatically" (Off/On), off by default: a restart ends the window, and whatever an agent sends during it waits for the gateway to come back. When on, and Automatic updates is on, the updater's minute loop sees a "ready" update and starts the same idle wait the Install-when-idle button uses (waitIdle: 10s with nothing in flight, at most 1h). Cancelling that wait from the GUI skips that version, so the next one is restarted into again. The app (window or tray) and `magpie web` are covered; serve and daemon have no in-process updater and are not. On the Mac, a restart the app made by itself reopens to the menu bar icon only (`open … --args tray`) when no window was shown, rather than popping a window up unasked (update.Relaunch takes a window flag; relaunchOpen builds the command). With Automatic updates off the row is dimmed and reads "While automatic updates are on", like Check every. Run: - go test: internal/gui (-tags nogui, full package, 273s), internal/update, internal/settings, internal/cli — ok, with set -o pipefail. - New: TestAutoRestartWaitsForIdle, TestAutoRestartNeedsAReadyUpdate, TestAutoRestartCalledOff, TestRelaunchOpen. - Broken by hand: without autoTick, WaitsForIdle and CalledOff fail; without the autoSkip assignment, CalledOff fails; restarting without the idle wait fails WaitsForIdle and CalledOff; without prefsKeep's autoRestart, update-restart.test.cjs fails 11 of 11. - gofmt -l clean; go vet and go build for darwin, GOOS=linux -tags nogui and GOOS=windows on internal/gui, update, settings, cli. - GUI: new update-restart.test.cjs, chromium and webkit, 1100 and 420, en/zh/zh-TW/ja/de (22 pass, twice); update-*, i18n-keys and settings* in both engines: 253 pass, 0 fail. - Found on the way, filed as #2134: in WebKit at 420, turning Automatic updates off scrolls a view at its top by ~2px (the Version row's sub grows). The test checks the clicked control holds still instead. Not tried: a real update or relaunch (no real install was touched), the tray-only reopen on a real bundle, Windows/Linux restarts by hand. |
||
|
|
fa44fde461 |
netproxy: a proxy's user and password stay out of every log line, error and status that names it (#1886)
What: netproxy.Redact is the one place a proxy address is made fit to show. It is the rule |
||
|
|
6876125a19 |
agent, library: an npm agent or winget's RTK under Program Files updates after Windows' administrator prompt, and says why when it can't (新v学员 on Discord)
On Windows the official Node.js installer leaves npm's global prefix at C:\Program Files\nodejs, which only an administrator can change. magpie runs as the user, and writable() on Windows always said true, so the Agents page offered the update and npm failed with EPERM (mkdir ...\node_modules\@scope), with nothing saying why. The same user then reported RTK and other actions needing elevation all failing, and asked for a setting to run magpie as administrator. There is no such setting: an elevated magpie would write the agents' configs as the administrator, couldn't start with Windows without a UAC prompt at each login, and widens what can go wrong. Instead each action that needs an administrator asks Windows for one, alone. - agent: writable() on Windows makes and removes a file in the folder (update.Writable) instead of always saying yes. An npm CLI in a folder the user can't write in is still offered on Windows, marked Admin, and its update runs through update.RunElevated, never as the user. Elsewhere (/usr/lib, would want sudo) nothing is offered, as before. - update: RunElevated (Windows) runs the command through ShellExecuteEx "runas" on a .cmd script that sets the env that differs from an elevated process's own plus PATH, cds to the folder, and sends output to a log read back; the exit code comes from GetExitCodeProcess (a non-zero one is update.ExitError, for its code). A declined prompt is ErrCanceled; no prompt to be had is the new ErrNoAdmin. Other systems: CanRunElevated false. - library: RTK installed by winget for every user (under Program Files) is upgraded through the same prompt when only an administrator can change rtk's folder; the card's Upgrade title says Windows asks first. Install, and an upgrade whose folder looked writable, run winget as the user and go through the prompt only when winget answers 0x8A150019 (command requires admin). winget's codes from the elevated run are read as before (0x8A15002B: no newer RTK, no failure). - A declined or impossible prompt is agent.AdminError (Via npm or winget); the GUI answers it with code needs_admin and says, in the reader's language, what needs an administrator and what to do: try again and allow it, or run the command in a terminal opened as administrator, and for npm also moving npm's prefix (npm config set prefix "%APPDATA%\npm") and reinstalling. - Install another agent: its npm commands note when npm's prefix (npm prefix -g, memoized) is such a folder. - Checked, not changed: autostart uses HKCU's Run key, no admin needed; magpie never runs npm uninstall; plugins install into magpie's own folder with bun; agent CLIs update only on a click; RTK's PATH fix writes HKCU's Environment and rtk init -g the user's own agent folders; the library's only other exec is the MCP server check. Run: - go test -tags nogui ./internal/agent ./internal/update ./internal/library (and the full ./... under the lock). TestNPMUpdateNeedsAdmin fails with the admin branch removed and with runAdmin bypassed; TestRTKUpgradeAsksForAdmin and TestRTKInstallRetriesAsAdmin fail with runRTKInstaller never elevating (checked by hand). - gofmt -l; go vet (darwin), GOOS=linux and GOOS=windows go vet. - GUI, Chromium and WebKit: cli-update-admin (en, zh), library-rtk-admin (en, zh exact; ja, de, zh-TW translated, no npm advice; fails with the old Upgrade title), library-rtk-upgrade/-path/-nohook/-gain, gui-ja, gui-de, gui-zh-tw, cli-update, i18n-keys. - Windows box (10.0.0.132): TestWritableSeesDeniedFolder passes, and fails on the old writable(). A portable Node 22 with Program Files' ACL (Users RX, Administrators F): as a non-elevated token (runas /trustlevel:0x20000) npm install -g failed with the reporter's EPERM, Writable said false, and dsh's CLI() said Via npm, Admin true; elevated it said Admin false. RunElevated from the elevated ssh session installed @deepseek-ai/dsh into that folder for real, and a missing version came back as exit status 1 with npm's ETARGET output. The library's RTK tests ran there too (TestRTKInstallRetriesAsAdmin passes; the shell-fake ones skip on Windows). - Not tried: the UAC prompt itself, allowing or declining it, as nobody sits at the box; the ErrNoAdmin path on a real system; a real machine-scope winget RTK (none is installed on the box). |
||
|
|
9bad11449b |
proc, update: an agent installed in a folder only fish's config adds is found when the terminal opens fish but the login shell is zsh or bash (John on Discord)
John on Discord: 二进制文件没有从用户环境变量找到,我终端环境使用的fish. The desktop app gets launchd's PATH and asks the login shell ($SHELL) for its own. fish isn't a POSIX shell, so many keep zsh or bash as the login shell and have the terminal open fish (its profile setting, or exec fish from .zshrc). magpie then asked only zsh, and a claude or codex in a folder config.fish adds (fish_add_path, set -gx PATH) wasn't seen. The suspected cause, fish joining "$PATH" with spaces, isn't it: PATH is a path variable in fish and is joined with ':' in double quotes. Checked with real fish 4.9.3 (macOS), 3.6 and 4.0.2 (Debian, Docker) under -ilc with the probe's printf and \0: PATH whole, the variables in place. With SHELL=fish the old code already found the agent. - shellEnv asks fish and nushell too, in parallel with the login shell, when they are installed and their config folder exists (each makes it on its first run) and they aren't the login shell. Their PATH folders come after the login shell's; a variable of agentenv.Vars the login shell leaves empty is taken from them. - proc.FindShell finds a shell in the system's, Homebrew's, MacPorts', Nix's, ~/.local/bin and cargo's folders, then /etc/shells, then PATH. Settings > Command line (update.installedShells) uses it too, so a fish from MacPorts or Nix is listed there as well. - The shellProbe comment now says why fish's "$PATH" is right. Tests: TestShellEnvAsksFishBesideLoginShell (a fake fish answering with the bytes real fish 4.9.3 printed) and TestShellEnvRealFish (real fish, skipped where it isn't installed) fail on the old shellEnv: PATH = "/from/zsh:/usr/bin:/bin", want the login shell's first and fish's folder after PATH = "/usr/bin:/bin", want fish's ".../fish bin" in it TestShellEnvLeavesUnusedFish and TestShellEnvFishLogin cover fish with no config and fish as the login shell. Run: internal/proc shell tests on macOS with the downloaded fish 4.9.3 and on Linux (golang:1.26.8 + Debian fish 4.0.2) all pass; go test ./... under a temp HOME: all pass except gateway (10m timeout under load; the failing TestClaudeUnloadableSessionStartsAnew passes alone) and gui TestOTelPreferencesAPI (TempDir cleanup race, passes alone -count=3), neither touching this code; gofmt -l clean; go vet and GOOS=linux, GOOS=windows go vet on internal/proc and internal/update clean. Real use: a sandbox magpie (go build -tags dev, own HOME, ports 3486/3487, launchd-like PATH=/usr/bin:/bin:/usr/sbin:/sbin, SHELL=/bin/zsh with no .zshrc, fish at ~/.local/bin/fish, a fake claude only in a folder config.fish adds with fish_add_path): the old build reports no claude in /api/agents/cli and /api/state; this one finds it (version 2.1.99 of the fake). With SHELL=fish both builds find it. |
||
|
|
e5f04f38e8 |
plugin: a plugin on a pre-release whose release is out shows the update on its row, as the Plugins dot already did; versions are ordered as semver orders pre-releases, in Go and in the page
The Plugins dot comes from update.Newer, and the Installed rows (chip,
Update, Update all) from plugins.js's own newer(). They disagreed:
- newer() read only x.y.z, so 2.0.0-beta.1 with 2.0.0 out had the dot
and no row to update it from. Real case: opencode-antigravity-auth,
whose latest is 1.6.0 after 1.6.0-beta.0..2.
- update.Newer compared pre-releases as strings, so 1.0.0-beta.10 came
before 1.0.0-beta.9 (and 1.6.0-10 before 1.6.0-9): a missed update,
and the other way round, an "update" to an older beta.
- update.Newer didn't parse build metadata, so 1.0.1+build.1 was never
newer than anything.
Both now order as semver §11: no pre-release comes after any;
identifiers compared one by one, numbers as numbers, a number before a
word, and a shorter list before a longer one it starts. Build metadata
is ignored. A version that isn't x.y.z is never newer, as before.
Tests:
- internal/update TestNewer gains the pairs. On the old Newer 4 fail
(beta.10/beta.9 both ways, 1.6.0-10/-9, +build).
- internal/gui/tests/plugin-prerelease.test.cjs: seven installed
plugins, the dot's waiting list as update.Newer gives it, and each
row's chip and Update button, plus the Update all count, must match.
On the old plugins.js it fails at "v2.0.0 out" in both engines. No
strings change, so it's English only.
Reproduced in a sandbox HOME with the real package:
`magpie plugin add opencode-antigravity-auth@1.6.0-beta.2`, then Check
for updates. Before: /api/plugins/updates listed it, and the Plugins
nav had the dot, but the row had no chip and no Update, and there was no
Update all. After: the row shows "v1.6.0 out", Update, and Update all (1).
Update all then installed 1.6.0 and the waiting list emptied.
Run: gofmt; go vet -tags nogui for darwin, linux and windows on
internal/update, internal/plugin, internal/gui and the root package; go
test -tags nogui of the root package, internal/{gui,plugin,provider,
stats,update} under a temp HOME; GUI tests plugin-prerelease,
plugin-updates, plugin-card-update, plugin-check-updates, plugin-market,
plugin-release, plugin-git and plugin-local in Chromium and WebKit.
|
||
|
|
599d784f59 |
library: magpie-image runs this computer's magpie, whatever path another computer or an old install saved (#1439, dawn1095)
magpie-image was kept in library.json with one computer's magpie by full path (os.Executable at install). A WebDAV sync carried C:\Users\...\Downloads\magpie-windows-amd64.exe to a Mac (and a Mac's app to Windows), and a magpie moved out of Downloads left its old path behind: the Library page said it couldn't start, and agents were given a program that isn't there. - heal (self_here.go): a server that is magpie's own -- `mcp ...` run by a program named magpie (magpie, magpie.exe, magpie-<os>-<arch>[.exe]) -- whose program isn't an existing absolute path here is pointed at this magpie, as the library is read (load) and after every change (so a bundle Put from another computer is healed before it is written into the agents). Every agent writer, project MCP files, the WSL side and CheckServers read through load, so all of them get it. A magpie program that does exist here (another build) and any server run by another program are left as they are. - Collect carries magpie's own server as plain "magpie": two computers with the same library carry the same bundle, so davsync's library hash matches and a sync doesn't write one's path over the other's. - The path given is update.Program (exported cliProgram): the AppImage rather than its mount, Homebrew's opt link rather than the Cellar. - TestWSLMagpieImage now says which magpie this (simulated Windows) computer runs. Verified: - New tests: TestOwnServerFromElsewhereRunsThisMagpie (Windows path read on macOS, a Mac path, an exe moved out of Downloads, a bare "magpie"), TestUsersOwnServerStaysAsItIs, TestCarriedOwnServerIsEachComputersMagpie. Broken by hand five ways (heal off; no heal in change; no marker in Collect; ownServer matching every server; existing magpie builds not kept) -- each went red with a FAIL naming the behaviour, green restored. - gofmt -l clean; go vet -tags nogui ./...; GOOS=linux and GOOS=windows go vet (library, update, davsync); go build, GOOS=linux -tags nogui and GOOS=windows builds; go test -tags nogui ./... green in a sandbox HOME. - Sandbox app (own HOME, ports 3561/3562) seeded with a library.json holding the reporter's Windows path for magpie-image plus a user's own missing Windows tool: on start library.json, Codex's config.toml and Claude Code's .claude.json got the running binary; /api/library/mcp/check answered magpie-image ok with 3 tools, the user's server unchanged and notfound. Not verified: on the Windows box, or a real two-computer WebDAV sync. |
||
|
|
06420a7121 |
tests: a fake program is a file macOS has already let run (testenv.Program), so a fake's first start no longer eats a test's wait under load
macOS checks a newly written executable before its first exec: 0.27s alone, 2-5s while other new programs start (a go test ./... starting its test binaries). The same file again takes 0.009s, and the pass is kept across a rename and an in-place rewrite. |
||
|
|
90b1ac7956 |
update, gui: Add to PATH on Windows writes a magpie.cmd beside an app not named magpie.exe, so the site's magpie-windows-amd64.exe runs as magpie in a new terminal, and says so (#942, mintonight)
Add to PATH put the portable download's folder first in the user's PATH, but a terminal looks for magpie by that name only, so the command was never found. cliPlace now writes magpie.cmd beside a program not named magpie.exe: it runs %~dp0<the program's name> %*, which an update keeps, since it replaces the program where it is under its name. ReadCLI reads that magpie.cmd as this app (shimRuns), and the GUI says, in Add's tooltip, the row and the status, that magpie.cmd runs magpie-windows-amd64.exe. Going through cmd also makes PowerShell wait for the GUI-linked program and gives it the console. TestCLIShim and cli-path.test.cjs's new case fail without the change. |
||
|
|
9ca64d104f | update, gui: a new version Windows won't start is never left in place — tried before it goes in, and a restart into one that doesn't say it is up puts the running one back; that version isn't downloaded again by the clock, and Settings › About › Version says why (#894, hisiling) — on Windows 11 with Smart App Control on, the update put the new unsigned exe in place of the running one and restarted into it; CodeIntegrity (3033/3077) refused it, magpie never started again and the working version sat in .old. Now, on Windows, the downloaded exe is first started suspended with no window and ended at once (Windows checks a program when its process is created), and one refused stays out: the running exe isn't moved. At the restart the new process is given MAGPIE_STARTED, a file it writes first thing (AwaitPredecessor); the old one waits up to 20s for it and, if the start fails (ERROR_SYSTEM_INTEGRITY_POLICY_VIOLATION 4551, 1260 or any other), the new process quits before saying so, or it says nothing in time (then it is ended), puts the running exe back over the new one (the new one renamed .blocked if it can't go) and keeps running instead of quitting; nothing notes it as updated in the app. The version is noted in the config folder (update-blocked.json, this machine's only, never synced; gone once a version at least as new runs); the clock's checks leave it alone and show why, a Check clicked downloads and tries it once more. Settings › About › Version: for an application control policy, "0.1.x didn't start on this computer: Windows' Smart App Control (or another app control policy) blocked the new version, which isn't signed. magpie stays on 0.1.y. Download it and run it yourself, or turn Smart App Control off and check again", else the reason, with Download and Check; the error in full on hover. en/zh/ja/de. A user who double-clicks the refused exe is refused by Windows before magpie runs; only signing helps there. TestRelaunchRefusedPutsBack (4551 at the start), TestRelaunchSilentPutsBack (no word in time, killed; quit at once), TestRelaunchReportedStays, TestReportStarted, TestBlockedNote and TestUpdateThatWontStart (the restart doesn't quit, the note, the clock not downloading it again, a Check that does) are new and fail without the change; on Windows TestInstallBinaryRefusedStaysOut, TestTrialStart and TestStartCheckedPutsBackForReal (real processes: not a program, quits at once, runs on silent) pass on the Windows 11 test box with the whole internal/update package (Smart App Control itself isn't on there, so the refusal is simulated). update-blocked.test.cjs (Chromium and WebKit, en and zh: the reason and both versions, full error on hover, Download opens the release, Check downloads, the other reason, no select, no scroll, no left border) fails without the change; update-check, update-mirror, update-auto, update-wait and update-download-percent pass in WebKit; click-scroll's request-list case fails now and then the same on main. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass. | ||
|
|
dab887db57 |
update, gui: Settings › About › Download source sets the update mirror, and a download that failed through it offers GitHub (#893, M3chD09) — the mirror updates could come through was only magpie update mirror in a terminal, and the GUI never said where updates came from or that a failed download was the mirror's. About now has a Download source row: GitHub, or the mirror set (the same UpdateMirror setting the CLI writes); Use a mirror… takes a full https:// address (http, a bare host or a malformed one refused, with the reason in the row and the draft kept), Change edits it, Use GitHub takes it away in one click; Enter saves, Esc cancels, no click scrolls. POST /api/settings/update-mirror sets it; the Settings page's own save keeps it. A download through the mirror that doesn't answer, answers other than 200, or sends a file whose SHA-256 isn't usemagpie.ai's feed's is an update.MirrorError (never installed, the file removed, as before); /api/update's error carries the mirror, and the Version row says the download failed through that mirror and offers Download from GitHub, which takes the mirror away and downloads again. magpie names no mirror or CDN of its own. en/zh/ja/de. TestMirrorFailuresAreTheMirrors (tampered, 404 and closed mirrors each the mirror's, no file kept; a direct failure no mirror's; CheckMirrorURL) and TestUpdateMirrorSetting (set trimmed, http/bare/ftp/empty-host refused, Settings save keeps it, off, an updater failing through a 404 mirror reports it with retry, a new check clears it) are new; update-mirror.test.cjs (WebKit, en and zh: GitHub shown, http refused with the reason, https saved with Enter, Use GitHub posts "", a failed download through the mirror offers GitHub, which posts "" then update/install; no select, no left border, no scroll) fails without the change; update-auto, cli-path, cli-behind, settings-sections and click-scroll pass in WebKit. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass.
|
||
|
|
d6daa40ce3 |
update, gui: Settings › About › Command line says what magpie runs in a new terminal and adds it (PAMI on Discord) — the app downloaded from the site, and every Windows one, left terminals without the magpie command, and nothing in the GUI said whether it was there. A Command line row now asks each shell installed (zsh, bash, fish and the login shell; PowerShell and cmd on Windows) for its PATH and says, with a dot each, whether its magpie runs this app, another copy (with that copy's version, read from its .app's Info.plist or Homebrew Cellar folder, never by running it), or none. Add to PATH links this app's program (Homebrew's opt link, the AppImage) into the folder on the default shell's PATH whose magpie runs first, else ~/.local/bin or the like when on PATH, replacing another copy there as install.sh's ln -sf does; on Windows it puts the app's folder first in HKCU\Environment Path and broadcasts WM_SETTINGCHANGE. A shell whose PATH lacks that folder gets its own button naming its profile (~/.zshrc, ~/.bash_profile on the Mac or ~/.bashrc, fish's config.fish), which links into ~/.local/bin and adds that folder with one marked line, once; no profile is written otherwise. A translocated or disk-image app is told to move first and gets no button. It says new terminals take the change (on Windows: new PowerShell/cmd windows, restart Windows Terminal). GET/POST /api/cli; en/zh/ja/de. TestCLIOnPath (temp HOME, stubbed shells: link, fish profile once, a shadowing copy replaced, no folder → zsh's profile kept and appended, an unknown shell refused, plist version, translocated refused) and TestPathFirst are new; cli-path.test.cjs (WebKit, en and zh: per-shell dots, Add posts {} and turns green, fish's button posts fish alone, Windows lists PowerShell and cmd, translocated gets no button, no scroll, no select, no left border, translations) fails without the change; cli-behind and update-auto pass. Not tried on a real Windows machine. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestOTelWholeWaterfallFallback and TestDevinSignedInOnlyInMagpie failed once each under load and pass alone).
|