f2eb56c6bbde1300dddc402861b59cd4e45e0215
266
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b62fa332f3 |
provider: Send requests unmasked for subscriptions and plugin providers too (isee1_1)
isee1_1 on Discord uses a community translation plugin as a provider and asked why "Send requests unmasked" (请求不脱敏) isn't offered for it. |
||
|
|
14b451c117 |
site: the MCP hub's docs are the MCP router's, and the old links redirect
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 |
||
|
|
cfb06e11c3 |
site: PostHog goes through usemagpie.ai/r/, and downloads are counted
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. |
||
|
|
06d36d4142 |
gateway: Stays: Session spreads new sessions over the accounts (connor_yang)
connor_yang on Discord: three sessions on one provider's three accounts,
Stays: Session (整个会话), ended up on two accounts. Under Smart routing a
conversation nobody had answered yet went wherever routing put first,
whatever other sessions were on; only In turn counted the sessions each
account holds (leastHeld, #946).
Kept for the whole session (Stays: Session or Strict) under a routing that
picks by what is left (Smart, Least used first, Weekly pace;
spreadsSessions), a new conversation now goes to the key, account or
group member the fewest other conversations of the last 30 minutes are on.
It passes over one routing keeps new conversations off (readyForNew:
resting, an aside key, a fallback while the provider's own model leads,
one used past lowShare), counts leads only, and keeps routing's order on a
tie. A Claude Code subagent's first request goes to its lead's account
(withLead), not to another as a session of its own. An answered
conversation is kept as before, and resting, spent and the rest/quota
fallback are unchanged. In order, By weight, Free first, Speed first,
Cheapest, Manual and plugin routings keep their order. Docs: reference,
gateway-routing, site start.html (en, zh, ja).
Run (mote, at this head on
|
||
|
|
4f2d5fc7e0 |
routing: a group can put its cheapest member first, by each one's price at that hour
liyuanzheng (#general) and lam_em (#feedback) both asked for the same thing. Off-peak, DeepSeek's own API should come first for deepseek-flash. At DeepSeek's peak (weekdays 01-04 and 06-10 UTC, billed 2x since v0.1.2173), another provider should come first, Ollama say. A schedule editor would make the user copy DeepSeek's hours into magpie. Instead, a group gets one more routing, "Cheapest first" (`cheap`). Each request sorts the members by what they cost right then: input + output price per million, at the peak rate when it is peak hours. A tie goes to the lower cache-read price. Free models count as 0. A member with no known price keeps its listed place after the priced ones. Prices come from the same priceOf the usage ledger bills with, so the user's own ModelPrices, list prices and maker prices all count, and so does a provider's rate windows. - routes: Seat carries Priced/Cost/CacheCost; Strategy.ByPrice; Cheapest is a stable sort, so equal prices keep the user's order. - gateway: weighRouted prices each seat at priceClock() (time.Now; a test holds it) through the new provider.PriceAt. The trace's Weighed row gets a price (input/output/cacheRead/peak) so Routing can say why. - It is a group's alone, like Manual. A provider saved with it drops it, and `magpie provider set … routing=cheap` refuses it. Groups take it in the GUI menu (one more item, no new controls), the TUI and `magpie group set <id> routing=cheap` (aliases cheapest, price, cost). - Routing's mode line says why the first one is first, e.g. "Cheapest first: deepseek-v4-flash costs least on ollama-cloud now — $0.150 in, $0.600 out a million tokens.", with peak and unpriced variants. en/zh/zh-TW/ja/de. - Docs: gateway-routing, plugin-runtime, reference (it also points at Time window and Pause rules for a fixed schedule) and the site's start pages (en/zh/ja). Run, at |
||
|
|
2f65a33aaf |
library: a tools plugin is a Library server of its own, in the MCP hub (Search1API)
chenxiang0010 (Discord #general) asked for a tools plugin's tools, Search1API's (@magpie-community/tools-search1api), to be in magpie's aggregated MCP server. Until now plugin tools were served only at /mcp/magpie/tools, wired by hand; the hub listed Library servers only. Now each plugin that is on and gives tools becomes a Library server once the plugin host has noted its tools (plugin-tools.json, new plugin.ToolsNoted): - named by the plugin's short name (search1api, search1api-plugin beside a user's server of that name), `plugin` set, `local`, its URL the new /mcp/magpie/tools/<short> (gateway ToolsMCPOne), which serves that plugin's tools alone by their own names; - added with the hub on, it is on for the agents given the hub's entry, so their hub lists search1api__search etc. at once; with the hub off it is on for none until switched on. Per agent and per tool it is switched like any server; - the hub lists and runs its tools in process (gateway.PluginToolsOf, RunPluginToolOf, under the Plugin tools gate); with the hub off an agent is given the per-plugin URL at the address it reaches the gateway (through), with a key from another machine; - offered once (pluginsOffered): removed by the user, it comes back only when the plugin is removed and added again. The plugin removed takes the server out; turned off it stays and lists nothing; an unreadable plugins.json changes nothing (plugin.ReadList). Edited in the Library's editor, which doesn't send `plugin`, it stays the plugin's. Docs: docs/subsystems/plugin-tools.md, mcp-hub.md, site docs plugins (en, zh, ja). Run (mote; full suite at this change on origin/main |
||
|
|
f982e46f26 |
site: PostHog also records sessions, errors, dead clicks and request timings
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. |
||
|
|
3caa125f93 |
site: PostHog keeps a localStorage id, so it sees country, returns and clicks
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. |
||
|
|
d5d6420ba3 |
site: the privacy page says PostHog looks up no country for cookieless page views
With cookieless tracking on, PostHog hashes the address into the visitor id and strips it before GeoIP runs (its own settings page says so), so 0c12662f2's "the country your address is in" was wrong in en, zh and ja. Text only; checked the three pages' sentences by hand. |
||
|
|
0c12662f2f |
site: PostHog Web Analytics on every page, cookieless
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. |
||
|
|
9101bb8879 |
privacy: a request masking would change can go as written to a model you picked
jessyoungyu on X: when a masking rule hits, send the request to a self-hosted model instead, so a prompt like 「百度这家公司怎么样」 gets an answer about Baidu, not about a placeholder. Settings › Privacy › Instead of masking, send to (settings redactRouteTo). It is Off by default, and nothing changes for a user who leaves it Off. It is picked in the app menu, and only models whose every route is unmasked can be chosen: the provider is set to Send requests unmasked, it is on this computer or the network, it has no account, and any fallback or group member is unmasked too (gateway.MaskRoute, the same rule as provider.SkipsRedaction). The setting is saved on its own with POST /api/settings/redact-route, which checks it with MaskRoute. The general settings save keeps the value. Decisions: - When a value would actually be masked on an agent's turn (maskHits.n > 0), serve sends the request to the chosen model unmasked. Warn-only hits don't count, and Block still answers 400. - If that model fails, the request fails. It is never masked and re-sent to the model the agent asked for, and never goes to a cloud model with the unmasked text. Falling back to a masked cloud request would answer a different question in the background. The user picked this route because masking breaks the answer. - Streaming works the same as on any route. - The route is checked again on every request. A model that is gone or no longer unmasked, or that the caller's gateway key may not use, means the request is masked as before. - Covered: agents' Messages, Chat, Responses and Gemini turns (serve, marked by serveAgent), count_tokens, Codex magpie-model turns, and Codex own-sign-in /responses (codexMaskRoute). - Not covered: magpie's own asks (ownAsk clears the mark), embeddings, audio, images and video. These stay masked. GUI: redactRouteRow lives in plugins/redact/settings.js and wraps renderRedact, so app.js is byte-for-byte unchanged and the core budget is not raised. Strings are added in zh, zh-TW, ja and de. Docs: gateway-routing.md, gui-shell.md, and site/public/docs masking (en, zh, ja). Tests: internal/gateway/mask_route_test.go (TestMaskedRequestGoesToTheModelSet: unset, set, streamed, nothing to mask, local fails, falls back to a vendor, no longer unmasked, count_tokens; TestCodexSigninTurnGoesToTheModelSet; TestMaskRouteTakesOnlyUnmaskedRoutes; TestMaskRouteOnlyForTheAgentsTurn); internal/gui/redact_route_test.go; settings_keep_test.go; internal/gui/tests/redact-route.test.cjs (every language, chromium and webkit, 1100 and 640 wide). Broken by hand, each red: - serveAgent without the agent mark; - MaskRoute taking any route (TestMaskedRequestGoesToTheModelSet, TestMaskRouteTakesOnlyUnmaskedRoutes; at the pushed head); - the codex hook removed; - count_tokens without the mark; - ownAsk not clearing it; - no key check; - no reroute in serve; - the GUI: no keep in the general save, no MaskRoute check on save, and the picker listing every model; - the plugin script left out of index.html (redact-route.test.cjs 22 of 24 red; at the pushed head). Run on mote: - at 221ede767's tree, this change on |
||
|
|
0745db932e |
site: an MCP hub page in the docs, in en, zh and ja
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. |
||
|
|
f6263439af |
gateway: serve OpenAI's text to speech, POST /v1/audio/speech
liuyuexue2020 on X (tweet 2115742181734445238) wanted audio models
(Mistral among them) behind magpie, and the gateway had no
/v1/audio/speech.
POST /v1/audio/speech (and the bare /audio/speech) takes OpenAI's JSON
body and goes through serveRetrieval, as transcriptions (#2053) and
embeddings do: routed (a group's members, a provider's keys and
accounts, pause rules, key limits), metered against MaxRPM, recorded
(usage operation "speech", Routing, recent calls). Only "model" is
rewritten to the provider's own id; every other field goes as sent, so
Mistral's voice_id and ref_audio pass too.
The answer is never held whole: a speech request's 2xx answer is left
unread by the new retrieveOpen (retrieveAs now wraps it) and copied to
the client as it comes, flushed per read, in the vendor's own
Content-Type: audio (mp3/opus/aac/flac/wav/pcm), SSE for
stream_format=sse, or a vendor's JSON (Mistral answers
{"audio_data": base64}). No Accept: application/json is sent for it.
The usage in SSE's speech.audio.done event is counted from the last
16KB. A vendor's error is read and passed on as before, and a failing
member still falls over to the next.
Masking: "input" and "instructions" are masked as the settings say,
as text (maskTextHits), each where it sits; nothing else in the body
is (voice, formats, a voice-cloning clip are no text of the user's).
Nothing is put back: the answer is audio, so a masked value is read
aloud as its placeholder (docs/reference.md says so).
Mistral: its API has POST https://api.mistral.ai/v1/audio/speech
(voxtral-mini-tts-3-0), at the OpenAI path but not OpenAI's shape:
voice_id instead of voice, and JSON {"audio_data": base64} back, not
raw audio. Both pass through as sent; a client must speak Mistral's
shape to it. OpenAI, Groq and other OpenAI-style TTS vendors (vLLM-Omni
included) are served as they are.
Also: the 404 message's list, /v1's "apis", remote_magpie's suffix
list, cors_test and lan_test route lists, docs/reference.md,
gateway-routing.md, plugin-runtime.md, site remote.html (en/zh/ja).
Run (mote-run, at this commit):
- go vet ./... (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./..., go build ./...: ok; gofmt -l clean
- go test -timeout 45m -count=1 ./internal/gateway ./internal/provider at 7bc52d44e^{tree} (= this tree, origin/main
|
||
|
|
1319a44bbc |
docs: plugin guide says what four rules do when a plugin gets them wrong (plugins#468)
Guide (en, zh, ja) and provider-plugins.md: - usage: leave used out rather than send 0; with amount/limit it is their share, with no count the window is text and routing doesn't read it; aside keeps a window out of routing whatever its count. - sign-in: a model refused is 403/404, not 401; a 401 that says only that the model isn't served is read as kept. - free comes only from the vendor's word; rate 0 is none given, never free (magpie infers nothing from rate). - GitHub listing licence: from LICENSE as GitHub reads it, else package.json's license. Docs only. Checked each claim against the source at this tree (plugin_usage.go quotaOfPlugin, plugins.go modelOnly401, fallback.go modelRefused, plugin/providers.go Model.Rate, models.go FreeModel, github.go readTagged). Site deployed with wrangler and the pages read back with curl. |
||
|
|
8273325b05 |
site: Sidrune AI has a China and a Global site, picked by where the user is
Sidrune reported (10-29) that it runs two sites whose keys don't cross:
China at sidrune.ai and Global at global.sidrune.ai, and its website
sends a browser to one by language. magpie listed the China site only,
so a user abroad who signed up on Global and pasted that key got 401
Invalid API key. They asked for a Global / China choice that moves the
endpoints and the key link with it.
Sidrune's entry is now two regions instead of top-level endpoints:
China (cn: sidrune.ai/v1, sidrune.ai) and Global (global:
global.sidrune.ai/v1, global.sidrune.ai), each with its own key link
(register?promo=MAGPIE3 on its site) and website. With regions named
China and Global, the app's existing paths take over (
|
||
|
|
fc6f1d5e8d |
site: CoreCode serves OpenAI chat and Responses too, with its ref links and new copy
CoreCode (Joe, 10-28 23:12) added an OpenAI-compatible API and asked for it in the Add sheet: chat and Responses at https://corecode.live/v1 beside the Anthropic endpoint, keysUrl https://corecode.live/keys?ref=magpie, website https://corecode.live/sign-in?ref=magpie, and the en and zh taglines they sent, word for word (sponsors' copy is used as written). zh-TW is made from the zh. Checked: without a key, /v1/models lists the Claude models with supported_endpoint_types anthropic and openai, and /v1/chat/completions and /v1/responses answer 401 "Invalid token". Both ref links answer 200. Run: node --test site/*.test.mjs on mote, 45 of 45 pass. Not tried: a request with a key. The test key CoreCode sent on 10-26 now gets "Invalid token"; a new one has been asked for. |
||
|
|
c2aad3db02 |
redact: a wallet address goes as written, and an IP as a documentation address the agent can use
0x0_air on X (10-28): with masking on, the agent stopped and asked again.
Their EVM address (0x89dfBD9b…, public) went as a secret placeholder and
the vendor's model told them to rotate it in case it was a private key;
the server IP they typed went as {{IP_…}} and the model refused to ssh
to it and asked for the real host.
- model.go: the local model's SECRET/ACCOUNT span on 0x and 40 hex
digits (evmRe) is left as written; no rule matched it, the model's
label did (the 0x prefix and mixed case got past hexRe). A 64-hex
private key is masked still, and so is a 40-hex value called a key
(secretCued).
- shape.go: an IP the IP rule masks goes as an address from the
documentation ranges (192.0.2/198.51.100/203.0.113 .101-.254, IPv6
2001:db8::/32), stable for the value, never shared by two values
(falls back to {{IP_…}} past 462 IPv4 ones), and put back only as a
whole address in replies and streamed tool calls (restoreAddr).
Preview shows the same stand-in.
- docs: gateway-routing.md, and masking.html in en/zh/ja.
Run:
- Real models through the local gateway, the screenshot's ssh prompt
with the placeholder vs a documentation address: with
{{IP_k3v9x2mq}}, deepseek-v4-pro, glm-5.3, kimi-k3 and
claude-sonnet-5-5 mostly searched ~/.ssh or asked for the real IP;
with 203.0.113.147 or 192.0.2.183 all 20 runs over 5 models ran ssh
at once.
- New tests (internal/redact/standin_ip_test.go): the screenshot's
message, the tool call restored whole and streamed cut at every byte,
boundary cases, IPv6, 472 addresses never sharing, the screenshot's
address under labels secret and account_number with every category
on, and a 64-hex key still masked. gateway TestRedactedKinds now
wants a documentation address upstream.
- Broken by hand: without the evmRe check TestEVMAddressGoesAsWritten
is red for every text and label; without restoreAddr the boundary
cases are red; without the IP stand-in all three IP tests and
gateway TestRedactedKinds are red.
- On mote at this head (rebased on
|
||
|
|
ae03279458 |
masking: the local model is on by default; the rules mask alone until it is downloaded
The owner's plan (10-28, after the xuanwo/_kaichen reports under the
masking demo): with AstrLink Guard picked, the Chinese-name heuristic
is off and only nicknames like 小王/老李 stay a rule; with Privacy Filter
it is as before; every format rule stays; the model is on by default,
masks with the rules alone until its download finishes, and no longer
answers 503 for it.
- masking.ModelWanted(st): on when the user turned it on, off when the
user turned it off (new RedactModelOff, set by SetRedactModel(false),
remove, and cancelling the default's own download), on when the
default's download finished (RedactModelAuto). A settings file from
before this, with a model name picked or files on disk and the model
off, reads as the user's off: magpie's default doesn't override it.
- Until the picked model is installed, requests are masked by the rules
alone and fetch starts its download (one try per model per hour,
never under testing.Testing(), nothing where the model can't run).
When it finishes, settings.UseDefaultRedactModel records the default
(it refuses when the user has set anything) and the model warms.
- model(..., strict): a model that fails holds requests back (503)
only when the user turned it on; under the default the rules mask
alone. The Privacy page says which ("…the rules mask requests alone"
in en, zh, zh-TW, ja, de; /api/privacy-model has `chosen`).
- redact.Options.NamesByModel (AstrLink Guard picked): zhNameSpans
keeps only zhNick candidates (小/老 + a surname).
- KeepOwn and POST /api/settings keep both new fields.
- Docs: gateway-routing.md, site masking docs (en, zh, ja).
Run (mote, Go 1.26.8):
- gofmt clean; go vet of masking, settings, redact, gui; GOOS=linux go
vet of masking, settings, redact; GOOS=windows go vet of the four.
(GOOS=linux vet of internal/gui needs cgo, as on main.)
- go test -count=1 -timeout 45m ./... at base
|
||
|
|
189db9ba5b |
redact: ids, digests and 毛利 go as written; the slider reaches known values; a user name goes as a made-up name
Reports on X under the masking demo (10-28):
_kaichen: "hash类型也会被过滤…长int,假如以1为开头的…会被当作电话被mask;
"毛利低"也会被当作人名被mask。即使把匹配拉到 0.95,也是一样行为".
- Hex digests: 16 to 31 hex digits in one case, with letters and digits
both (a cache key, a short commit), are ids now (digestShaped in
ids.go), like UUIDs and 32+ hex. The rules' SECRET keeps one only under
a credential's field or a CJK/prose key with no field word (密钥为…);
the model's SECRET is dropped under a field named for something else
(cache_key, commit, object, blob, file, content, revision, partition,
shard, bucket, dedup, lookup, row, sort) and on a JSON object's key
(nameOfField). A bare `key` after api/access/secret/private/signing/
license is still a credential (keyPhrase). The IBAN case kept its mask
through the letter/digit minimums.
- 11-digit 1x numbers (phone.go, phoneAt): a phone with +86/86, as the
value of a field whose name says phone (phone, mobile, tel, cell,
contact, 手机, 电话, `number`), or in prose with no id word right
before it (order, id, no., #, 订单号, 编号, 单号, 流水号…). Under
order_id/uid, after 订单号, or with a letter or digit against it, it
goes as written. PHONE and BANK_CARD are bounded by alnum, not digits,
in the rule and in known values.
- 毛利: zhWords gained 毛利, 毛重, 毛坯, 毛巾, 毛衣, so 毛利低 (a margin)
is no surname+name. The model still finds 毛利兰 (Guard). 毛利小五郎
(indekkusu141209) is masked by neither model nor the rules now.
- The slider: a value masked once was masked again as known whatever the
threshold. Each value now remembers the highest score it was found
with (rules count as sure, ruleFound), and knownSpans skips one under
Options.MinScore, which masking sets from pii.Threshold.
eerttreeeert: with mimo-v2.6-flash the home folder went as
C:\Users\{{USERNAME_…}}; the model took it for a temp folder and set out
to delete it. With the user name switch on, it now goes as a made-up name
of 8 lowercase letters (HMAC of the name, same every turn, standIn in
shape.go), restored in replies and tool calls like any placeholder;
Preview shows the same name.
Docs: docs/subsystems/gateway-routing.md masking bullets, and the site's
masking page (en, zh, ja) on mobile ids and the user name.
Run (mote, at this tree on base 6af83172d; rebased onto
|
||
|
|
f95121dd05 |
README: sponsors in two rows of three, each logo in an equal slot
Six logos wrapped onto a row of five and a lone AIGoCode. Now a <br> after the third, and every logo is width=144 height=36 so the columns line up (SVGs keep their ratio inside the box). AIGoCode's PNG is 640x170, which would stretch at 4:1, so the READMEs use a copy padded to 680x170 (light and dark); the home page keeps the original. Run: mote-run node --test site/*.test.mjs, 45/45 pass. Rendered the rows in headless Chrome on a dark background and checked the columns line up. Not tried: GitHub's own render (it goes live with the push). |
||
|
|
dfb73a04ef |
site, README: AIGoCode's dark logo in dark mode
AIGoCode sent the logo on a navy background; the navy is taken out to transparency (colours un-blended at the edges) and the logo is placed in the light PNG's 640x170 box, so the card doesn't move between themes. Checked by eye over a dark and a white background. Ran: node --test site/*.test.mjs on mote, 45/45 pass. |
||
|
|
18b17a50b9 |
site: AIGoCode's card takes the copy AIGoCode sent
The en and zh text is theirs word for word; ja and de are translated from it. Ran: node --test site/*.test.mjs on mote, 45/45 pass. |
||
|
|
60520ddb3b |
moejs: v0.1.0-alpha.11, at its new module path github.com/MoeForge/moejs
Gateway middleware and agent plugins run on moejs. alpha.11 moves the
module to github.com/MoeForge/moejs; every other API change since
alpha.4 is an addition. What magpie gets: faster calls, loops, property
lookups and JSON.parse, allocation-free await, a bytecode verifier, a
correct default.pgo, and Intl / toLocaleString in plugin code.
Checked against both tags' source: every name magpie uses (NewRuntime,
Options, Compile, Link, Hook, Value, Arg, Undefined, NativeFunc,
Referrer, the Promise results, Exception) has the same signature, and
Options' defaults (shared frozen builtins, no timers) are unchanged.
fetch, Streams, URL, node:fs and node:buffer live in the separate
webapi and node packages, installed only on request; magpie installs
neither, so a plugin still reaches no network or file.
Intl's CLDR, Unicode, ICU and V8 material is compiled into every build,
and moejs asks a program that includes it to carry sections 1 to 4 of
its notices. THIRD_PARTY_NOTICES holds them verbatim. Release archives
ship no LICENSE today either; that is not changed here.
Doc and site links (docs/, site/public/docs/{,zh/,ja/}plugins.html)
point at the new repo.
Run on mote at this tree: gofmt; go build -trimpath -s -w (60,670,658
bytes on origin/main
|
||
|
|
0f4763f434 |
site: AIGoCode's card says sign-ups through it get 10% extra credit on top-ups
Asked by the owner. The sentence is added in en, zh, ja and de. Ran: node --test site/*.test.mjs on mote, all pass. |
||
|
|
8bade6c5e2 |
provider: a plugin's usage window can be a prepaid wallet's balance (#3950)
SuperMagic's accounts (mycf_711's magicrew plugin) are prepaid wallets of
points with no total. A plugin can now send a usage window as
{name, balance: 6291, unit: "积分"} with no used or limit.
- host.js passes a finite balance on (at least 0), anything else as null.
plugin.UsageWindow.Balance and provider.QuotaWindow.Balance are *float64.
- quotaOfPlugin keeps the figure and does not make the window Text or
Aside, so routing knows the account with no Used invented. allowanceOf
copies it into Limit.Balance; an empty wallet counts as used up.
Allowance.Left(model) is the least balance of the windows that count
the model.
- weighRouted fills routes.Seat.Left and Seat.LeftIn (the account's
provider and unit). Smart, pace and usage (least used) put the seat
with more left first where they would otherwise tie (byLeft), only
when every seat with a balance shares one LeftIn: balances in two
units or two providers are never compared. Tiers still come first.
- The Usage card, the Routing page (Weighed.Balance: the small row's
text, no bar, a why sentence, the account list), magpie accounts and
the status line show the figure, "6,291 积分 left", never a share.
- Docs: provider-plugins (new section), gateway-routing,
providers-accounts, plugin-runtime, host.js typings and the site's
plugins page (en, zh, ja).
Run, at base
|
||
|
|
0f053024f5 |
README, site: link Apache Magpie and the ASF in the not-affiliated note
Jarek Potiuk (Apache Magpie PMC) suggested linking magpie.apache.org and apache.org instead of naming them, to avoid any other confusion. Both READMEs and the site footer (en, zh, ja, de) now link them. Run: node --test site/*.test.mjs on mote, 45 of 45 pass. |
||
|
|
4b0a32e0f3 |
site: AIGoCode's two links carry its invite code and a utm tag per place
The owner asked for referral tracking on both. aigocode.net reads no aff parameter: its attribution takes utm_source (or ref), utm_medium and the other utm_* from the landing URL, and the referral is the /invite/<code> path. So /go/aigocode/home and /go/aigocode/readme both land on /invite/MAGPIE, with utm_source=magpie and utm_medium=home or readme to tell the places apart. Run: node --test site/*.test.mjs (45 pass). Both new URLs answer 200. |
||
|
|
dc1cfe0156 |
site: AIGoCode on usemagpie.ai's Sponsored by and in the READMEs
AIGoCode took the home and README seats together (paid, Wise USD). A fifth home card after SoleAPI, and a logo at the end of the Sponsors row in README.md and README.zh-CN.md. The logo is the 1280x368 PNG AIGoCode sent, cropped to its content and scaled to 640x170. Its blue and purple mark sits on transparency and reads on white, #1c1c1e and GitHub's #0d1117, so one copy serves both themes. The en and zh taglines are AIGoCode's own; ja and de are translated from them. /go/aigocode/home sends the browser to https://www.aigocode.net/ and /go/aigocode/readme to https://www.aigocode.net/invite/MAGPIE, the link AIGoCode gave for the README (first top-up bonus). Not tried: AIGoCode's API in a real agent. The owner chose to go live without a test key; neither seat puts AIGoCode in the app. Run: node --test site/*.test.mjs (45 pass). Logo rendered on light and dark backgrounds and looked at. |
||
|
|
5a9fb36a10 |
README, site: magpie is not affiliated with Apache Magpie or the ASF
Apache Magpie's PMC asked about the shared name. magpie keeps its name (a common word, thousands of older projects use it) and says plainly it is not affiliated with Apache Magpie or the Apache Software Foundation: a line under License in both READMEs and in the site footer (en, zh, ja, de). Ran: node --test site/*.test.mjs (45 pass). |
||
|
|
2675169eca |
site: SoleAPI's home card goes to its /r/magpie referral link
The owner asked for https://soleapi.com/r/magpie in place of ?aff=magpie. It lands on soleapi.com/register?ref=magpie (200). Run: node --test site/*.test.mjs (45 pass). |
||
|
|
e09616adf1 |
site: SoleAPI's home card carries aff=magpie
The owner gave SoleAPI's referral code: /go/soleapi/home now sends the browser to https://soleapi.com/?aff=magpie (200). Run: node --test site/*.test.mjs (45 pass). |
||
|
|
00f8b11340 |
site: SoleAPI on usemagpie.ai's Sponsored by
A fourth home card, after FastAIToken. The tagline is the owner's
("不拼最低价,拼不掉线:多渠道容灾,逐笔透明计费"), translated for en, ja
and de. The logo is the PNG the owner sent, cropped to 640x157; the
dark-mode copy turns the black mark and "Sole" light and keeps the blue
"API" and its green dot.
/go/soleapi/home sends the browser to https://soleapi.com/ (200, titled
"SoleAPI - LLM API Gateway"). No referral code was given; when SoleAPI
sends one, it goes into sponsors.js.
Run: node --test site/*.test.mjs (all pass). Logos checked on white and
on #1c1c1e.
|
||
|
|
df8e9de3f1 |
redact: a masked word that is a date matches that date however it is written
JackyCcao on X turned birthday masking off (old dates in logs and tasks after a birthday's word were still taken) and put their own birthday in Masked words instead. A word matched only as typed, so 1990-05-12 let 1990/5/12, 1990.05.12, 1990年5月12日 and 19900512 go as written. A masked word that is all of a date (dateword.go: year-month-day with - / . 、 or a space, 年月日 or 년월일, a month's English name, or day/month/year where only one reading is a date) now matches that calendar date in each of those forms, with or without leading zeros, as eight digits, and day-first or month-first only where the day is over 12 or equals the month: for 1990-05-12 neither 05/12/1990 nor 12/05/1990, which reads as December 5th too. A word like 05/12/1990 is no date and matches only as written. Eight digits alone are not taken for a date word (as likely an id) and match as before. A date match never has a digit, or a dot and a digit, beside it, whatever Whole words only says, so 1990.5.12.1, 3.1990.5.12 and 11990-05-12 are no match; this is a change for a date word without Whole words, which matched inside such numbers before. The birthday rule is not changed. It takes a date only right after a birthday's word (生日, DOB, born...), so a log line's, a file name's or a task's own date is never one, however old. What is left (生日: 2019-03-02 in a task log about a party) has the same shape as a real date of birth, and a time beside the date doesn't tell them apart: a date of birth stored as a time (1990-05-11T16:00:00.000Z, midnight in UTC+8, as JavaScript writes it) is the commonest way one reaches an agent in JSON. TestBirthdayLogDates pins both sides; #3878 tracks fixed-shape false alarms. Tests: TestDateWordEveryForm (22 forms x 5 words x 6 contexts, each restored as written), TestDateWordDayMonthOrder, TestDateWordNotAnotherDate (another date, 1990.5.12.1, longer numbers), TestDateWordOnlyADate. Broken by hand: with the dateSpans hook in mask turned off, EveryForm, DayMonthOrder and NotAnotherDate fail; OnlyADate and BirthdayLogDates pin behaviour that was already right and pass on both. Docs: gateway-routing.md, masking.html en/zh/ja. Run on origin/main |
||
|
|
e96a8d2d40 |
privacy: the local model's threshold defaults stay, measured on real traffic
Yayoi_no_yume (X) asked for 0.85-0.95, ~0.88, over a hardcoded 0.5.
The threshold is the user's per model since v0.1.1689 (Settings >
Privacy > Confidence threshold, 0.5-0.95). This measures whether a
different default would be better, and keeps the defaults.
Corpora: 2000 segments of the owner's real Codex and Claude Code
sessions (prompts, tool arguments and results; 550 with CJK), kept
local; and 101 labelled cases (the 72 eval cases incl. #3029,
#3143, #3144, plus 30 new), 64 values that must be masked, 188 that
must not. Both real models, in a scratch cache: Privacy Filter q8
GGUF via pf-v2, AstrLink Guard rev 7216b6a3b897 (sha256 checked).
Rules alone mask 16 of 64.
model thr labelled masked/64 labelled FP/188 real model masks
Guard 0.5 60 0 34
Guard 0.8* 57 0 20
Guard 0.88 56 0 12
Guard 0.95 54 0 6
PF 0.5* 59 2 31
PF 0.8 57 1 19
PF 0.88 56 1 13
PF 0.95 56 0 12
Guard 0.8 -> 0.88 drops 3 false alarms (a model id, a sandbox path
word, a token counter) and lets a real colleague's name and a
labelled signed name through. PF 0.5 -> 0.88 drops 11 (timestamps
in paths, log lines, a plugin id) and lets 6 names and a phone
through, 4 of the names in real traffic. A higher default sends
real names unmasked; the false alarms left are shapes (ISO
timestamps in paths, Claude Code's <total_tokens> counter, base64)
that a check can turn away. The docs now say what the threshold
trades, en/zh/ja masking pages and gateway-routing.md.
Run at this head (and 89ef90356 under it), rebased on
|
||
|
|
430e3050d8 |
gateway: magpie's own searches and image descriptions go without the agent's middleware (#3695)
aiirobyte (#3695): the gateway exited five times on 2026-10-26, and every client was refused until it was started again. The one exit with a stack died of "fatal error: concurrent map read and map write": two of seenBody's goroutines in middleware.(*Run).Tried at once, one of them in moejs's InternGoString. A request's middleware runs in runtimes of the request's own (serveAgent). Only one goroutine may use a runtime at a time (moejs), and Run has no lock to hold callers to it. serve runs each try's onProvider on them (triedOn) through the Tried the request's context carries. For a model that can't see, magpie has each image of the request described (seenBody), up to four at a time, and each description is a request it makes of its own gateway on a context made from the agent's (magpieChose(ctx)). So the descriptions carried the agent's Tried and ran onProvider on one runtime from as many goroutines. A model that can't search has its searches made the same way (searchWith): a search is asked beside the agent's own stream, which goes through the middleware's onEvent, and beside the round's other searches, so one search is enough to share the runtime when the middleware has onEvent. The runtime's maps were read and written from two goroutines and the gateway died. When it didn't, the calls' values crossed. In the runs below, hooks threw on values that weren't there ("Cannot read properties of undefined (reading 'push')", and "(reading 'messages')"), and a description went out as {"0":0,"messages":[0,{"content":[0,{"image_url":0}],...}],...}, its max_tokens, system prompt, text and image each turned into 0. An earlier run of the same break (tree e1c90a00, this code with older comments) had one image asked about twice and another never. ownAsk takes the request's Tried off the context of those two asks, so they go without the agent's middleware, as serveAgent's comment already said of them ("search and vision stand-ins") and as magpie's other own requests (titles, the classifier) go. The agent's own tries are as before: each runs onProvider once, on its runtime. The subsystem page now says why, and the user docs (en, zh, ja) name searches and image descriptions among magpie's own requests. Going without also keeps what the docs tell a hook. Its ctx.protocol, ctx.model and ctx.stream are the agent's request's, while a description's body is a Chat request and a search's an Anthropic one, whatever the agent speaks. A description is also kept for later requests (sights), so one asked through a request's middleware was handed to later requests, other agents' too. The one community middleware with onProvider, antigravity-cloak, rewrites Claude Code's and Codex's lines in the system prompt, which a description's or a search's prompt, magpie's own, doesn't have. Not changed: the report's other fixes, a lock over the runtime, one ask at a time, or a Run per ask. Each keeps the gateway up but still runs the agent's middleware on asks that are magpie's own, which the docs say go without it, and with the first two onProvider still gets bodies its ctx doesn't describe. With ownAsk nothing else uses a request's Run from two goroutines (holdWriter's keepalive writes under the h.mu the handler's writes hold). magpieChose is left as it is: it says whose pick a call is, and its other callers, Codex's thread titles, descriptions and predictions (codex_titles.go), run before serveAgent with no Tried to take off. What was run (tree 4f97ac18, on origin/main |
||
|
|
f0ffee34ce |
guard: on a Mac AstrLink Guard runs through CoreML, 512 tokens in 12ms where the CPU takes 400
yyhhyyyyyy on X asked for CoreML. internal/pii/guard now runs the encoder (everything after the embeddings) as a CoreML program on a Mac with macOS 13 or later, on the Neural Engine or GPU (MLComputeUnitsAll). bert.go still does the embeddings and stays the path everywhere else. - coreml_gen.py builds the program with coremltools' MIL builder from the pinned int8 model: the int8 weights dequantized, float16 compute. The repo keeps only the graph (coreml.mlmodel, 112KB) and coreml.json (each blob's offset, weight.bin's size and sha256). On each Mac the weights are written from the model already downloaded (coremlWeights, float16 rounded to nearest even as numpy does), checked against that sha256, compiled once into <model dir>/coreml/<sha>.mlmodelc (about 5s, 41MB), and opened from there after that (40-170ms). Nothing new is downloaded or hosted. - The cgo lives in internal/pii/guard/coreml, because guard has Go assembly. Without cgo or off darwin it is a stub (Available false). - A window under 16 tokens (coremlMin) stays on the CPU, which is faster there (8 tokens: 8.7ms CPU, 12.5ms CoreML; 16: 17 vs 13). A Mac before macOS 13, a failed write, compile or open, or a failed run goes to the CPU too. Model.MLErr keeps why. Accuracy against the publisher's fp32 ONNX (onnxruntime): CoreML's probabilities are within .067, the CPU's within .129, and both agree with fp32's labels on the same tokens. The CPU quantizes activations as the int8 model does and CoreML doesn't; fake quantization in the program was tried and didn't match the CPU (.75 on CPU fp32, .70 on GPU, unstable in fp16), so it was dropped. A span near the threshold can fall the other side: TestModelFinds' go.mod module path is a common_secret at .814 on CoreML, .788 on the CPU and .785 in fp32, so on a Mac it is masked at the default 0.8. TestModelFinds now tests bert.go alone (m.ml = nil), and TestCoreMLMatchesGo holds CoreML to it. Run (M4 Pro, macOS 26.2, under load ~50): - gofmt -l internal/pii: clean. go vet ./internal/pii/... with GOOS darwin, linux, windows and CGO_ENABLED=0: clean. - MAGPIE_GUARD_DIR=<pinned model> go test ./internal/pii/... ./internal/redact/... ./internal/masking/... -count=1: ok. In guard: TestHalfRounds, TestCoreMLWeights (weight.bin's sha256), TestCoreMLMatchesGo (99%+ argmax agreement on a 512-token window, the same spans as the CPU with scores within .2; loaded in 6.3s cold, 17ms for 512 tokens), TestCoreMLFailureFallsBack and TestModelFinds. - TestMaskEval/astrlink-guard replayed with outputs recorded through CoreML: the same verdicts at the default threshold; scores moved a little and one account_number span at .508 is new, under 0.8. eval-astrlink.json stays the CPU's recording. Broken by hand: half() rounding ties up instead of to even turns TestHalfRounds red; a wrong sha256 in coreml.json makes Load fall back to the CPU with MLErr set, find the same spans and leave the compiled program in place (TestCoreMLFailureFallsBack). Not tried: an Intel Mac, macOS 13 or 14 (only 26.2), the real app's GUI with Find with a local model on (the gateway path calls the same Find). |
||
|
|
e111e08aaf |
site: 鱼鱼连线's home card goes to its register page with the owner's aff code
The owner asked for https://app.yylx.io/register?aff=YETONE in place of https://yylx.io/?ref=magpie. Run: node --test site/worker.test.mjs, 0 fail. |
||
|
|
19dc5b9252 |
routing: accounts renewing together spend first the one whose credits left lapse first (zhaocai_83020 on Discord)
zhaocai_83020 on Discord asked how to make several WorkBuddy accounts spend the credits that expire soonest first. Smart, the default routing, already took a window's runsOutAt (plugin 0.1.14, cdredfox on X) as its renewal, but only when it came before the window's reset. Since plugin 0.1.35 (windy on Discord) a WorkBuddy free account's Credits window resets at the month's end, the same moment on every account (cycleOf, packages/workbuddy usage.test.mjs CN_FREE: 10-31 23:59:59 +08), so given credits lapsing after that end ranked alike and kept the accounts' listed order: the account whose credits were lost first wasn't spent first. Allowance.Lapse is the soonest RunsOut in the future of a window that counts the model, carried to routes.Seat.Lapse. Smart goes by it, to the hour, only when the renewals tie: the one lapsing first goes first, one telling none after those that do, the same hour keeps the listed order. The share-used tiers and the renewal still decide before it. It is read from the window's structure (RunsOut), not the provider's name; only the WorkBuddy plugin sends runsOutAt today. Weekly pace and the other routings are unchanged, as before. The gateway-strategy plugin seat (middleware/points.go) doesn't carry it, as it carries no Free, Credits or speed either. Docs: reference.md (How magpie picks an account), gateway-routing.md, site docs start.html en/zh/ja (not deployed by this commit). Run at |
||
|
|
92cf0b68df |
docs: the two local models and how one is picked (#3578)
gateway-routing's masking paragraph, the pii package comment, and the site's masking page in en, zh and ja name AstrLink Guard, the default, and Privacy Filter, and say what the picker beside the switch does. Run again after rebasing the stack onto |
||
|
|
d9a8148d7c |
routing: Speed first sends a request to the provider or key that answered the model fastest lately
joeliu96872540 on X: when one model is reachable through several API
channels, they want an option that sends each request to whichever has
been answering fastest, because they compare channel speeds by hand
today. Speed first (`fast`; `fastest` and `speed` also work) is a new
routing beside Free first. It applies to a provider's keys and accounts
(provider editor › Routing) and to a group of one model on several
providers (Routing page › group › Routing).
How it decides. When a streamed answer ends, gateway/speed.go records two
numbers for that account or key and model (restID): the time to first
token and the output tokens per second, as usage.DecodeOf computes them
for the Requests page. Each is a decayed average with a 20m half-life.
After an hour with no answer the record goes stale, and the store holds
at most 4096 records. This is O(1) at the answer choke point, beside
servedCandidate. For a pool routed by BySpeed, weighRouted reads one map
entry per candidate, and only for that pool. The usage history is never
read on a request.
routes.Fastest ranks each awake seat by its estimated time to a
200-token reply: TTFT + 200/TPS. A seat that reported no TPS gets the
median TPS of the others. Seats within 10% of the fastest in their band
keep their listed order, so near-ties don't swap on every request.
Seats with no recent measurement go after the measured ones. One request
in five, counted per pool, goes first to an unmeasured seat, rotating
among them, so each gets measured again. Resting seats go behind the
awake ones, and used-up seats behind those. Rests and failover are the
same as for every other routing.
The request trace gets lateTtft and lateTps, and the row-story sentence
says "answered m fastest lately: first token in 0.8s, 60 tokens a
second". It has a variant for a probe turn and one for when no seat has
been measured yet. i18n covers zh, zh-TW, ja and de. Also updated: the
CLI (`magpie group|provider set <id> routing=fast`, plus a new
`routing=` pair on provider set that refuses manual), the TUI name, the
rotation plugin's Sub, docs/subsystems/gateway-routing.md,
plugin-runtime.md, docs/reference.md and site start.html (en, zh, ja).
There is no new layout: it is one more item in the existing pickers.
app.js stays under its budget with no raise.
Tests:
- routes/fastest_test.go:
- ordering: fastest first, slow writer loses, alike keep order,
resting and used-up, median pace, none measured;
- the probe turn at 5, 10, 15 and 20, rotating between seats;
- a resting seat never gets a probe turn.
- gateway/speed_test.go:
- decay, staleness and per-model records, with an injected clock;
- a group of slowv and fastv routed fast: after the speeds are
measured and seeded, the request goes to fastv with lateTtft set;
- the same group routed in order still goes to slowv.
- cli: parseRouting and the provider routing= pair.
- GUI routing-speed-first.test.cjs: the row story for measured,
no-pace, probe and none, in en, zh, zh-TW, ja and de, in chromium and
webkit: 40/40.
Broken by hand:
- Fastest returning the listed order: the routes tests and the gateway
group test go red.
- noteTrySpeed removed: "the streamed answer wasn't measured".
- The client.js case renamed: routing-speed-first 0/20 in chromium.
Run at b5a5caff2 (base
|
||
|
|
4a33cf0a98 |
update: a Stable channel in Settings → About, and magpie update channel
ssharpcc on X reads every changelog before updating, for fear of a ban
when behind, and with many releases a day that is a lot of reading.
Settings → About → Update channel (zh: 更新渠道, 稳定版 / 每个版本) picks
Every version, the default and today's behaviour, or Stable: one version
a week, the newest that had been out three days as the week began
(Monday 00:00 UTC), and an urgent release at once. usemagpie.ai chooses
it from the release list (the previous commit); a release is urgent when
a line of its notes starts with "**Urgent release:**", which
magpie-releases' release run writes from an `Urgent: <why>` trailer
(magpie-releases 73f6cff).
- settings: updateChannel, "" or "stable"; anything else is refused.
- update: on Stable the feed is asked with channel=stable; What's new
shows every release since the installed one (up to 1500) instead of
the newest 40, so a week's notes read as one list.
- gui: the row is segs, never a <select>; a save that doesn't send the
channel keeps it; switching asks the feed again at once, and a
download from every version newer than Stable's pick is dropped,
never restarted into. What's new's notes are kept per channel.
- cli: magpie update channel [stable|every] ("all" too), and it says
which with nothing after it.
- docs: reference.md's Update channel (the rule and the marker); the
privacy pages (en, zh, ja) name ?channel=stable on /api/latest.
The full Go and GUI suites were not run: the disk was at 3 GB free and
other sessions had GUI suites and a 45-minute gateway run going the
whole time.
Run, at this tree before the rebase:
- gofmt -l (clean); go vet on darwin, GOOS=linux -tags nogui and
GOOS=windows for ./internal/update/... ./internal/cli/...
./internal/settings/... ./internal/gui/.
- go test -count=1 ./internal/update/... ./internal/cli/...
./internal/settings/...: ok. ./internal/gui -run
'TestUpdateChannelSwitch|TestWhatsNewKeyedByChannel|TestCoreScriptBudget':
ok (the app.js budget passes).
- GUI, chromium and webkit: update-channel (22: en, zh, zh-TW, ja, de at
900 and 420 wide: default lit, Stable saved, kept by another save,
kept over a reload, Every saved back, no click scrolls, no sideways
scroll at 420), i18n-keys, gui-ja, gui-de, gui-zh-tw and every
update-*.test.cjs: 253 of 253 pass.
- The live feed: /api/latest?channel=stable answers 0.1.1327 (out
2026-10-22 21:55 UTC, the last before Friday 10-23 00:00) with 15
assets after the first real cron run filled the ledger (400 releases
back to 10-10); /api/notes 0.1.1200..0.1.1327 gives 124 notes, none
empty (1213 and 1218 were never published).
After rebasing on
|
||
|
|
8f4469954e |
site: a Stable update feed, a release a week and an urgent one at once
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.
|
||
|
|
983371c3a2 |
site: FastAIToken's endpoints are on www.fastaitoken.com
FastAI asked for www.fastaitoken.com instead of api.fastaitoken.com. Chat and Responses now use https://www.fastaitoken.com/v1, Anthropic https://www.fastaitoken.com. Without a key, /v1/models and /v1/messages there answer sub2api's API_KEY_REQUIRED. Not tried: a request with a key. Run: node --test site/*.test.mjs (31 pass). |
||
|
|
9120acaffc |
site: Sidrune's in-app text says Claude, and its keys link carries their promo
Sidrune mailed a correction: their first materials said "Cloud" where they meant Claude. The zh and en notes are now their new sentences word for word, zh-TW follows zh, and keysUrl is their MAGPIE3 promo register link ($3 trial credit, used to count sign-ups from magpie). Name, website, endpoints, icon and dates are unchanged. Run: node --test site/*.test.mjs (31 pass); the promo link answers 200. |
||
|
|
ea1f9492bc |
cli: magpie tools lists, and magpie tool calls, the tools magpie's MCP servers give agents (iwinux)
iwinux on Discord (#feedback) wanted magpie's image generation, image recognition and web search without going through an agent's MCP, and had written a Python script for generate_image. magpie now has it: magpie tools [<name>] magpie tool <name> [--<param> <value>…] [<words>…] [-o <file|folder>] [--json] Both ask the running gateway's own MCP servers (gateway.OwnMCPServers: image, vision, web-search, plugin tools) over HTTP, with the local token and the magpie-tool/1 User-Agent, so the tools, schemas, models from Settings and usage counting are the ones an agent gets. Nothing is started besides (#3318: the cases sit before startUp, beside mcp). - Parameters are read against the tool's inputSchema: types (integer, number, boolean, array given once per item, object as JSON), enum, - and _ alike, --p v or --p=v. The words left over are the tool's one required text, else its prompt. An unknown flag or parameter, a missing required one, a bad value, a value given twice or both words and the same --param are refused with "nothing was called"; no request is sent. - A file path a parameter takes (its description says file and path) is made absolute, since the gateway doesn't know the current folder. - --help prints toolUsage (static): help is handled before anything runs. - A still-being-made answer is waited on with generation_result (1s between asks, 30 min at most). The gateway's image server now says so in _meta too: usemagpie.ai/pending is the id, usemagpie.ai/files the files made ({url, inline}); an older gateway is read from its text. - Images and videos are saved through imagemcp.Target (now exported): -o file or folder, else the current folder named from the prompt, numbered when more than one, never over a file that is there; a file not inline is downloaded by its path from the gateway asked (the token goes nowhere else). --json prints the raw answer and saves nothing. - No magpie at the address: "magpie isn't running at <url>: open the app or run magpie serve". MAGPIE_GATEWAY=<url> points at another. Docs: usage lines in magpie help, docs/reference.md (Use), the gateway routing subsystem page (_meta and the CLI), README en/zh, site docs start page en/zh/ja. Tests (internal/cli/tool_cli_test.go, never the network; every test sets MAGPIE_GATEWAY to its own httptest server): - TestToolsListsTheServersTools, TestToolReadsParameters, TestToolRefusesWhatItDoesntKnowAndCallsNothing (no tools/call, no file), TestToolHelpCallsNothing (no request at all), TestToolSavesTheImage, TestToolWaitsOnWhatIsStillMade (pending _meta, then the old text form, download with the key from the gateway asked, not the URL's host), TestToolErrorIsSaid, TestToolSaysMagpieIsntRunning, TestToolDrawsThroughTheGateway (the real gateway.New().Handler() with a fake vendor: lists, draws, saves the vendor's PNG). - TestImageMCPDrawsAndServesTheImage, ...SlowDrawingIsWaitedOn and ...MakesVideos now check the _meta. Red on the old behaviour: with withMeta setting nothing (what main answers) all three fail ("_meta map[], want pending img_…"). - Broken by hand: dropping the unknown-parameter check makes TestToolRefuses… red (the --model call was made); saving an inline image by its URL instead makes TestToolSavesTheImage red. Both restored. - TestHelpOnEveryCommandDoesNothing covers tool and tools. Run with this change on origin/main |
||
|
|
7d075df9dd |
site: FastAIToken on usemagpie.ai and in the app, 10-26 to 11-26
FastAIToken paid for a website card and an in-app partner seat, each
with its own register link so they can count them apart: utm=official
behind /go/fastai/home, utm=soft for the app's keys and website links.
The tagline is the owner's ("Claude / GPT / Deepseek 一站式接入方案,最
低0.6折,支持对公"), translated for en, ja, de and zh-TW. The logos
come from the two PNGs they sent: the website gets a horizontal mark +
wordmark, with the dark wordmark turned light for dark mode; the app
gets the F mark alone.
Endpoints are api.fastaitoken.com, the API host their own site names
(a sub2api deployment: /v1/models, /v1/messages and /v1/responses each
answer API_KEY_REQUIRED without a key). Not tried: a request with a
key. The test key they mailed couldn't be copied out of the mailbox,
so no model has answered through this entry yet.
Run: node --test site/*.test.mjs (31 pass).
|
||
|
|
0f6615ffc5 |
site: Sidrune AI is an in-app partner, 10-26 to 11-26
Sidrune AI paid for an in-app partner seat. It serves Chat Completions and Responses at https://sidrune.ai/v1 and Anthropic Messages at https://sidrune.ai; each answered with the partner's test key just before this commit (claude-sonnet-4-6), and real Claude Code in a sandbox HOME answered earlier today. The taglines are the partner's own sentences, "Cloud" kept as they wrote it; listed for zh and en, as they asked. The icon is their white mark on a black tile, since an entry has one icon for both themes. Run: node --test site/*.test.mjs (31 pass); the served feed at 10-26 19:00 through checkPartner and validPartners in a throwaway internal/provider test: kimi, apikeyfan, wandapi, corecode, sidrune all valid. |
||
|
|
c28d3e8b00 |
docs: plugins document auth.checkin (plugins#392)
MYCF711 (plugins#392): the plugin docs listed the hooks magpie calls without auth.checkin, magpie's own daily check-in hook several plugins use. The page now has a Check-in section (signature, the six outcomes, done vs failed, never solving a captcha, once a Beijing day per account and again after a failure, the account's scope), the intro list and the auth hook's shape name it, and the hooks sentence names refresh and checkin. In en, zh and ja; taken from host.js's checkin contract and provider/plugin_checkin.go. Run: tag balance checked in all three pages; no test covers docs pages. Not tried: rendering on the deployed site (the site is not deployed by this commit). |
||
|
|
ef0a03e137 |
otel: Langfuse is set up from its host and the project's two keys
A user on X asked for Langfuse built in. magpie could already export to Langfuse over OTLP, but Settings › Observability had the user type the endpoint .../api/public/otel and a percent-encoded Authorization=Basic%20<base64(pk:sk)> header by hand. Settings › Observability now has a Collector row: OTLP or Langfuse. With Langfuse, the user picks the host (Cloud EU, Cloud US, or Self-hosted with an address, which also covers Langfuse's JP and HIPAA regions) and fills in the public and secret keys. Once both keys are there, magpie saves: - the endpoint <host>/api/public/otel; - Authorization: Basic base64(pk:sk), in otel.headers as before, so the secret is stored where it was and a backup without keys leaves it out; - on a first setup, also x-langfuse-ingestion-version: 4, metrics off and export on. langfuse.com/docs/opentelemetry/get-started (read 10-26) gives the same header for every region and for self-hosted, and says that without it OTLP data can arrive up to 10 minutes late. A Langfuse endpoint set up by hand opens in this view with its keys decoded into the fields. Opening it saves nothing. Changing a key or the host keeps the user's other headers, their metrics and export choices, and an ingestion header they set or left out. Switching from another collector leaves that collector's headers behind and does not send them to Langfuse. The Observability page moved from app.js into the otel plugin (assets/plugins/otel/page.js, with i18n.js for its words, in Client), because app.js had 13 bytes of budget left. The app.js and core budgets are lowered to what is left (1,321,319 and 1,537,645; app.js is 1,321,313 after rebasing on |
||
|
|
c87a0179ba |
site: CoreCode is a partner in the Add sheet
CoreCode paid for an in-app seat (the owner confirmed the payment). The partner "corecode" serves Anthropic Messages at corecode.live. Its key page is corecode.live/keys and its website is corecode.live. No langs were asked for, so it is listed in every language. The en and zh taglines are the ones it sent, and zh-TW is made from the zh. It is listed from 10-26 to 11-26 +08:00, one month. The icon is their 64px SVG rendered at 128px (rsvg-convert). Run: node --test site/*.test.mjs passed 31 of 31. In a throwaway test in internal/provider, the served feed (worker.js served() over partners.js at 10-26) parsed as []Partner and passed checkPartner and validPartners. All four partners were kept, and corecode's links are /go links. Against the real service with the test key it sent: - /v1/models lists the four Claude models. - Real Claude Code in a sandbox HOME, with ANTHROPIC_BASE_URL set to corecode.live, answered "OK". - A plain curl to /v1/messages or /v1/chat/completions is refused: "only accepts requests from Claude Code". Agents other than Claude Code may be refused the same way. Not tried: adding it from the app's Add sheet, and requests through the magpie gateway. |