57 Commits
Author SHA1 Message Date
yetone 69233d6bcf docker: the image has npx, node, npm, uvx and python for the Library's MCP servers
Passings_z on X: in magpie's Docker image, adding Chrome DevTools' MCP
server from the Library said "npx not found". The runtime stage is
debian:12-slim with ca-certificates and curl only, and the Library's
servers run in the container (gateway mode keeps Library's MCP servers
and the router), so every featured entry but the remote ones failed the
same way: npx for chrome-devtools, playwright, filesystem, memory,
sequential-thinking, brave, firecrawl, tavily and everme, uvx for fetch,
git and time, and the registry's npx/uvx entries.

The image now copies in Node 24.22.3 (node, npm, npx, from the official
bookworm image, matching Debian 12's glibc) and uv 0.13.7 (uv, uvx, from
astral's image). python and python3 are a two-line shim onto uv's own
Python, which uv downloads into the volume on first use (UV_PYTHON=3.14).
UV_PYTHON_PREFERENCE=only-managed keeps uv from taking the shim as an
interpreter: without it uvx recursed and hung looking for one.

Size (docker image inspect / du -sxm / as root):
  origin/main  74,636,782 B compressed, 190 MB on disk
  this         142,667,379 B compressed, 370 MB on disk  (+68 MB, +180 MB)
node is 127 MB of it, npm 19 MB, uv and uvx 43 MB. Bun in place of npx
was weighed and left: agents in the container read PATH themselves, and
Bun's Node compatibility isn't every server's.

The image still has no browser (Chrome would be ~300 MB more for every
user). Chrome DevTools' and Playwright's servers start, list their tools,
and every tool then fails: "Could not find Google Chrome executable for
channel 'stable' at: /opt/google/chrome/chrome" (seen in the image). The
check now reports such a server, run by npx/bunx/pnpx in a container with
no /opt/google/chrome/chrome and no option pointing it at a browser
(--browserUrl/-u, --wsEndpoint, --executablePath, --channel,
--autoConnect; --cdp-endpoint, --executable-path, --browser,
--extension), as Why "nobrowser" with its tools still counted. The row
says "no Chrome here", and its tooltip points at Magpie Browser or the
server's option for a Chrome it can reach; the hub's text says the same.
Desktops, macOS and an image with Chrome are unchanged. A docker-launched
(OCI) entry still says docker not found: there is no Docker in the
container. Docs (en, zh, ja docker.html) get an "MCP servers" section;
the Docker workflow's smoke test runs node/npm/npx/uvx/uv -v and finds
python3 and python.

Run:
- Docker on xiaomi-gpu, origin/main's Dockerfile vs this one, web mode
  with a fresh volume, servers added with `magpie library mcp add` and
  checked through POST /api/library/mcp/check:
  - origin/main: chrome-devtools, memory: notfound "npx"; fetch:
    notfound "uvx" (the report).
  - this: memory ok, 9 tools; fetch (uvx mcp-server-fetch) ok, 1 tool,
    Python downloaded on first run; chrome-devtools error nobrowser
    --browserUrl, 33 tools.
  - tools/call over stdio inside the container with a small node MCP
    client: memory create_entities returned the entity; fetch fetched
    https://example.com; chrome-devtools new_page returned the Chrome
    error above.
- go test -run 'TestNoBrowser|TestCheckSaysNoBrowser|TestCheckStdio'
  ./internal/library on mote: ok. Broken by hand (the hook in
  checkServer turned off): TestCheckSaysNoBrowser red, "got {State:ok
  Tools:3 …}".
- GUI on mote, Chromium and WebKit, en zh zh-TW ja de, 1100 and 390:
  mcp-no-browser (new), mcp-home-health, library-mcp-health, i18n-keys,
  i18n-en-no-cjk: 58 of 58 pass.
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./... and go build ok on mote.
- go test -timeout 45m ./... on mote at this head (on e1c186cfe): 103
  packages ok, none failed (internal/gateway 1039s, internal/library
  408s).

