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.
CyberCaius (Discord) asked what the Library's MCP hub is for. The page
says what the switch does, how to turn it on (GUI and
`magpie library mcp hub on|off`), the /mcp/magpie/hub address for other
apps, which agents keep their own entries and why, and when to leave it
off. Facts from docs/subsystems/mcp-hub.md and internal/library/mcp_hub.go.
Every docs page's nav and footer link it after Privacy masking.
Run: site's node --test on mote from the repo root, 45 of 45 pass.
YH31377807 on X asked how to use magpie's local masking (咋用?能出个
教程吗?). The docs had only a short section on the Privacy page.
/docs/masking, /docs/zh/masking and /docs/ja/masking: turning it on in
Settings › Privacy, settings.json for magpie serve and Docker (no CLI
command exists), what each switch masks, an example, how to check it
(Try it, the shield badge on Gateway and Routing, Insights › Masking,
~/.config/magpie/masking), Mask/Warn/Block and Never mask, and limits.
Each docs page's nav and footer link it; the Privacy pages' masking
section points to it.
Checked against the source: the secret rules and personal kinds in
internal/redact/redact.go and more.go (Categories and their defaults),
masking.Wanted and options in internal/masking, the sealed/kept keys in
redact/json.go, Hint for the Block message, gwmw.ErrUnmasked (503) and
maskBlocked (400), the GUI labels from index.html/app.js and their zh and
ja strings in i18n.js, plugins/redact's name. The example's output is
redact.Preview's on that text, run in a throwaway test (placeholders
differ per run's key).
Run: node --test site/worker.test.mjs site/install.test.mjs (31 pass).
The three pages rendered in Chromium and WebKit at 390 and 1280 px with
no horizontal scroll and no page errors; tags balanced.
Not tried: the GUI itself; labels read from source.
A routing group's intent classifier (askChat) and System One (askJev)
were each given a fixed 8s. A slow subscription classifier can now be
given longer in Settings > Models > Replies > Intent classifier timeout.
settings.json's classifyTimeout takes 1..60 seconds; 0 or missing keeps
8s. save() refuses below 0 or above 60, and ClassifyWait clamps a value
edited by hand (below 1 gives 8s, above 60 gives 60s). A settings file
that can't be read gives Shared()'s defaults, so 8s, never no timeout.
Both askChat and askJev read it per call. The GUI row is the app's own
segmented control (8, 15, 30, 60, plus a value set by hand), and other
saves carry the value on (prefsKeep, api.go). zh, zh-TW, ja and de
strings; the routing reference and the en, zh, ja docs say it.
Ported from reyoung's classify-timeout-2934 (author kept). On top:
- askJev's defer reworded any error once ctx had expired, so a refusal
(decideRefused) or an answerError read as the wait ran out lost the
type askDecideTries rests an account by. Now only errNoAnswer, which
systemOne returns when postDecide failed with ctx done, is reworded
to "<provider> gave no answer in <wait>".
- ja intent.html: a stray space in "遅いモデルだと 設定した".
- app.js: the Image generation timeout row and the new row share
waitRow (~350 bytes less). TestCoreScriptBudget was red (app.js
1,337,982 > 1,337,000); budgets raised to the exact sizes, app.js
1,337,633 and core 1,529,393, no room added.
Run (macOS, Go env pinned, sandbox HOME):
- Full go test -tags nogui -timeout 45m ./... at 766cf1cf9: 68 packages
ok; internal/gui red on TestCoreScriptBudget only, fixed above.
- At ed008ca9f and again after rebasing on 65e80405b: internal/gateway,
internal/settings, internal/gui ok; gofmt -l clean; go vet (darwin),
GOOS=linux go vet -tags nogui, GOOS=windows go vet all ok.
- Whole GUI suite at ed008ca9f, chromium and webkit, 4 wide at load
~30: 11,930 tests, 52 red, none in the files this change reaches
(classify-timeout-setting, image-timeout, i18n-keys all pass). The
red files rerun alone: 44 red in 10 files, the same 44 on origin/main
65e80405b. All have issues (#2228, #2399, #2150, #2448, #2276, #3091,
#2549, #2163, #3099, #3104) except library-mcp-health-wsl's ja case,
filed as #3350.
Broken by hand, each red then restored:
- classifyTimeout fixed at 8: TestClassifierTimeoutSetting and
TestJevGivenTheClassifierTimeout red.
- askJev fixed at 8: TestJevGivenTheClassifierTimeout red.
- save()'s bound removed: TestClassifyTimeoutKeptAndBounded (-1
accepted) and TestSettingsClassifyTimeout (61 gives 200) red.
- ClassifyWait's clamp removed: red (600 waits 10m0s).
- api.go's keep removed: TestSettingsClassifyTimeout red.
- prefsKeep's classifyTimeout removed: the GUI test's "sent on with
other saves" red in chromium and webkit.
Not tried: a real slow classifier or account; Linux and Windows at
run time; the native Linux desktop build; a test that pins the askJev
refusal-at-deadline race (it is timing-only, so no deterministic red
was written for it).
dengtongcai asked for a routing rule that picks both the model and the
reasoning it is asked for (a quick question goes to a cheap model at low).
A rule now has an output field, useEffort (low|medium|high|xhigh|max). When
the rule matches, its member is asked for that effort. A member's own fixed
effort still wins. Otherwise the rule beats the model's suffix, the turn's
pick and the agent's pick. The existing effort condition is unchanged.
- The value is fitted to the model's levels (max -> high on a model that
tops out at high). A model with no Efforts is sent what the agent asked,
untouched. Unset changes nothing. Failover members are not affected.
- The trace records it: Rule.UseEffort and the try's RuleEffort (the second
Try construction in the candidate loop was missing it).
- Saving a group rejects an unknown value or one on a pause (cleanRules).
The CLI takes use-effort=; the TUI and CLI lists show " at <effort>".
- GUI: a chip after the rule's model, picked from the app menu (pickFrom,
no native select), set/changed from the rule's menu. A pause clears it.
Strings in zh, zh-TW, ja, de.
- A Gemini-protocol client is left unchanged, as with every effort magpie
sets.
- Docs: docs/subsystems/gateway-routing.md; site docs intent and start (en,
zh, ja).
What was run, at d4c03a2c5 (rebased on d4a1b9baa) unless said:
- gofmt -l: none. go vet ./... (darwin), GOOS=linux and GOOS=windows
go vet -tags nogui ./...: clean.
- go test -count=1 ./internal/gateway ./internal/provider ./internal/cli
./internal/tui: ok.
- The full go test -timeout 45m ./... under pipefail, before the rebase at
6f950653f: every package ok except internal/gui. There, 8 real-window
darwin tests were killed at their deadlines with the load average at
150-300. Four passed on a rerun. TestMainWindowCorners,
TestMainWindowRightToLeft, TestTrayCellClickReleasedPanel and
TestCoveredWindowStaysUp fail the same way on a clean 6f950653f checkout
(added to #1936). This change has no Go in internal/gui.
- Broken by hand: ruleEffort returning "" turns the four gateway tests red
(Chat member, intent rule, failover member, Anthropic member). Returning
the raw value for a model with no levels turns the unset/no-levels test
red. Dropping the cleanRules checks turns TestCleanRulesUseEffort red.
routing-rule-effort.test.cjs against the 6f950653f routing client.js and
i18n.js is red.
- GUI: routing-rule-effort.test.cjs passes 18/18 in chromium and webkit
(en, zh, zh-TW, ja, de; 1100 and 420 wide). The 140 GUI files that open
the Routing view ran 560 tests before the run stopped with no summary.
Two of the 560 were red: group-from-model-add (#2388) and
name-suffix-where-named (filed #2640, a skeleton-row race). Both pass
alone. The whole 791-file suite was not finished. At a load near 280 it
covered about 20 files in 40 minutes. The reds it showed were in
account-* files, and account-models passes 12/12 alone.
- Then rebased onto 8bb9375e7 (#2635, internal/library only) and
go build ./... at the final head.
The rules editor drew every condition of every rule as an empty box to
fill (tokens, images, effort, agents, intent, compact, folders, hours),
then "send to" and the model, with Move up / Remove as words and two
paragraphs of help below. Three intent rules took ~600px and the intent
itself was cut at 24ch. The owner: "现在这个页面太复杂了,用户要输入、
填写这么多东西,太恐怖了。"
Now each rule is one line, read as a sentence:
1 asks for <intent…> + → [model] ⋯
- Only the conditions a rule has are drawn, in the rule's own order;
each has a × (shown on hover or focus, always on touch) that clears it
back to "not set". The rule's + opens the app menu (openProtoMenu,
never a native select) with the conditions it doesn't have yet; a
pause is offered only the conditions a pause can hold by.
- "→ model" sits in its own grid column (subgrid), so it lines up
across rules whatever the conditions' widths; under 640px it wraps
under the conditions.
- The intent is a one-row textarea that grows with its words (a hidden
copy sizes it), so the whole intent shows and wraps; Enter and pasted
newlines stay one line, as saved before.
- Folder boxes size to their text (canvas-measured with the box's own
font, +8px so the caret never scrolls the text inside).
- Sending is the default and goes unsaid; a pause says "pause" before
its model. The ⋯ menu holds Move up, Move down, Send to / Pause the
model instead, and Remove rule.
- "Add a rule" starts a rule with the intent box ready. The two
help paragraphs became an ⓘ beside it, and beside Effort and the
intent model.
- Saved data is unchanged: an unchanged editor saves the same rules
field for field (routing-rules-line round-trips the old assets too).
Docs: intent.html and start.html (en, zh, ja) say where Add a rule's
intent box and the ⋯ menu's pause now are. The /img/intent-rules-*.png
screenshots still show the old editor; not regenerated here.
Run:
- New routing-rules-line.test.cjs: every condition drawn in order, none
empty, + menu (app menu, not select), × removes, ⋯ moves, no overflow
or sideways scroll; Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and
390px. Broken by hand, it went red.
- Updated routing-intent-entry, routing-compact, routing-pause,
routing-pause-folder, routing-time; with routing-folder,
routing-manual, routing-levels, own-requests, i18n-keys, click-scroll
and every *menu* test: all pass in both engines but
removed-groups-menu-scroll, red 1-2 of 8 per run on a4d580fa2's
assets too.
- The full routing-*/group-*/images-* GUI set (1261 tests, both engines,
concurrency 6): reds outside the editor (routing-days-fit,
-agent-gone, -agent-hue-not-red, -burst-speed, -failed-open,
-keys-fold, -model-rest, -side-calls, -wb-restricted, group-found-off)
fail the same on a4d580fa2's assets run alone here. Of the editor's
own reds in that run, two were the tests' clicks (now wheeled to, both
ways). The third was real: in WebKit routing-pause-folder's ⋯ menu shut
at once, because the folder box's text had scrolled inside it. The box
now has room for the caret; the next commit fixes the menu itself.
- go test ./internal/gui: ok.
- Shots: zh 1000px before/after, en 390 WebKit, zh 390 Chromium, dark.
Not tried: the real Wails window, the Windows box, a WebKitGTK without
subgrid (falls back to unaligned columns), the docs images.
#1986 asked what the daily count sends, where the id lives and how to stop
it. The answer was spread over one README paragraph and the reference. A
new page, /docs/privacy (en, zh, ja), lists it from the code:
- the daily PostHog batch (internal/stats): a whole example, the label
rules for agents/providers/models, partner counts, the
$process_person_profile:false flag;
- every switch: Settings -> Privacy's two toggles, noStats/noUsageStats,
DO_NOT_TRACK / MAGPIE_NO_STATS, noAutoUpdate (About -> Automatic
updates), and that a change applies at the next hourly look;
- the files: install-id (made at the first send, not at first run, as the
issue said) and stats-sent in settings.Dir(), partner-counts.json in
the cache folder, their paths per OS and portable, and deleting them;
- what usemagpie.ai sees whatever the settings (update feed every 6h,
notes, partner list with its 1-in-10 sampled count, /go links, the icon
proxy) and the Cloudflare Web Analytics on the site's own pages;
- public lists fetched (models.dev, open.er-api.com, npm, GitHub) and
providers' quota reads with the user's own accounts;
- OTLP export, off by default, its env vars;
- why the count stays on by default in releases.
Every docs page in all three languages gets a Privacy link in its nav and
footer. README (en, zh) and start.html's "What does magpie send about
me?" (en, zh, ja) link to the page. docs/reference.md's Files list gains
install-id, stats-sent and partner-counts.json, and Counting users says
when the id is made, the hourly try, and links the page.
Checked against: internal/stats/stats.go, usage.go,
provider/partner_events.go, settings (NoStats, NoUsageStats,
NoAutoUpdate, UpdateEvery 360, otel.go), appdir, update, fx, catalog,
site/worker.js, and the GUI's Settings tabs/labels in index.html, app.js
and i18n.js (zh, ja).
Run: Playwright (Chromium and WebKit) on all three pages at 1100 and 420
wide, light and dark: no horizontal scroll, no element past the viewport,
no page errors (24/24), screenshots looked at for zh at 420 dark. Every
href/anchor in site/public/docs resolves; relative links in README and
reference resolve. node site/worker.test.mjs passes.
Not run: the page on the deployed worker (the site deploys by hand with
wrangler, so it is live at the next deploy); the language redirect for
/docs/privacy was not exercised beyond the worker's existing tests.
Until now, both were only in docs/reference.md. The new pages are at
/docs/docker, /docs/remote and their zh/ and ja/ versions.
- docker: the image, its tags, ports, the /config volume and the nonroot
user. How to run it with the browser UI (`web --addr 0.0.0.0:3430
--no-open`, MAGPIE_WEB_KEY, the ?k= cookie). Signing in through the
Callback URL paste or `docker exec ... magpie accounts add`. What
/config keeps, the env vars, sharing with gateway keys, and a Compose
file for a NAS. Healthcheck and updates.
- remote: sharing the main magpie, then adding it as a Remote magpie
from the app, the TUI (a/w/m) or `magpie provider add remote-magpie
<key> url=... id=office`. What comes over (models, groups, APIs,
images, System One, embeddings, prices, quotas) and the errors magpie
shows, quoted from remote_quotas.go and lan.go.
The facts were checked against the code, not reference.md:
- the Dockerfile ENV, VOLUME, HEALTHCHECK and EXPOSE;
- docker.yml's tags;
- web_cli.go;
- the lanGuard in internal/gateway/lan.go;
- the remote-magpie preset.
The Docker page's warning says a Docker gateway answers anyone until
sharing is on, because MAGPIE_ADDR is 0.0.0.0 there.
The new links in the top nav bar carry a toc-only class:
- docs.js still lists them in the contents;
- the bar keeps today's width, since nine links overflowed it at
1024-1280px.
`.steps li` gets min-width: 0, so a long inline code no longer widens
the grid past a phone's width, where `overflow: hidden` clipped the
text.
Run:
- Real containers from ghcr.io/yetone/magpie:latest (v0.1.1150):
- the documented `docker run ... web` came up healthy, and its log
output is what the page shows;
- with "lan": true, `Bearer magpie` got 401 and a gateway key got 200;
- a second container ran `provider add remote-magpie <key>
url=http://<a>:3425 id=office` and listed office/test-relay/... models.
- `node --test site/*.test.mjs`: 23 pass.
- Playwright, in Chromium and WebKit, at 1280, 1024 and 390, light and
dark:
- no horizontal scroll and no nav overflow on all 20 docs pages;
- every internal link and #anchor resolves. /zh/ and /ja/ are routed
by the worker and return 200 live.
A developer of an AI app asked how to work with magpie and whether an app can
register itself after one confirmation. The page says what exists: the
gateway (find it via /api/hello and settings.json's port, the OpenAI,
Anthropic, Responses and Gemini endpoints, /v1/models' fields), how a key
magpie-<id> or the User-Agent's first word names the app in Usage, a row on
the Agents page by an adapter PR in internal/agent (config-edit, Cindy-style
own import link confirmed in the app, or a local API) with what the PR needs,
what plugins can and can't do, and what isn't there: no link or API registers
an app or installs a plugin, and magpie://import adds providers only. English
and Chinese pages, linked from every docs page's nav and footer.
TestThirdPartyAppIsCountedAsItself pins the attribution the page promises.
go vet and the gateway tests pass; site node tests pass; pages checked in
headless Chromium (no errors, TOC, no horizontal scroll at 390px).