The feature is called the MCP router now (the commit before). The docs
pages move to mcp-router.html in en, zh and ja, their wording follows
(MCP router / MCP 路由 / MCP ルーター, `magpie library mcp router on|off`),
and every docs page's link and canonical/hreflang URL points at the new
path. The worker answers /docs/mcp-hub, /docs/zh/mcp-hub and
/docs/ja/mcp-hub (with or without .html or a trailing slash) with a 301
to the new page, keeping the query, so links already shared still open.
The plugins pages' link to the router page (Search1API's tools,
from the rebase) follows too.
Run at e2583df31 (this stack on 86fef947e), on mote: gofmt -l clean;
go vet for darwin, linux (-tags nogui) and windows; go build ./...;
go test -tags nogui ./... -timeout 45m, 81 packages ok, 0 FAIL;
library, gateway, imagemcp, sessions, cli and gui again alone, ok;
site's node --test, 49 of 49. GUI on xiaomi-gpu (Windows; mote's
browsers crashed under other sessions' suites): library-*, image*,
mcp-hub-direct, i18n-keys, list-sort and plugin-tools, both engines and
every language, 1055 of 1056: i18n-keys found "{name} is given to each
agent directly" dropped from the library's strings in the rebase. Put
back in the first commit; at the pushed head i18n-keys, mcp-hub-direct
and library-mcp-hub are 48 of 48. That is the only difference from
e2583df31.
Broken by hand at e2583df31: imagemcp ignoring magpie/roots fails
TestHubCallSavesInTheCallersProject; the router asking anything but
roots/list fails TestHubAsksTheAgentItsRoots and TestHubRootsUnasked;
inHub leaving magpie-image out fails TestHubGivesMagpieImage.
Checked: no 聚合, ハブ or mcp-hub left under site/ except the redirect.
The worker's redirect test fails without the redirect line (not ok 7).
Rebased once more onto 2570efb5f, which changed library-mcp-hub,
list-sort, mcp-hub-direct and gateway-routing.md. Run at the pushed
head: go build; gateway, library, cli and imagemcp tests ok; the GUI
budget tests ok; on xiaomi-gpu i18n-keys, mcp-hub-direct,
library-mcp-hub and list-sort, 51 of 54. The three reds were WebKit
420px library-mcp-hub cases with no Connect sheet after a reload.
origin/main d77da5bff goes red the same way (de 420px, 9 of 11). In a
second run of library-mcp-hub on WebKit at this head, 11 of 11 passed.
Filed as #4483.
A blocker that knows posthog.com dropped every count of the pages, so the
snippet's api_host is now this site's /r/: relay passes the library and
its config on to PostHog's assets host and the rest to its ingestion
host, with the visitor's address as X-Forwarded-For (PostHog's country)
and without the site's cookies. ui_host stays PostHog's.
Downloads weren't in PostHog at all: /download/* and install.sh are now
counted server-side, as "magpie site download" (link, file, country,
browser or command) and "magpie site install script", each under an id
of its own like the partner counts. A HEAD, or a file the release
doesn't have, isn't counted. The privacy pages (en, zh, ja) say both.
Run: node --test site/worker.test.mjs site/install.test.mjs
site/stable.test.mjs on mote, 48 pass. Broken by hand (no
X-Forwarded-For, the Cookie passed on, the download count off): the
relay and download tests went red. A Playwright page with the snippet
and every posthog.com request aborted (a blocker): Chromium on mote and
WebKit on xiaomi-gpu (mote's WebKit wouldn't launch at load 28) sent
$pageview, $autocapture, $snapshot, $$heatmap and $web_vitals through
/r/ alone, nothing blocked; under GPC nothing was fetched.
The owner asked for every dimension. The snippet now captures dead clicks,
uncaught errors, network timings with Web Vitals, and a session recording
with every input masked. advanced_disable_flags is gone, since the
recording, heatmaps and the other switches arrive in the project's remote
config. The project's settings were changed to match: cookieless off,
session recording, heatmaps, Web Vitals, exception autocapture and dead
clicks on, recordings masking all inputs. The privacy pages (en, zh, ja)
list what is sent now.
Run on mote: a Playwright page with the worker's snippet, Chromium and
WebKit x normal/DNT/GPC, events intercepted, remote config and recorder
from the real project. Normal: $pageview, $autocapture, $$heatmap,
$web_vitals and $snapshot sent, no cookies, one ph_* localStorage key;
text typed in an input appears in no payload, and in Chromium's
recording it is a 12-star mask. DNT and GPC: nothing fetched or sent.
node --test site/worker.test.mjs site/install.test.mjs site/stable.test.mjs:
45 pass.
Cookieless mode drops the address before GeoIP, so the dashboard had no
country, and a visitor's id changed daily. The snippet now keeps its id in
localStorage (never a cookie: the pages vary on Cookie for the lang
redirect), and adds autocapture with heatmaps and Web Vitals. No
recordings, and still nothing loaded under DNT or GPC. The privacy pages
(en, zh, ja) say what is sent now.
Run on mote: a Playwright page with the worker's snippet, Chromium and
WebKit x normal/DNT/GPC. Normal: $pageview and $autocapture sent with a
uuid distinct_id, no cookies, one ph_* localStorage key, typed input text
not in any event. DNT and GPC: the library isn't fetched, nothing sent.
Headless Chromium needed opt_out_useragent_filter in the harness only.
node --test site/worker.test.mjs site/install.test.mjs site/stable.test.mjs:
45 pass.
usemagpie.ai's pages now load PostHog beside Cloudflare Web Analytics,
injected where the beacon is (worker.js, every HTML response). It runs
with cookieless_mode "always" (nothing in cookies, localStorage or
sessionStorage), page views and page leaves only (no autocapture,
recordings, surveys or flags), in the daily count's project. Under Do
Not Track or Global Privacy Control the script isn't loaded at all:
respect_dnt alone doesn't stop a cookieless capture. The privacy page
(en, zh, ja) says what PostHog gets.
The project's cookieless tracking setting must be on, or PostHog drops
these events.
Run on mote: node --test site/worker.test.mjs site/install.test.mjs
site/stable.test.mjs, 45 pass. A Playwright check (Chromium and WebKit)
loaded the snippet, routed us.i.posthog.com, gunzipped the batch: one
$pageview with distinct_id $posthog_cookieless, no cookies, nothing in
either storage. With doNotTrack "1" and with globalPrivacyControl, no
request and posthog not loaded. Broken by hand: respect_dnt alone still
sent under DNT; Playwright's webdriver flag trips posthog's bot filter,
so the check hid it.
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. This
is the feed side of Settings' Update channel: /api/latest?channel=stable.
How Stable is chosen (stableOf, from the release list, never by hand):
- as each week begins (Monday 00:00 UTC), the newest release that had
been out three days by then (published <= Monday - 3 days);
- an urgent release is Stable as soon as it is out, until a weekly pick
passes it.
A release is urgent when a line of its notes starts with
"**Urgent release:** <why>" (quoted or not). GitHub releases are not
marked pre-release for any of this.
GitHub's newest 100 releases are about a day of magpie, so a KV ledger
(LEDGER, usemagpie-ledger) keeps 45 days of {version, published, urgent}
and each day's notes, filled by a cron every 15 minutes: the API's first
page (the releases feed when the API says no, keeping the ledger's dates
and API notes), the pages after it while there is a hole, and on back to
21 days, at most four API asks a run, writing only what changed. A
ledger that can't be read is never written over. /api/notes reads a
range older than the newest 100 on from the ledger, so a Stable app's
week of notes comes as one list. Without a ledger reaching the week's
cut, the stable feed answers 503 (no-store) rather than guess. The
default feed, and any other channel value, is unchanged.
Run: node --test site/*.test.mjs (stable.test.mjs 14 new, every clock
held: weekStart, the cut to the second, a week held and moved on, urgent
before/after its time, unknown, the ledger's paging, hole, ask cap,
broken KV, API-limited feed fallback, notes past the 100 newest; the
existing worker and install tests 31 pass). wrangler deploy --dry-run
shows the LEDGER binding.
Broken by hand, each red: no soak, a rolling 3 days instead of the week,
urgent ignored, no ledger notes, a broken read taken as empty, the
feed's date or notes over the API's, notes bucketed by the feed's date,
no hole mending, no ask cap, the index always rewritten, the marker
matched mid-line.
Not tried: a real cron run before this deploy; the anonymous API's
60/hour limit under the cron's asks beyond reasoning (one ask a run once
the ledger is deep).
Requested by ssharpcc on X.
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 d08b6118b did, so app.js stays under its
budget (1,319,177 of 1,321,336); no budget raised.
- i18n: three strings in zh, zh-TW, ja and de.
Run at the pushed head (rebased on origin/main 0d2a10116):
- go test -count=1 -tags nogui ./internal/update/ ./internal/gui/ in a
sandbox HOME: ok (TestNotesBack, TestWhatsNewBackRanges,
TestCoreScriptBudget among them).
- gofmt -l: none. go build ./...; go vet ./...; GOOS=linux go vet -tags
nogui ./...; GOOS=windows go vet ./...: ok.
- node --test site/worker.test.mjs: 21 pass (new: limit keeps the
newest that many up to upto; "", 0, x and -1 mean no limit).
- GUI at this head, both engines: whats-new-range (new), whats-new,
whats-new-failed, i18n-keys, ledger-cache-unknown, request-archive and
request-archive-usage (the Usage page holds the moved helpers): 50 of
50. whats-new-range.test.cjs alone is 12 of 12: five languages x two
engines plus the post-update dialog in both. Covers the default label
and no last= asked, the menu's head and five items, 10 then 100,
the same pick asking nothing, a failed 50 keeping the 100 shown with
the error above, Try again, no scroll, no left-border accent, and a
440px window with the pill inside the dialog.
- Whole GUI suite (869 files), chromium then webkit, concurrency 4:
still running at push time, started at 1f156ba40 (the same change on
e57e78563); the tree was rebased under it at 01:45. Chromium at 01:46:
1725 top-level tests passed, 7 red, none in a What's new or Usage file:
agents' sign-ins, Plugins › Built-in, zh-TW 420px context map, gateway
mode, an MCP server out of the library, and "a menu opened from a long
text box's rule stays open" (en, zh). They will be checked against
origin/main and filed or fixed when the run ends. Before the rebase,
usage-ledger's "newest live route needs no return-to-live button" was
red here and on an origin/main e57e78563 copy alike (#3104, #3001).
Broken by hand, each red, then restored:
- the pill not added to the head: whats-new-range red.
- the kept notes not used on a failure: red at "the notes shown before
are kept".
- the ?last= route skipped: TestWhatsNewBackRanges red.
- Back not cutting to n+1: TestNotesBack red.
Not tried:
- the real site: the test fakes /api/notes and /api/whatsnew. The site
holds GitHub's newest 100 releases, so "100 before" on the newest
version can show at most 100. An undeployed site ignores limit; the
app cuts the list itself.
- the real app window (Wails/WebKitGTK); only Playwright's engines.
- go test ./... in full was not run: the machine had a queue of other
sessions' full suites, and the owner's rule is not to hold a verified
commit behind one.
Known limits: a range view carries no pending (waiting update) notes;
if a longer cached range dropped an Install-only release, a range cut
from it can reach one release further back than a fresh ask would.
The feed sends a partner's website through usemagpie.ai/go/<id>/site so
the visit is counted, and the provider editor's "↗" link read its host:
Kimi Code's editor said "usemagpie.ai ↗" where Kimi asked for
"www.kimi.com ↗". The worker now sends the website's own host beside it
as siteHost (partner and region), the app keeps it on the PresetDef and
Region, and the editor's link reads siteHost first, following the region
picked. The click still opens the /go link.
app.js grows 102 bytes; both budgets are raised by exactly that, no room
added.
Run at origin/main be002aca0 (this commit's parent):
- site: node --test worker.test.mjs 20/20 (new siteHost asserts).
- go test ./internal/provider -run 'Partner|Preset' ok; TestPartnersFromTheFeed
checks siteHost survives the partner leaving the feed and a restart.
- go test ./internal/gui ok (budgets).
- partners.test.cjs 30/30, chromium and webkit, en/zh; red on the old
label code (read "usemagpie.ai ↗").
- 86-file GUI run (editor header and every file it can reach): 1117/1118;
the red is sessions-codex-provider chromium zh's nav click at 5s under
load, 4/4 alone three times, filed as #3360.
- gofmt clean; GOOS=windows go vet ./internal/provider ./internal/gui ok.
Not tried: the live app; it needs this release and the worker deploy.
The home page's "Sponsored by" cards and the READMEs' Sponsors logo linked
the sponsors directly, so nothing told the owner how many clicks each seat
brought. They now link /go/<id>/home and https://usemagpie.ai/go/<id>/readme.
site/sponsors.js holds where each sends the browser (the sponsor's own ref
link, unchanged: APINEBULA has one per place). The worker counts a GET as
"magpie sponsor go" {id, where, country} in PostHog, beside the in-app
partners' "magpie partner go" (whose /go links were already counted), and a
HEAD goes on uncounted. A partner's keys/site links are tried first; a
sponsor link takes no region.
A test fails if index.html or either README links a sponsor's own URL
directly, or names a /go link sponsors.js doesn't have.
Run: node --test site/worker.test.mjs (20 pass) and site/install.test.mjs
(10 pass). Broke it by hand: README.zh-CN.md back on the direct link turns
the guard red. Deployed (version e4f40cff); curl on usemagpie.ai:
/go/apinebula/readme → 302 apinebula.ai/ref/qmXqFGpr, /go/apinebula/home →
302 apinebula.ai/ref/Gs54HwyB, /go/yylx/home → 302 yylx.io/?ref=magpie,
/go/yylx/readme and /go/apinebula/home/x → 404; / and /zh/ serve the /go
hrefs. Not checked: the events arriving in PostHog (the worker's key can't
read).
A plugin's package.json icon, an import link's icon= and the library's
market icons sit on hosts their authors pick. magpie fetched each straight
from there, so an author could log the IP of everyone who opened Discover
or the library. The owner asked for icons to keep showing without that.
- site/worker.js: /api/icon?url=<https URL> fetches the picture from
Cloudflare with only Accept: image/* and its own User-Agent, follows
redirects, caps it at 1 MB (the app's MaxIcon), passes on only PNG,
JPEG, GIF, WebP, ICO or SVG (by bytes, as StoreIcon), and counts and
keeps nothing. It refuses http, userinfo, a non-443 port and
usemagpie.ai itself; 404s are cached 5 minutes, 5xx not at all.
- internal/iconproxy: URL(u) is the proxied address (MAGPIE_ICON_PROXY
for tests); a picture already on usemagpie.ai is asked for as it is.
- provider.FetchIcon (plugin, import link and partner icons) and
library.fetchImage (market icons, avatars) fetch through it. The
import link's checks (https, public host) still come first; there is
no direct fallback. provider.FaviconFor still reads the user's own
provider's site directly: they already send it their requests.
- Privacy text in README en/zh, docs/reference.md and site docs
start/import in en/zh/ja says so.
Ran:
- node --test site/*.test.mjs: 28 pass. The new test asks with Cookie,
UA, X-Forwarded-For and CF-Connecting-IP and checks only accept and
user-agent go upstream; 415/413/502/400 cases; its fetch stub throws
instead of reaching the network. With the usemagpie.ai refusal
removed by hand it goes red (27/1).
- TestFetchIconGoesThroughTheProxy and TestIconGoesThroughTheProxy
(author host is .invalid; an httptest server stands in for the proxy):
with the proxy taken out by hand both go red (provider: lookup
author.invalid; library: the proxy was never asked), green restored.
- go test ./internal/iconproxy ./internal/provider ./internal/library
./internal/gui: ok. gofmt -l clean; go vet darwin (those four),
linux (iconproxy, provider, library), windows (all four): clean.
goTarget adds ref=magpie to the partner's key page or website, keeping the
address's own query and fragment; an address that names its own ref (a
referral code) keeps it as it is. The home page's sponsor card links to
yylx.io/?ref=magpie.
Run: node --test site/*.test.mjs (27 pass), with new cases for the query,
the fragment and a partner's own ref.
The app's own partner counts only come from users who leave the stats on,
so a sponsor's reach and clicks are now also counted where the server sees
them. /api/partners hands out each partner's website and keysUrl (and a
region's) as usemagpie.ai/go/<id>/site|keys[/<region>]; /go sends a
"magpie partner go" event to PostHog (partner, link, region, country) and
302s to partners.js's own URL. One in ten list fetches sends "magpie
partners fetch" with weight 10 while someone is listed. Events carry a
random id each, no install id or address. Ended entries leave the list but
/go still resolves them, since added providers keep the links. Privacy text
updated in README (en, zh), docs/reference.md and the site docs (en, zh, ja).
Run: node --test site/*.test.mjs (27 pass); a scratch copy with a fake
partner served rewritten links, 302'd /go to the real URLs and posted both
events; PostHog's /i/v0/e/ answered 200 to the payload shape.
The app fetches the list behind the call every 6 hours (10 minutes after a
failure), never waiting, and keeps it in the cache folder. Each entry is
checked: its own id, never a built-in preset's; a name and an endpoint;
https only; at most 12; no decision API, no-key or user endpoint. Its logo
goes through FetchIcon. A partner is a preset to the rest of magpie, and
one that has left still is to the providers added from it, unsponsored.
The window lists a partner in the languages it names only, with its tagline
in the page's language; `magpie presets` and the TUI list them first too.
MAGPIE_PARTNERS moves the list, off lists none.
Run: go test -tags nogui -race ./internal/provider ./internal/gui
./internal/tui . (ok); TestPartners* -race -count=3; node --test
internal/gui/tests/partners.test.cjs add-sheet gui-ja gui-de i18n-keys in
Chromium and WebKit (en/zh/ja/de, 900 and 440px); node --test
site/worker.test.mjs site/install.test.mjs; the built binary in a sandbox
HOME against a local feed: listed, an http entry left out, listed from the
cache with the site down, `provider add` from it.
* Add German translation and harden paths against unset env vars
Add a German locale to the GUI, tray menu, usage alerts and website home page, and refuse to start when the home folder is unset or relative so nothing is written under the working folder; the pi plugin no longer adopts the user's PI_CODING_AGENT_DIR, and an inherited APPIMAGE no longer selects portable mode. Scripts refuse to run from the wrong folder or empty a shared out folder, and a new internal/testenv sandboxes every test package from the user's real files, which also fixes the Claude picker and Termux installer tests on Windows.
* Makefile: know magpie's folder by its go.mod, so paths with spaces work
The check compared $(CURDIR) with $(dir $(abspath …)), which make splits on spaces, so a checkout under 'My Projects' or 'John Doe' refused every target. It now reads go.mod relative to the working folder and wants magpie's module there: make -C and a symlinked Makefile work, make -f from another folder still stops before any recipe runs.
* i18n: German for the strings main added since, with a parity test
75 strings main added (group order, patterns, slow-start wait, usage caps, RTK savings …) get their German, and two that main dropped go. gui-de.test.cjs checks, as gui-ja does, that de has every zh string with its placeholders and tags, and that the window reads in German when picked or on a German system.
* appdir: ignore relative folder variables when reading, keep them for children
CheckEnv no longer unsets anything. magpie reads the XDG folders, APPDATA/LOCALAPPDATA and every agent's folder variable through appdir.Getenv/LookupEnv, which pass over a relative value; the environment stays as it is, so the agents magpie starts get the variable as the user set it. That covers what proc.UserPath lends from the login shell too, which is set after main's check and reached the desktop app unchecked. On Windows a path rooted on the current drive (\Users\x, Git Bash's /c/x) counts as usable, and magpie version and help answer without a home, before run makes any folder.
* Sandbox the tests main added since
internal/wslrun gets testenv's TestMain, and four tests main added that set HOME alone set their home with testenv.SetHome, so on Windows they don't read the runner's profile through USERPROFILE.
* agentenv: PI_CONFIG_DIR and OPENCODE_DB take relative names on purpose
omp puts $PI_CONFIG_DIR under the home and OpenCode a relative $OPENCODE_DB in its data folder, so neither depends on the working folder: appdir no longer passes them over.
* i18n: German for the Library's multi-select and System One's decision API
The 19 strings main added since (#791's skill multi-select, the decision API snippets) get their German; the one main replaced (four APIs → five APIs) goes.
* appdir: tidy the import into magpie's group; say what Go makes of /c/x
The appdir import joins the group of magpie's own imports where a file has one. rooted's comment now says that Go takes a Git Bash path like /c/x as \c\x on the current drive, not C:\x.
The download button follows the visitor's OS, a platform list sits under
the final call to action, /download/{windows,linux}[-arm64] redirect to
the builds, and install.sh installs the Linux desktop app, with a menu
entry, when WebKitGTK 4.1 is present.
site/ is the website: a static page plus a worker that turns the newest
release of yetone/magpie-releases into an update feed (/api/latest, with
every file's SHA-256), stable download links and an install script.
The app asks the feed at start-up and every six hours, downloads a newer
version in the background, and installs it on Restart to Update or on
quit. A download must match its checksum and be signed by the same team
as the app it replaces. `magpie update` does the same from a terminal and
replaces a bare binary in place.