Not tried: an arm64 build of the image (both base images are
multi-arch; CI builds it). The test box's network to npm dropped
mid-run: npx -y then timed out the 30s check step, and one npx install
cut short left ~/.npm/_npx with a missing module until it was removed;
that is npm's cache, the same on a desktop.
2026-11-18 10:02:53 +08:00
yetoneandvincent 549813abb5 gui tests: every short default gives navigation a minute, and CI runs the browser-free guards (#5425)
nav-timeout.test.cjs was red on main since #5425 was filed (11-06),
first for four files and now for 24: each new GUI test copied
page.setDefaultTimeout(5000) without a navigation timeout, and nothing
caught it because CI runs no GUI file. Each short default now sits
beside page.setDefaultNavigationTimeout(60000); clicks and waits keep
their 5s/6s/8s/30s bar. skygunner's 10275d5a6 did the same for the nine
files listed on 11-08, and was never taken; this covers those and the 15
added since.

The class: nav-timeout, i18n-keys and i18n-en-no-cjk read the sources
and need no browser, and LESSONS.md records each of them red on main
after a push that ran chosen GUI files. test.yml's Linux cli job, which
already sets up Node 22, now runs them, so the push that adds the next
offender goes red on CI.

Run (mica; mote was at load 26):
- node --test nav-timeout, i18n-keys, i18n-en-no-cjk at this tree on
  origin/main b2b3d488c: 9/9 ok.
- usage-drag, form-align, accounts-switch-alone (changed files, both
  engines, every language): 34/34 ok.
- Broken by hand: origin/main's usage-drag copied in beside the fix,
  nav-timeout red, naming it.
Not run: the other 21 changed files in a browser (one added line each)
and the whole GUI suite; both machines were running other sessions'
GUI runs.

Co-authored-by: vincent <webmaster@palmit.com.au>
2026-11-18 02:24:05 +08:00
yetone cd89ccdb40 ci: macOS tests in four parts at once (#6903)
macOS ran everything in one job on a 3-core runner: ~93 minutes on
44024695993 (Test 65m, Race 24m), and the Test step met its 75m cap with
no test failing (#6903). The packages' own times sum to ~2250s; the rest
was waiting for a processor. Raising the cap would only be met again.

macOS now runs as four jobs: three shares of the packages but the gateway
(build/pkg-shards.sh, slowest first onto the lightest share, with macOS
CI's seconds for the slow packages), and the gateway with the race steps.
The old Test step is split into Test (packages) and Gateway; ubuntu and
Windows run whole as before. Vet runs once on macOS, in share 1/3. The
Test cap goes from 75 to 45 minutes.

Run: build/pkg-shards.sh 1..3 of 3 over `go list ./...` (124 packages):
41/42/41, each with three of the slow packages, ~870s apiece, and their
union is the list; the step's pipeline under bash -eo pipefail (bash
3.2 too) for each part; actionlint (only the Gofmt step's old SC2046).
workflow_dispatch run 44046493476 at this tree (branch ci-mac-parts),
all green: macOS 1/3 12m, 2/3 17m, 3/3 15m, gateway with race 34m
(the macOS job was ~93m); ubuntu 37m, windows 5m.
2026-11-17 17:04:02 +08:00
yetone b466aa2803 update: a Daily channel, one release a day that passed its tests, for the app and Docker (fishmagic80 on X)
fishmagic80 on X: Stable is too slow (community plugins need a newer
magpie than it has), every release is too fast, and Docker users have
nothing in between. Daily sits between them.

What it is:
- site/worker.js keepDaily: at the daily cut (20:00 UTC, the quarter-hour
  cron) the newest tag whose commit has a successful Test run and whose
  release has all 17 assets is picked and kept in LEDGER "daily". A day
  with none keeps the day before's; a failed GitHub read writes nothing.
  /api/latest?channel=daily (503 until a pick exists), /download/daily/<p>,
  and an urgent release overlays it as on Stable.
- .github/workflows/docker-daily.yml reads that feed and points
  ghcr.io/yetone/magpie:daily at the picked version's image.
- App: settings.UpdateDaily ("daily"); update.Channel()/Picked() (Stable()
  kept); the feed is asked channel=daily, never falls back to GitHub's
  latest, What's new lists every change since yours. Settings > About >
  Update channel has Every version / Daily / Stable; the version row says
  "Up to date on Daily (· {v} is out on Every version)". CLI: magpie
  update channel [stable|daily|every].
- Words in en, zh, zh-TW, ja, de, on top of 7f832b2f2's 尝鲜版/搶先版/先行版
  for Every version (kept as it landed).
- The channel row wraps its switch under its name when narrow (ja at
  420px was 18px past the window with three segments).
- app.js budget +338: the segment, its line and the two Up to date on
  Daily words, packed to one t() per choice; Settings and renderUpdate
  draw on every window, nothing lazy to move them to.
- Docs: docs/reference.md, site docs (docker, privacy in en/zh/ja),
  llms-full.txt, search indexes.

Red on the old code (a daily-old worktree, then only settings allowing
"daily"): the feed was not asked channel=daily, 40 notes instead of all,
Picked false, notesKey "zh" not "zh|daily", the Daily row showed
"available"; the GUI tests had no Daily segment.

Run on mote at this commit's tree (on origin/main ec1a1a7a5; the Daily pick itself is live on the deployed worker: /api/latest?channel=daily answers 0.1.4171, /download/daily 302s to its dmg):
- go test -count=1 ./internal/settings ./internal/settingsapi
  ./internal/update ./internal/cli ./internal/gui: all ok (TestCoreScriptBudget
  included).
- GUI, chromium and webkit, every language: update-*.test.cjs (22 files),
  i18n-*.test.cjs, settings-search.test.cjs: 554 of 554 pass.
- site: node --test site/*.test.mjs, 132 of 132 (130 before the rebuild).
- gofmt -l clean; go vet darwin, windows (gui/update/cli) and
  GOOS=linux -tags nogui.

Also: site/public/search/*.json and llms-full.txt rebuilt
(search-index.mjs, llms-full.mjs); they still listed Antigravity's old
sign-in after 9cd5f3652, so the two site freshness tests were red.

Filed: #6730, engines.magpie is never read, so a plugin needing a newer
magpie installs on Stable (0.1.3078) and fails without saying why
(page-amp-usage >=0.1.3681, middleware-company-guard >=0.1.3841,
page-day-card >=0.1.3427).

Not tried: a real self-update on Daily, a real docker-daily workflow run,
the whole GUI suite, the worker's unauthenticated GitHub reads under a
rate limit.
2026-11-15 13:10:18 +08:00
yetone 705d67efc7 ci: the Test step has a 75-minute cap (#5267)
0dbdc7481's macOS Test step (run 43656468676) printed its last package
line at 00:54:42 (internal/libc) and nothing more until it was cancelled
by hand at 01:38:41: internal/library, next in order, neither finished
nor hit go test's -timeout 30m panic, so no stack came out. Main's runs
don't cancel each other, so 97e6ac36c's run waited behind it. With the
cap a hang fails the step and the queue moves.

The cap: Test took 11 minutes on ubuntu in that run and 31 on macOS in
the run before (6e6a18eda, where the gateway's 30m alarm ended it);
75 leaves room for a slow macOS runner. The hang itself is #5267's
(internal/library past its timeout in testenv's warm-up run); this
doesn't fix it.

Run: the workflow parses (python yaml.safe_load). Not run: the workflow
itself; this push's own run is its check.
2026-11-15 09:40:35 +08:00
yetone 0dbdc7481c ci: Test runs internal/gateway in chunks, one process per core, as Race does (#2191)
f1c9014cd's macOS Test run went red with internal/gateway past go test's
30m alarm while the test then running was 1s in: no test hung, the
package as a whole ran out. Its tests run one at a time (t.Setenv rules
out t.Parallel), and the package grew from 450-600s on macOS runners
(10-28, 56602426d) to 965s on the green run before, and 892s for 4286
tests on mote, none over 20s. A longer timeout would be met again the
same way; Race already runs the same tests in chunks through
build/race-shards.sh (#5361).

The Test step now runs every other package as before, and the gateway's
plain test binary through race-shards.sh. The plain run stays: it sends
the full 64 MB bodies and runs the pool tests -race skips (raceOn).

Run on mote at this change (origin/main a5e3972a7):
- go test -c ./internal/gateway/, then build/race-shards.sh with 18
  workers and -test.timeout=20m: 4300 tests in 135 chunks, 125s, exit 0
  (twice; the second run's status taken from the script, not a pipe)
- go list ./... | grep -v '/internal/gateway$': 121 packages, the
  gateway's subpackage kept
Not run: the workflow itself; this push's own Test run is its check,
on Linux (gtk3 tags) and macOS.
2026-11-15 08:05:40 +08:00
yetone c4f7ba9d3a update: only a release whose SHA256SUMS carries the release key's signature is installed (danny0dong on X)
The updater took a file and its SHA-256 from the same feed answer, so
whoever could change /api/latest could swap both; only the Mac app also
checked its signing team. Now release CI (yetone/magpie-releases) signs
"magpie release <version>\n" + SHA256SUMS with an ed25519 key held as that
repo's UPDATE_SIGNING_KEY secret and publishes SHA256SUMS.sig (release
assets: 16 -> 17). The site worker carries the list and signature in the
feed; internal/update/signed.go checks them against the public key built
into the binary, takes each file's hash from the signed list and refuses a
missing or bad signature or a feed hash that differs. Versions from
0.1.3862 require it; older ones and binaries older than the key update as
before. MAGPIE_UPDATE_FEED lifts the requirement for local test servers.
mirror-release waits for 17 assets; docs/reference.md and code-standards
say 17 and describe the transition.

Run: go test internal/update, internal/cli, internal/gui -run Update|WhatsNew
(ok); node --test site/*.test.mjs (116 ok); gofmt; go vet darwin, linux
nogui, windows on internal/update. Broken by hand: signature check skipped
(tamper and other-key tests red), feed-hash comparison skipped (swapped
hash and feed tests red), worker not attaching signed (worker test red).
The embedded key is checked against a sample signed by the real key with
openssl, as CI does. Signing script run against a throwaway key.
Not tried: a real signed release before this tag; install.sh does not
verify the signature.
2026-11-12 16:43:23 +08:00
yetone b45d21d5fb release: the dispatch to magpie-releases waits out the API rate limit
trigger-release dispatched with peter-evans/repository-dispatch and
RELEASES_REPO_TOKEN, the owner's PAT. It shares the 5,000/hr core limit
with every agent session running gh as the owner, and on 11-10 the
limit ran out: v0.1.3561, 3566, 3568, 3569, 3571 and 3573 failed at
that step with "API rate limit exceeded for user ID 1206493" and have
no release in magpie-releases. They are not dispatched again: a release
published after a newer one would become Latest, and their commits are
in newer releases.

The step is now curl to POST /repos/yetone/magpie-releases/dispatches
with the same token and payload (built with jq). A 403 or 429 that is a
rate limit (retry-after, x-ratelimit-remaining 0, or "rate limit" in the
body) waits until retry-after or x-ratelimit-reset (60s when neither is
given) plus 5s and tries again, up to 65 minutes in all. Any other
non-2xx, or a curl failure, fails at once with the status and body; the
token is never printed. The job has timeout-minutes 75.

Other API calls checked: mirror-release and the notes issue use
GITHUB_TOKEN (its own per-repo limit), docker.yml uses github.token, and
no other workflow uses RELEASES_REPO_TOKEN.

Run: the step's run block, extracted from the YAML with PyYAML, against
a local Python fake server. 403 with x-ratelimit-remaining 0 and a reset
3s out, then 204: waited 8s, succeeded on try 2. 429 retry-after 2, then
403 rate limit, then 204: waited 7s and 8s, succeeded on try 3. 404 and
a 403 "Resource not accessible" (no rate-limit sign): failed at once
after one request with status and body. A reset 2h out: failed at once
as past the wait. A refused connection: failed at once with curl's exit.
The payload the server got was
{"event_type":"release","client_payload":{"ref":"v0.1.9999","version":"0.1.9999"}},
and no log held the token. bash -n ok; actionlint ok for the new step
(its only findings are two SC2086 infos in Get version, the same at the
base). Run locally: mote refused ssh at the time.

Broken by hand: with the rate-limit detection never matching, the first
403 rate limit failed at once.

Not tried: the real dispatch endpoint. It runs on the next tag.
2026-11-10 18:31:23 +08:00
yetone b93dd12441 github: bug and feature issue templates, with a known-issues link
A bug report asks for the version, surface (GUI/TUI/CLI), OS, agent and
provider, steps and the exact error, so a report can be reproduced
without a round of questions. config.yml links open bug issues as the
known-issues list, and Discord for questions. Asked for on X by
AskarKerey (2119903378700403104).

Run: the three files parse as YAML (python yaml.safe_load); the labels
bug and enhancement exist. No code changes, nothing else to run.
2026-11-10 05:44:26 +08:00
yetone 602f746f42 release: a copied release is Latest only when no published one here is higher
v0.1.3360's mac signing failed on an Apple timestamp error, its rerun was
published in magpie-releases at 04:20Z after 3361 and 3362, and the
mirror's `gh release create` (no --latest) let GitHub mark it Latest here
too. The owner moved the mark back to v0.1.3362 by hand.

The copy step now passes --latest=true only when the tag is at least as
high (sort -V) as every published, non-prerelease vN.N.N release here,
--latest=false otherwise, on both create and the rerun's edit. Once the
copy is out, the highest published release gets the mark when another
has it, for two copies deciding at once. magpie-releases' own publish
gets the same fix in yetone/magpie-releases 23077359.

Run (locally, bash only): the step's run block, extracted from the
workflow with python yaml, against a fake gh: 3360 after 3362 ->
create --latest=false, Latest stays 3362; 3362 after 3361 -> true;
1000 after 999 -> true; first release -> true; 3359 copied while 3360
held the mark -> --latest=false, then the mark moved to 3362; a rerun
over an existing 3360 -> edit --latest=false. actionlint: the same 2
findings as origin/main. Not tried: a real tag (none pushed to test).
2026-11-09 12:29:26 +08:00
yetone 75d40ba48b ci: race gateway tests run in chunks taken in turn; 64 MB bodies are 20 MB under -race
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 #5361
Fixes #5320
2026-11-07 19:45:30 +08:00
yetone 650bf84128 docker: a daily tag that moves once a day, for Renovate
magpie releases many times a day, and YaoFur on X runs the image with
Renovate, which opened a PR on every tag ("改成每天凌晨更新一次").
Releases stay as fast as they are. ghcr.io/yetone/magpie:daily is new:
.github/workflows/docker-daily.yml points it at :latest's image once a
day, at 20:00 UTC (04:00 in China), by digest, as docker-stable.yml does
for :stable. It never builds, and touches no other tag; a click on Run
workflow moves it too. A Renovate user follows daily with its digest
pinned and gets at most one PR a day; stable is still there for one a
week.

The docs name it: the Tags row and the Updates line of the Docker page in
en, zh and ja, and the Docker section of docs/reference.md.
site/docker-tags.test.mjs holds that the three languages name the same
floating tags with daily among them, that a workflow writes each tag the
docs name, and that daily has one daily schedule, copies latest and
builds nothing.

The desktop app is unchanged: it already checks every 6 hours by
default, and Settings > About offers Check every 24 h and the Stable
channel (one a week).

Run (mote): node --test site/*.test.mjs, 90 of 90 ok; without the
workflow and the docs, two of docker-tags' three tests are red.
actionlint on docker-daily.yml and docker-stable.yml: clean. No Go file
changed; go test ./... -timeout 45m runs on the Linux box (wsl-run) at
this tree, since mote had another session's full suite running.
Not tried: the workflow itself before this push; it is run once with
workflow_dispatch right after it.
2026-11-06 20:52:29 +08:00
yetone d20caffae1 release: notes written again on magpie-releases are copied here each hour
GrayRabbit on Discord (11-02): the "更新内容" dialog in Chinese listed
v0.1.2634 on as raw English commit subjects. magpie-releases' release
runs got "Insufficient Balance" from DeepSeek for both the changelog
and its Chinese since v0.1.2634, so those releases went out with the
commit list and no <!-- lang:zh --> part, as v0.1.1233 to 1242 did
(#2122). magpie-releases b90a82b now writes such notes again each hour
(notes.yml) once DeepSeek answers.

- notes-mirror.yml, hourly at :53 and by hand: a release here still
  without the zh marker gets magpie-releases' notes of the same tag
  once those have it, with the mirror's footer. The app reads
  magpie-releases through usemagpie.ai, so this is the GitHub page.
- release.yml's notice on #2260 names insufficient_balance_error as a
  DeepSeek top-up and says the notes are written again by themselves.

v0.1.2634 to 2644's notes were written by hand from their commits, in
English and Chinese, on both repos' releases.

Run: actionlint 1.7.7 (mote) on notes-mirror.yml and release.yml:
nothing but release.yml's existing unknown runner labels. No Go or GUI
code changed.
Not tried: notes-mirror.yml on GitHub's runners before this push.
2026-11-02 05:22:19 +08:00
yetone 697335d8ee native: each x86 target gets pf-serve-base, built for SSE4.2 alone
echo_yip on X: Settings → Privacy's model would not start, "pf-serve
(Metal): signal: illegal instruction" and then the same on the CPU.
pf-serve for x86 (darwin-amd64, linux-amd64, windows-amd64) is built
with GGML_AVX, AVX2, FMA, F16C and BMI2 on and GGML_NATIVE off, so on a
CPU without AVX2 (a Celeron or Pentium, a Mac before Haswell) and under
Rosetta before macOS 15, which has no AVX at all, ggml's first vector
instruction ends it with SIGILL. Two tries, Metal then CPU, are what
magpie's Mac start does, so this was a Mac: most likely the Intel DMG
on Apple silicon.

build.sh now also builds pf-serve-base for each x86 target, with SSE4.2
on and AVX, AVX2, FMA, F16C and BMI2 off, and puts it in the same zip.
The workflow's start check runs it too where the runner can. magpie
picks it on a CPU without them in the next commit; a pf-v3 tag
publishes these zips.

Run: privacy-filter workflow on pf/base, run 41255213505, green on
all five targets; darwin-amd64, linux-amd64 and windows-amd64 each
have pf-serve-base in their zip. objdump -d of the CI binaries:

  pf-serve       ymm 20613 / 12222 / 12230, vfmadd 859 / 714 / 686
  pf-serve-base  ymm 0, VEX-encoded xmm 0, vfmadd 0 (all three)

Linux box (magpie-desktop), the pinned model (sha256 80efc180...),
PF_DEVICE=cpu, qemu-x86_64-static 8.2 -cpu Nehalem (SSE4.2, no AVX):
  pf-v2's released pf-serve:   signal 4 (Illegal instruction), 132
  this build's pf-serve:       signal 4, 132
  this build's pf-serve-base:  {"device":"cpu",...}, exit 0 (135 s
                               under emulation)
Natively, pf-serve and pf-serve-base find the same spans in an
English, a Chinese and a secrets text (names, email, phones, address,
password).

Not tried: a real CPU without AVX2, and a Mac before macOS 15 under
Rosetta; qemu stands in for the first.
2026-11-01 08:22:44 +08:00
yetone deabe0903e docker: a stable tag that follows the desktop app's Stable channel
jorbenzhu on Discord (#feedback, 10-31): "建议 docker镜像 也提供 stable 类tag,
与桌面版保持同步的稳定版发布". The desktop app's Stable channel is chosen in
site/worker.js (stableOf: once a week the newest release out three days,
or an urgent one at once) and served at /api/latest?channel=stable. The
image had latest, a version's tags, 0.1, 0 and edge, nothing for Stable.

New .github/workflows/docker-stable.yml reads that feed, hourly and after
each Docker run, and points ghcr.io/yetone/magpie:stable at the image
docker.yml already built for that version (buildx imagetools create, no
build). It decides nothing itself, so the tag can't drift from the
desktop's pick. latest, edge and the version tags aren't touched. A feed
it can't read (or one naming no version) leaves the tag where it was,
with a warning; no image for the Stable version is a red run. Images are
compared by their platform manifests, so a run with nothing to do pushes
nothing. Docker docs (en, zh, ja) list the tag; worker.js's Stable
comment points to the workflow.

Run:
- actionlint on the workflow: ok.
- The step's script locally against the real feed and ghcr (create
  swapped for an echo): feed says 0.1.1327, :stable missing -> would
  create stable from 0.1.1327; feed 404 -> warning, exit 0; stable
  already the same manifests -> "already", exit 0; no image for the
  version -> exit 4 (red).
- node --test site/*.test.mjs on mote: 49 pass.

Not tried:
- the workflow on GitHub itself: it first runs on its schedule or after
  the next Docker run; I didn't dispatch it by hand. Its first run
  creates :stable.
- whether buildx imagetools create with one source keeps the index's
  digest (the compare is by platform manifests, so either way is fine).
2026-10-31 11:51:01 +08:00
yetone 74f812eaf0 release: the mirror waits up to five hours for magpie-releases, not one (#4488)
On 10-30, magpie-releases' macOS jobs waited about an hour for a
hosted runner while several tags queued. v0.1.2262's build published
all 16 assets at 19:36:52, 62 minutes after its tag. mirror-release
had given up at 19:35:35 ("never published v0.1.2262 with 16 assets"),
so v0.1.2261 and v0.1.2262 never reached this repo's Releases page
until their failed jobs were rerun by hand.

The wait now runs 600 tries 30 s apart (300 min), and the job's
timeout is 330 minutes, under GitHub's 360. A build that really failed
still ends in the same error, only later. Following the magpie-releases
run's own state would end such a wait sooner; #4488 stays open for it.

Run: actionlint .github/workflows/release.yml ok. Not run: a real
release through it (the next tag runs it).
2026-10-31 03:42:11 +08:00
yetone 56602426d3 ci: Test gives the packages 30m, where internal/gateway ran into go test's default 10m on macOS (#2108)
The Test step ran `go test ./...` at the default -timeout 10m. On the
last 8 finished main runs internal/gateway took 448-600s on
macos-latest (375-450s on ubuntu), and timed out at 600s in 3 of them
(40676722560 at b3edcabf2, 40655569734, 40654333385), a red that names
no failing test. LESSONS' "A full run gives the slow packages room"
asks for a longer timeout on full runs already.

This is room, not the fix: the gateway package's run time stays open as
#2108. No app change; nothing run locally for a workflow edit. The next
main run's macOS job shows it.
2026-10-28 19:43:39 +08:00
yetone 1f98f5ba65 native: pf-serve-vulkan finds SPIR-V's headers, and glslc on Ubuntu 22.04
ggml-vulkan asks for SPIRV-Headers' CMake config, so build.sh installs the
pinned SPIRV-Headers into .work and points cmake at it. Ubuntu 22.04 has no
glslc package; build.sh takes it from LunarG's 1.4.309.0 Linux SDK, checked
against the sha256 LunarG publishes. First CI run failed on both (run
39097128531).
2026-10-18 12:32:53 +08:00
yetone ffa292c7d3 native: pf-serve, a sidecar that runs OpenAI's Privacy Filter for masking (#1977)
pf-serve loads privacy-filter.cpp's GGUF model on the GPU (Metal, Vulkan)
when there is one, else the CPU, warms the kernels up, writes one JSON
hello line and then answers length-prefixed batches of texts with byte
spans. internal/pii (next) downloads and runs it on demand.

build.sh pins privacy-filter.cpp 735a6c28 (MIT) and patches two upstream
build bugs (ner.h lacks <cstdint>; ggml's power-throttling block needs a
newer mingw). The privacy-filter workflow builds darwin-arm64 (Metal),
darwin-amd64, linux-amd64/arm64 and windows-amd64 (cross, mingw); the
Vulkan targets get pf-serve-vulkan plus a CPU-only pf-serve for machines
with no Vulkan loader. A pf-v* tag publishes them as a prerelease.

Run: build.sh darwin-arm64 on an M4 Pro; pfclient.py against the q8 model:
hello in 5.4s (file cached), warm requests 9-18ms on Metal for Chinese
person/address/phone, email, secret and a 3 KB text. Other targets: not
built locally yet; this push is their first CI build.
2026-10-18 12:26:55 +08:00
yetone 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.
2026-10-15 10:10:18 +08:00
yetone e9943c1797 release: a release whose notes went out without Chinese is said on one open issue, not only in magpie-releases' log (#2122, KaiZe on Discord)
magpie-releases writes the Chinese notes with a DeepSeek call. Its balance
ran out, so v0.1.1233 to v0.1.1242 shipped English only, and Chinese apps
showed English notes until a user reported it. The failure was only a
warning in a log nobody reads.

mirror-release now checks notes.md for the <!-- lang:zh --> marker. When it
is missing, the job comments on the open "Release notes without Chinese"
issue, or files that issue if none is open. If gh fails, the step only
warns, so the release itself never fails here.

What was run: the step's script against a fake gh in four cases (Chinese
present, no issue open, issue already open, gh failing); the real
`gh issue list` query, read-only; a YAML parse of the workflow. Not run:
a real release (the next tag will run it). No Go code changed.
2026-10-15 05:14:44 +08:00
CaramelizedCUDAandClaude Code d85ef1908a ci: Bun on every test runner, and the plugin stderr tests on Windows
The end-to-end plugin test needs bun on PATH, and setup-bun only ran on
Linux, so macOS skipped it (run 38250283461: "no bun on PATH"). Windows
skips the Test step, so the stderr tests were only compiled there. Both
now run: setup-bun on all three runners, and a Windows step that runs
the two stderr tests with -v, so a skip shows in the log.

Run before this commit: the change is CI-only and is checked by the
workflow run on this branch.

Reviewed for magpie: the workflow change only drops setup-bun's Linux-only condition (same pinned oven-sh/setup-bun@v2, bun 1.4.2) and adds one Windows step running the two tests; no new trigger, permission, secret or action. The contributor's run 38263044397 shows both tests passing on windows-latest with bun 1.4.2, and macOS green with bun installed.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-12 23:33:56 +08:00
yetone 0b0bd38b3f release: each tagged release is copied onto yetone/magpie with its notes and all 16 assets (PapainTea on X)
The main repo's Releases page was empty: the installers live only on
yetone/magpie-releases, which is bad for finding magpie and confusing to
people who look here first. A new mirror-release job, after the dispatch,
waits (up to an hour, every 30s) until the magpie-releases release for the
tag has 16 assets, downloads them, and creates the same release here with
GITHUB_TOKEN (contents: write): title "magpie vX", the same notes plus a link
to the magpie-releases page. A rerun edits the notes and replaces the assets.
It fails when fewer than 16 land here.

Nothing reads this repo's releases: self-update (internal/update),
install.sh and the site's /api/latest still read magpie-releases, unchanged.
A release made with GITHUB_TOKEN triggers no workflow, and none here listens
for release events.

Run: YAML parses; the wait and download half by hand against v0.1.1191
(16 assets, 554M, title "magpie v0.1.1191"). The create half runs for the
first time on the next tag.
2026-10-11 23:38:35 +08:00
yetone 79f9b3752b sessions: a Codex archived copy rewritten at the same size in the clock tick of its last comparison is compared again, not taken from the cache, on Windows too (#1299, wizzy-yang)
The copy cache trusted a change time it had seen as proof the file had not
changed. NTFS stamps ChangeTime from Windows' clock tick, not the precise
clock: on the Windows box, 300 ms of back-to-back same-size writes got a
new ChangeTime only every ~0.5 ms (2147 of 2691 writes kept the previous
stamp; diffs 0.5/1.0/1.5 ms). A rewrite in the tick of the comparison kept
the stamp the cache saw, so the cached relation was reused. That, not write
merging, is why TestCodexArchivedSameSizeRewriteInvalidatesDiscovery failed
19 of 300 runs on Windows, alone as well as in the full package.

A comparison is now cached only when both files' change times are more than
a second older than the moment it started (codexStampSettle); a file changed
more recently is compared again next time. A later rewrite then lands in a
later tick and changes the stamp. Change times are compared as times
(Windows FILETIME converted).

TestCodexSameTickRewriteIsNotCached gives every write one change time and a
clock 10 ms into that tick. With the settle rule taken out (cacheable = both
stamps present), it fails: "a rewrite in the tick of the comparison reused
its stale relation". With it, it passes, and the second half checks settled
copies are still compared once, not every time.
TestCodexArchivedDiscoveryCacheAndAppend moves its clock a minute on so the
just-written copies count as settled.

The Windows CI step now runs the Codex copy tests (CodexArchived,
CodexSameTick, CodexPlainTwin), which it had never run.

Run: Windows 11 box (cross-built sessions.test.exe, sandbox USERPROFILE/
APPDATA/TEMP): old binary 19/300 failures of the reported test; new binary
0/1000 for the three Codex copy tests, and the Windows CI regex x5 with
testdata passes. macOS: go test -race ./internal/sessions, -race -count=30 of
the Codex copy tests, go vet (darwin, GOOS=linux, GOOS=windows), gofmt -l.
Not run: Linux with a coarse ctime clock (kernels before 6.13); the rule
covers it the same way.
2026-10-08 19:04:18 +08:00
yetoneandClaude Opus 5.5 a2bdb7f8ba ci: the GTK and WebKitGTK install on Linux gives up after 15 minutes, where a stuck apt held main's Test run for 2.5 hours (b0d456c3) and every later push queued and was replaced behind it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 06:02:22 +08:00
yetone 7bdb0b34e8 ui-preview: the sandbox gets made-up data before it is recorded, so a change that only shows with data can be seen (owner: pr-preview 的时候有时候没有数据压根儿测不了,能否帮忙造一些假数据之后再测啊)
seed.mjs write fills the fresh home before magpie starts:
- a Sub2API relay (three keys, rotate, 5h/1d/7d windows, a month of balance history), Acme Cloud and a routing group with a rule;
- 30 days of requests from Claude Code, Codex, OpenCode and Gemini CLI over models priced on models.dev, at different speeds, with TTFT, cache reads, reasoning, sessions, accounts and a few 429/502s;
- 308 Claude Code and 94 Codex session files, more than a page, many never sent through magpie;
- two ChatGPT accounts signed in to Codex (Pro with credits, Plus near its limit) with five weeks of quota history;
- library skills from GitHub (one author with two repositories) and a folder, and some only in the agents' folders.

seed.mjs serve stays up as the mock: the fake providers in the Chat, Responses and Anthropic APIs, the relay's /v1/usage, and, as magpie's HTTPS_PROXY, chatgpt.com's usage and Codex models under a certificate from a CA that run.sh makes. Every other host is tunnelled as it is, so DeepSeek still answers for real. The warm-up also goes through the relay, Acme and the group, and record.mjs's guide says what the sandbox now has.

Checked by running run.sh in a Linux container:
- the Codex cards are read live, not stale, and their history draws;
- the relay's windows and balance trend show;
- every model is priced;
- sessions list 200 of 402;
- the warm-ups all pass.
Then record.mjs ran for real (DeepSeek planning, Playwright) on 6e53ee1f's diff (#1031). It planned and shot the skills page's author groups, with GitHub skills above and local below.
2026-10-06 22:49:36 +08:00
yetone 5fb5cdacc4 ci: Test fails on a Go file gofmt would change — unformatted files reached main 8 times from 10-01 to 10-06 (#427's toml_literal_test.go, fdf8b01e's subscription_usage.go today), and each took a gofmt commit of its own (aac0cd24, 8fbd39f8). The step runs gofmt -l on every tracked .go file, on Linux only, as Windows checks files out with CRLF. gofmt -l is empty on main now, and it lists a file with a misformatted func. No app change. 2026-10-06 16:24:50 +08:00
yetone 690d4c921a ci: a Test run on main finishes instead of being cancelled by the next push, and the workflow's token can only read
On 10-05 and 10-06 nearly every Test run on main was cancelled by the
next push, so a release had no finished run to wait for and Linux-only
failures shipped (LESSONS.md: "Don't tag until a CI Test run ... has
finished green"). cancel-in-progress is now false on main only: a running
run completes, and GitHub still replaces a queued one with the newest.
PRs keep cancelling their older runs. The workflow had no permissions
block, so it got the repository default token; it needs only to read.
2026-10-06 03:56:55 +08:00
forever 88b87ac13f fix(agent): reject Cursor launchers in VS Code detection (#931) 2026-10-06 01:02:09 +08:00
yetone 652e5e1ec5 ci: the gateway's race suite runs over one process per core, not one at a time (wizzy-yang, #923)
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.
2026-10-05 23:54:03 +08:00
tsuixl f5d777c58b fix(dsh): 保留家级模型选择并修正补丁配置继承 (#838) 2026-10-05 07:48:17 +08:00
tsuixl 066ecaae7d 修复 Windows MCP 连接拒绝分类并补充 CI 回归 (#805) 2026-10-05 07:44:11 +08:00
yetone 7bfe3137bd docker: the image has bash and busybox, so a terminal in the container opens (スライム on Discord: 这2天的docker版更新后无法进入terminal模式,导致配置不了devin … exec: "/bin/bash": stat /bin/bash: no such file or directory)
The image is distroless, which has no shell at all, so a NAS panel's
terminal (Synology, 1Panel, Portainer open /bin/bash or /bin/sh) and
`docker exec -it magpie bash` failed, and a sign-in that needs a terminal
(magpie accounts add devin) couldn't be made there. The image now copies
in Debian 12's bash with the libtinfo it links (distroless cc is Debian 12,
so its glibc runs it) and busybox's commands, and puts magpie on PATH
(/usr/local/bin/magpie). The image still runs as nonroot and starts
/magpie serve as before; it grows from about 37 MB of extras to 66.6 MB.

Built locally (docker 29.4, arm64): bash 5.2.15 and sh run as uid 65532,
`magpie version` and `magpie healthcheck` work from bash, the gateway
answers 200 on /v1/models, /config keeps its folders. The Docker workflow's
smoke test now runs bash and sh in the container. README says so.
2026-10-05 03:23:18 +08:00
Snowyy c38728145b plugin: a slow reader pauses its stream instead of racing a watchdog (#812)
* plugin: a slow reader pauses its stream instead of racing a watchdog

#664 gave a plugin reply a soft watermark (softQueuedBytes 4 MiB, softQueuedEvents 4096) and a 10-second idle watchdog: past the watermark, a reader that made no progress for stallIdle had its call failed with errStalledReader, and hardQueuedBytes/hardQueuedEvents (64 MiB / 65536) cut the reply outright. Both are guesses at how long a reader may take, and both end a reply that reader was still consuming.

The host now hands each fetch a credit window instead. Go grants streamWindow (512 KiB) up front and returns credit as the reader takes bytes, so the child stops producing at the window instead of being timed out; the window is charged per delivered byte plus frameOverhead (2048), so a run of tiny frames cannot fill it with metadata. streamBudget (64 MiB) and maxFrame (64 KiB) bound a whole reply and a single frame, and a child that sends past its window is a protocol violation (errProtocolOverrun) rather than a slow reader.

The plugin side grew the matching gate (makeGate, gate.take/spend/add, waitDrain): a fetch holds at the window until Go credits it, and its pending writes are cancellable. Cancellation and shutdown now have one owner per call - a five-state lifecycle (sending, active, draining, aborting, released) whose single transition helper disposes the queue, detaches the watcher, commits the terminal answer, creates the abort and returns capacity exactly once - so a host failure, a Close, a cancelled context and an already-delivered reply can no longer race each other over who cleans up. A reply the host already delivered keeps its bytes and its vendor outcome when the host dies.

Tests: the JS cancellation cases run the production sections with controlled stdout backpressure (stopped gate, split chunk, terminal suppression, acquired-body cancel, 30,000 cancelled bootstrap waits with no retained waiter or ready reaction); the Go cases drive lifecycle orderings directly (terminal-before-failure, failure-before-terminal, abort acknowledged before capacity returns, blocked enqueue), and the shutdown, body-close and mid-setup-cancel cases block on explicit channels instead of sleeping. TestFlowBigReplyProd reads 100 MiB non-SSE and SSE through the real host and checks lengths and SHA-256, including a 12 s reader pause. CI installs Bun 1.4.2 on Linux and runs that case in its own step, since the plugin sandbox skips when bun is not on PATH.

* plugin: the stream-head credit test waits for the credits before the reply ends (CI, macos-latest: TestHostStreamHeadChunksFinal failed on the macOS runner with "the credits were given back didn't happen", while the same package passed on ubuntu-latest and locally) — the test sent the child's final answer together with its 50 chunks, so the call could be marked stopped and its pending credits dropped before waitFor saw them; a completed fetch needs no credit, so waiting longer could not recover them and the expectation was a race, not a real accounting bug. The final answer is now withheld until io.ReadFull has taken the 140 payload bytes in order and exactly 140 + 49*frameOverhead credits have been observed with frameOverhead still owed, and only then does the child answer and the test assert a zero-byte EOF read. No production code changed.

Tests: go test -run '^TestHostStreamHeadChunksFinal$' -count=500 ./internal/plugin/ and -count=200 -race pass; go test -count=1 and -race -count=1 ./internal/plugin/... pass; gofmt -l and git diff --check clean.
2026-10-05 01:36:20 +08:00
tobitege 21702d01ff Add German translation; harden paths against unset env vars (#770)
* Add German translation and harden paths against unset env vars

Add a German locale to the GUI, tray menu, usage alerts and website home page, and refuse to start when the home folder is unset or relative so nothing is written under the working folder; the pi plugin no longer adopts the user's PI_CODING_AGENT_DIR, and an inherited APPIMAGE no longer selects portable mode. Scripts refuse to run from the wrong folder or empty a shared out folder, and a new internal/testenv sandboxes every test package from the user's real files, which also fixes the Claude picker and Termux installer tests on Windows.

* Makefile: know magpie's folder by its go.mod, so paths with spaces work

The check compared $(CURDIR) with $(dir $(abspath …)), which make splits on spaces, so a checkout under 'My Projects' or 'John Doe' refused every target. It now reads go.mod relative to the working folder and wants magpie's module there: make -C and a symlinked Makefile work, make -f from another folder still stops before any recipe runs.

* i18n: German for the strings main added since, with a parity test

75 strings main added (group order, patterns, slow-start wait, usage caps, RTK savings …) get their German, and two that main dropped go. gui-de.test.cjs checks, as gui-ja does, that de has every zh string with its placeholders and tags, and that the window reads in German when picked or on a German system.

* appdir: ignore relative folder variables when reading, keep them for children

CheckEnv no longer unsets anything. magpie reads the XDG folders, APPDATA/LOCALAPPDATA and every agent's folder variable through appdir.Getenv/LookupEnv, which pass over a relative value; the environment stays as it is, so the agents magpie starts get the variable as the user set it. That covers what proc.UserPath lends from the login shell too, which is set after main's check and reached the desktop app unchecked. On Windows a path rooted on the current drive (\Users\x, Git Bash's /c/x) counts as usable, and magpie version and help answer without a home, before run makes any folder.

* Sandbox the tests main added since

internal/wslrun gets testenv's TestMain, and four tests main added that set HOME alone set their home with testenv.SetHome, so on Windows they don't read the runner's profile through USERPROFILE.

* agentenv: PI_CONFIG_DIR and OPENCODE_DB take relative names on purpose

omp puts $PI_CONFIG_DIR under the home and OpenCode a relative $OPENCODE_DB in its data folder, so neither depends on the working folder: appdir no longer passes them over.

* i18n: German for the Library's multi-select and System One's decision API

The 19 strings main added since (#791's skill multi-select, the decision API snippets) get their German; the one main replaced (four APIs → five APIs) goes.

* appdir: tidy the import into magpie's group; say what Go makes of /c/x

The appdir import joins the group of magpie's own imports where a file has one. rooted's comment now says that Go takes a Git Bash path like /c/x as \c\x on the current drive, not C:\x.
2026-10-04 23:30:56 +08:00
Zhizhen He 0c6b4c290a sessions: preserve Windows link kinds and only copy cross-device moves (#663)
Return the original rename error unless the move crosses filesystems.
Permission and sharing errors must not start a copy-and-delete operation
that can leave the destination behind or remove source contents.

Preserve the source Windows symlink's file or directory kind rather than
inferring it from a target that may not exist at the destination yet.
Keep relative targets, Developer Mode handling and long-path support.

Cover rename failures, Linux cross-device moves and Windows link kinds,
and run the focused session tests natively in Windows CI.
2026-10-03 17:11:26 +08:00
yetone c91529f9aa ci: the UI preview scrolls to what a PR changes further down a page (owner: 录屏的时候,有时候需要录制的功能区需要滚动到下面才能看到,但是现在并不会滚动,导致录制的内容里完全没有 PR 所修改的功能) — the recorder reached an element with Playwright's scrollIntoViewIfNeeded, a scroll no reader asked for, which magpie puts back (scrollOnPurpose / backToReader in app.js), so the page stayed at its top; a shot's target was only a clip of the screen, never scrolled to, so a close-up of something below the fold showed the window's foot instead; and a scroll step turned the wheel wherever the mouse was. bringIntoView now wheels each view that hides the element, innermost first, in small notches with the drawn mouse over it, until it is in the middle (or at the top when taller): click, hover, type and a shot's target use it, and a scroll step takes "to" (a selector to bring into view). The planner's outlines mark elements past the fold of their view "(below the fold)" and its guide says a shot without a target shows only the screen. PLAN_FILE walks a given plan instead of asking DeepSeek. Tried against a sandbox magpie web with six providers and a fixed plan (a shot of Hermes Agent's models button, clicking it, scrolling to a Gateway row): the old recorder's close-up showed the list's foot without Hermes and its Gateway shot the page's top; the new one centres both, the menu opens at Hermes, and the video shows each scroll. 2026-10-03 15:18:01 +08:00
XYenonandAmp 69368007b0 termux: support Android builds and installation (#644)
* termux: build natively and run plugins on Bun 1.4.2

Select nogui for Android builds, open browser and OAuth links with
termux-open-url, and write an executable Termux:Boot script that starts
the gateway with shell-quoted paths.

Bun 1.3 has no official Android build. Upgrade the default plugin runtime
to 1.4.2, add the official Android arm64 and amd64 download targets, and
update SHA-256 checksums for every supported platform.

Document Termux installation, startup and source updates.

Validation on Termux arm64:
- Native build and go vet pass.
- A fresh config downloads and verifies Android Bun 1.4.2 and loads a
  test plugin.
- Boot startup can be enabled and disabled.
- The Web page, authenticated state API, unauthenticated API rejection,
  gateway healthcheck and Web quit action work.
- Browser argument preservation, boot path quoting and permissions, and
  plugin tests pass.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a10014-56c1-73d3-b3ee-2ea569713989

* site: install Android builds in Termux

Detect Termux through TERMUX_VERSION or its PREFIX and select the Android
CLI asset instead of a Linux binary. Install into PREFIX/bin by default,
keep MAGPIE_BIN_DIR overrides, and suggest the Web or terminal interface
without Linux desktop setup instructions.

When the release has no Android asset, explain how to build from source.
Add android/arm64 to release-cli and stop the build loop on failure.
Document the installer and its release-asset requirement.

Shell syntax and all 11 site tests pass, covering platform selection,
custom paths, missing assets, checksum rejection and existing Linux
installation paths. The Android arm64 release build succeeds on Termux;
with a simulated release feed, the installer verifies and installs that
binary into PREFIX/bin and the installed command runs successfully.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10014-56c1-73d3-b3ee-2ea569713989
Co-authored-by: Amp <amp@ampcode.com>

* ci: check Android releases and the installer

Build both linux/amd64 and android/arm64 through make release-cli in the
CLI test matrix. Run the site and installer tests in the Linux job with
Node 22, and check the installer's shell syntax.

The release workflow in yetone/magpie-releases already calls the source
Makefile's release-cli target, uploads dist/magpie-cli-*, and generates
checksums for every artifact. The Android target added to TARGETS is
therefore included without changing that workflow.

Replace the full Termux README section with a short platform note beside
the Linux and Windows installation requirements, removing duplicate
commands, the fork URL and temporary release availability details.

Both CLI release builds, all 11 site tests, shell syntax checks and
actionlint validation pass locally.

Amp-Thread-ID: https://ampcode.com/threads/T-01a10014-56c1-73d3-b3ee-2ea569713989
Co-authored-by: Amp <amp@ampcode.com>

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-10-03 14:29:32 +08:00
TryWorld 21d5d1c43a test(update): execute native Windows install checks in CI (#637) 2026-10-03 13:28:16 +08:00
Snowyy 5422306fac usage: guard cache transitions and Windows long-path reads (#598) 2026-10-03 02:19:11 +08:00
mofelee 38b4a9d984 feat: export gateway and agent conversation waterfalls to Langfuse (#581) 2026-10-03 01:43:32 +08:00
Snowyy 3d8c6f24c5 usage: capture Windows change time for cached logs (#594)
* usage: capture Windows change time for cached logs

* ci: show native Windows usage test outcomes
2026-10-03 01:15:29 +08:00
yetone 823e8baedd ui-preview: the sandbox has Claude Desktop, on magpie (#400) — the preview's home had Claude Code, Codex, Gemini and OpenCode but no Claude Desktop, so a PR changing Desktop's row (#399: tier menu, model picker, gateway notice) recorded "not available". run.sh now makes $XDG_CONFIG_HOME/Claude, where magpie looks for Desktop on Linux (the runner), and runs magpie claude-desktop provider magpie, which writes Claude/ and Claude-3p/configLibrary in that home as the Agents page would; no Desktop app is installed. The CLI writes the folders where the OS keeps them, so a local run on macOS gets Desktop under ~/Library/Application Support too. Checked in a sandbox HOME (darwin): Desktop absent from magpie ls before, "provider magpie" after, its profile pointing at MAGPIE_ADDR 127.0.0.1:3430; the Linux path is TestDesktopDirs's. bash -n run.sh, go test -tags nogui ./internal/agent -run Desktop pass. 2026-10-01 15:51:54 +08:00
yetone d1b6c119c7 ci: the UI preview's planner uses deepseek-flash instead of deepseek-v4-pro (PLAN_MODEL still overrides) — asked for by the maintainer. Checked against DeepSeek's API: deepseek-flash answers the planner's JSON mode (response_format json_object) with a valid plan; it reasons first (~1k tokens on a small plan), well inside the planner's max_tokens 16000. 2026-09-30 21:15:51 +08:00
yetone de07d8de24 ci: a UI preview goes by the diff, not the PR's description — on #287 the description (out of date) promised a 用量小数位 setting the code doesn't have, and the preview repeated it as the change, captioned a screenshot "默认 0 位" of a setting that wasn't there. The planner is told the description may be wrong, to plan and summarise from the diff, and what the sandbox lacks (subscription quotas above all); the preview now says, apart from the summary (改动(按代码)), where the description and the code disagree (描述与代码不符) and what the sandbox can't show (沙盒里看不到). Tested locally with run.sh on #287's code: it names the missing setting, says the sandbox has only a DeepSeek balance and no percentage windows, and shows the two places the change would be. 2026-09-30 15:45:23 +08:00
yetone 795a4d7130 ci: the UI preview checks out a fork's PR — actions/checkout now refuses fork code under pull_request_target unless told allow-unsafe-pr-checkout, and every fork PR failed there (#287, run 36682482508); #289 came from a branch here, so it passed. The record job is the one meant to run the PR's code: read-only token, no credentials kept. 2026-09-30 15:34:30 +08:00
yetone 190248d204 ci: the UI preview records without waiting for approval (the user: 去掉批准吧) — the ui-preview environment keeps the DeepSeek key but no longer names a reviewer; the comments and the "recording" note stop mentioning one. 2026-09-30 15:07:06 +08:00
yetone e79343b1bb ci: the UI preview's planner is shown how to reach what the PR changes — the pages are outlined closed, so on #289 (a hover colour inside an agent's model list) it once said nothing visible changed and once opened the drag handle's menu instead. It now also gets the PR's own front-end code around the diff: where the changed classes and functions are built and, two hops up, what calls them (here modelsEntry's .ag-models button opening openAgentModels), and is told that something missing from the outlines is to be opened, not taken as absent. A close-up no longer fails on clip (declared inside the try it was read after), and a DeepSeek reply that is cut short or not JSON is asked for again instead of ending the repair. Tested locally with run.sh on #289's source: 2 screenshots of the list, the button red on hover, and the video, no errors. 2026-09-30 14:40:04 +08:00
yetone 3a193423b6 ci: a UI preview's close-up keeps what's around the thing it shows (at least 560×340) and no screenshot is stretched past its own size in the PR — the first real run (#289) cropped a hover to the button alone, 100×68, then showed it 760 wide. Checked on #289 with workflow_dispatch. 2026-09-30 14:27:19 +08:00
yetone 7396b11998 ci: a pull request that changes the UI shows it — the real app built from the PR, run with a real DeepSeek key, screenshots and, when the change spans pages or needs clicking, an mp4 recording with the pointer, its trail and every click drawn in, in a fixed block at the foot of the PR's description (the user: 如果某个PR涉及了UI/UX改动,那么就把这个PR中的Magpie真实的运行起来…录屏中一定要画出鼠标指针的位置,以及鼠标的轨迹,以及鼠标的点击; 一定要贴在原始的PR Description的下面的固定区域).
.github/workflows/ui-preview.yml, on pull_request_target or by hand (-f pr=N): detect (internal/gui/assets/, the GUI's non-test Go, or the ui-preview label) puts a "recording" note in the block; record, behind the ui-preview environment's approval since PRs come from forks, builds the PR's magpie (nogui), runs `magpie web` in a fresh home with DeepSeek added and a few requests sent through the gateway, and has DeepSeek plan from the diff and the pages' real outlines what to click and capture (record.mjs, Chromium at 2x, cursor.js drawing the mouse); publish, which never runs the PR's code, puts the files on the ui-previews branch served by Pages and rewrites only the block between <!-- magpie-ui-preview:begin/end --> — the video's poster links to its player page, since GitHub embeds no video it didn't host. Captions say what is being done, never what should come of it. Anything on screen matching the key or the web link's key throws the whole recording away.

Tested locally with run.sh on 033a151's diff in a sandbox home: 3 screenshots and a 16 s mp4 of the Codex model list's 全部隐藏/全部显示, pointer, trail and clicks visible; actionlint passes. Not yet run on GitHub.
2026-09-30 14:22:13 +08:00