065ca02c283feb5587d29b328dcd92aee5d60b67
357
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
065ca02c28 |
provider: Fireworks Nexus preset, Nexus Auto on all three APIs (CNSA0422 on X)
Fireworks Nexus is an account and plan of its own (nexus.fireworks.ai, Pro $8, Team, Enterprise) on the platform's /inference endpoints, which speak chat completions, Responses and Anthropic messages (docs.fireworks.ai/nexus/apis-and-sdks). Its keys are made at nexus.fireworks.ai/settings/api-keys; a platform key carries no Nexus plan. The new preset fireworks-nexus (Add sheet tile "Nexus", the Fireworks logo) sets all three endpoints and lists only `auto`: Pro and Team refuse an open model named directly with a 403 (nexus/open-models), so the platform's /models would offer models the plan refuses, and no list is asked for. Enterprise users type their open models in, or set a models URL. The editor offers x-anthropic-api-key and x-openai-api-key, the headers Nexus Auto takes the user's own Claude and OpenAI keys in. No usage API is documented (only the nexus.fireworks.ai/usage dashboard), so there is no usage card. READMEs (en, zh) and docs/reference.md list it. Run (mote): go test -run 'TestFireworksNexus|Preset' ./internal/provider ok at the pushed head; go test -count=1 -timeout 45m ./internal/provider ./internal/gui ./internal/catalog at the pre-rebase base: provider and catalog ok, gui red only in the real-window AppKit tests killed at their deadline under mote's load (TestCoveredWindowStaysUp, TestClosingWindowMarksPageOutOfSight, TestPanelHiddenByWailsMarksPageOutOfSight; #2645, #4924, #4125). gofmt clean; go vet darwin, linux (nogui) and windows of internal/provider. Broken by hand: without NoList TestFireworksNexusPreset goes red, the fake platform list's accounts/fireworks/models/glm-5p3 listed and its /models asked. Not tried: a real Nexus key (none here), so neither `auto` on each API, the header passthrough, nor what /models answers for a Nexus key; the `auto` context window is left to the catalog (Nexus CLI writes 1M/131K). GUI suite not run: presets reach the Add sheet as data and no GUI file names a preset list. |
||
|
|
0baa223ec9 |
agent: Kun, magpie as a provider connection through its runtime API (zhongxingyuyes on X)
Kun (KunAgent 0.4.5, Electron, com.xingyuzhong.deepseekgui) keeps its
model providers in ~/.kun/data/model-connections.v2.json (or
$KUN_DATA_DIR) and changes them only through its runtime's admin API,
whose address and token are in runtime.json. magpie wires Kun by
calling that API while Kun runs:
POST /v1/model-connections/connect the magpie connection
PATCH /v1/model-connections/:id models, gateway address
POST /v1/model-connections/select the default model
DELETE /v1/model-connections/:id off
POST /v1/provider-config/transactions/preview, then commit
off when magpie's connection is the default: Kun refuses a
plain DELETE of the connection its default names, so the
transaction clears the default and removes it in one step,
and the default the user had before is put back.
When Kun isn't running, wiring says "open Kun, then try again"; the
file is never written behind Kun's back. Kun joins the agent list,
desktop-app detection, the env guard, the icon set (kun.png), the
READMEs and docs/reference.md and docs/subsystems/agent-wiring.md.
Run:
- WSL (Ubuntu 24.04), at the rebased head: go test -tags nogui
-run 'Kun|ListsModels|Picker|Spelled|HandWired|Sync|Drift|ListOnly|
Moved|LAN|Proxy' ./internal/agent ./internal/agentenv ok;
./internal/library ok; ./internal/gui -run 'Icon|Budget|CSS|I18n|
Picker' ok (agentenv: no tests match the filter).
- Windows (win-run): go test -run 'Kun|ListsModels|Picker|Spelled|
HandWired|Drift|ListOnly' ./internal/agent ok. CGO_ENABLED=0 go vet
for windows (agent, gui, agentenv), darwin nogui (agent, agentenv)
and linux nogui (agent, agentenv, gui): clean. gofmt -l clean.
- GUI (WSL, chromium + webkit): i18n-keys, i18n-en-no-cjk,
icon-one-tone, routing-client-icons, icon-tile together 63/63 at
this head. An earlier run at the pre-rebase head was 60/63, the 3
reds icon-one-tone's "Open Design one-tone ... Plugins page"
(chromium), which passed 48/48 alone there and at origin/main: a
load red (#5425).
- Real Kun 0.4.5 (Linux build, sandbox HOME, `kun serve`): connect,
a second model, Sync, restart, off. `kun run`
finished a turn through the gateway (POST /v1/chat/completions,
Bearer magpie-kun, reply "hello from magpie"). Off restored the
previous default, and with no previous default Kun was left with
none and no magpie connection.
Broken by hand: off through the plain DELETE again. The fake Kun now
refuses it as the real one does, and TestKunFromNothing and
TestKunFollowsTheGateway went red with "Deleted connection still has
references: default.providerId"; green with the transaction.
Not tried: Kun's desktop window itself (the runtime was driven
headless); macOS (mote refused SSH all session); `kun run --model`
(run uses its own default model, not the registry's default, so a
CLI run picks magpie's model only with --model).
|
||
|
|
6a450c4982 |
agent: Shelley, magpie's models as its custom models (on X, tweet 2120109384315658393)
"Can support Shelley?" Shelley is boldsoftware/shelley (Apache-2.0, Go,
`shelley serve`). It keeps models and profiles in its SQLite database,
not in a config file, so magpie talks to a running Shelley through the
same API its own Models and Profiles pages use, on the Unix socket it
opens for its CLI ($SHELLEY_SOCKET, else shelley.sock / shelley-N.sock in
$XDG_CONFIG_HOME/shelley or ~/.config/shelley; read from its source).
- Connect: each magpie model is a custom model (POST /api/custom-models,
provider_type openai, endpoint = the gateway's /v1, Shelley's own
gateway key, model_name = the catalog id, reasoning/images/max_tokens
from the catalog). Picking one makes it the default profile's model
(PUT /api/profiles/{name} with the whole profile, as the API requires)
and clears a thinking level the model can't take.
- The user's own values: the profile's model and thinking level are
stashed once and put back on Disconnect (to the server's default if
that model is gone); only the custom models magpie made (ids stashed)
are deleted, so a model the user pointed at the gateway by hand stays.
- Sync re-points magpie's models when the gateway port moves; Check names
a model left on an old address. Shelley not running is an error on a
pick and nothing on Sync/Check; turned off while Shelley is uninstalled,
the takeout is stashed and done when Shelley answers again (Alma's way).
- A notice: new conversations start on the pick, an open one keeps its
model. i18n for zh, zh-TW, ja, de.
- Icon: Shelley's own S mark from its assets, one tone. README (en, zh),
site index, docs/reference.md, docs/integrating.md, site integrate
pages (en, zh), docs/subsystems/agent-wiring.md.
- Library: listed as "not looked at (#5897)" like the other new agents.
- Shelley has no Windows build, so there is no Windows or WSL wiring.
Run (mote refused SSH for the whole session, kex reset, so runs went to
the Linux VM and the Windows box):
- Real binary: shelley v0.1718.926152762 linux_amd64 (sha256 66cb5acb…
checked) in a sandbox HOME/XDG_CONFIG_HOME/-db on the Linux VM, with a
throwaway test driving it against a fake OpenAI upstream at
MAGPIE_ADDR: connect made custom model glm-4-6-… and the default
profile's model; POST /api/conversations/new sent two
/v1/chat/completions with model=relay/glm-4.6, auth magpie-shelley,
UA Shelley/58d5f200; disconnect left the profile as before and no
custom models. Check "" and Drift nil while connected.
- Linux (wsl-run, nogui): go vet ./internal/agent ./internal/agentenv
./internal/library; go test ./internal/agent ./internal/agentenv
./internal/library ./internal/profile ./internal/sessions: ok except
TestGrokInstalled (#3548, red on base too) and, before its fix here,
TestEveryAgentInLibrary. internal/cli times out there in
TestEveryAgentFieldNameWritesNothing (43m, the #5234 class).
- Windows (win-run): go vet ./internal/agent ./internal/agentenv;
GOOS=darwin and GOOS=linux -tags nogui vet; the Shelley, applied,
rewire, disconnect, mark and kept tests: red only in
TestAppliedOfParsesAnUnchangedFileOnce (#5950),
TestAsideOfflineDisconnectRestoresWithoutDaemon (#5951) and the #4786
allocation tests, all red on base
|
||
|
|
c2c2c82ca8 |
agent: Tuanjie Cowork, a magpie provider and model in its Custom Models (Charles24209792 on X)
Tuanjie Cowork (Unity China's coworker app, dev.codelycowork.desktop,
2.1.6-stable) keeps the user's own models in ~/.codely/settings.json:
customModelProviders {id, name, baseUrl, apiKey, authType} and
customModels {id, model, providerId, displayName, roles, wireApi,
supportsMultimodal}, read afresh on every lookup. Read from the app's own
core (tZ/oE for the file, Mwi for a session's OPENAI_BASE_URL/KEY, BOe
for the model list, rha/sha for its startup migrations).
magpie adds a provider and a model of its own, both id "magpie": the
gateway's /v1 with Cowork's own magpie key, the model picked, wireApi
chat. The user's providers and models and every other key stay as
written; a name or roles given magpie's entries in Cowork are kept when
the model changes. Off takes both out, and the file too when magpie made
it and nothing else is in it. A provider or model with id magpie that is
the user's own is left alone, with an error. Which model a chat is on is
Cowork's own per-workspace pick, which magpie doesn't write; a notice
says to pick "<model> (magpie)" in its model menu while it runs. Skills
go to the shared ~/.agents/skills, which its core scans. Icon from the
app's icon.icns. Lists, READMEs, reference, agent-wiring doc, i18n.
Run:
- go test ./internal/agent ./internal/library ./internal/gui on mote;
TestTuanjieCowork* and TestHandWiredMagpieProviderSiblings on Windows
(win-run).
- gofmt; go vet darwin, linux -tags nogui, windows.
- GUI, chromium and webkit: i18n-keys, i18n-en-no-cjk,
agent-notice-lang, gui-de, gui-ja, gui-zh-tw, icon-one-tone,
icon-tile, routing-client-icons, usage-agent-filter-icons,
agent-connect, agent-models, agent-layout.
- Cowork's own code on magpie's output: its tZ, oE, rha, sha, cE, KGa,
Mwi, kOe and BOe, extracted from the 2.1.6 core, run in node on the
settings.json magpie wrote (with the user's own provider, and fresh).
Its migrations leave magpie's entries; cE("magpie") finds the model,
the picker label is "deepseek/pro (magpie)", a session gets
OPENAI_BASE_URL http://127.0.0.1:3425/v1 and magpie's key, the list
URL is /v1/models, and the user's glm-4.5 is still there.
Where: the packages, vets and GUI files above ran on mote at b834dc2a7
(this change on
|
||
|
|
4a9142ccd4 |
agent: Obsidian, magpie's models in Copilot for Obsidian (shirotokiren on X)
shirotokiren asked for magpie to set up Obsidian's AI plugins, naming Copilot and Smart Connections. The new agent "obsidian" finds the vaults in Obsidian's obsidian.json: ~/Library/Application Support/obsidian on a Mac, %APPDATA%\obsidian on Windows, and on Linux $XDG_CONFIG_HOME/obsidian or the Flatpak or Snap folder. In each vault that has Copilot for Obsidian 4+ (.obsidian/plugins/copilot), magpie edits data.json in the shape Copilot 4.0.19 reads: - it adds providers.magpie, openai-compatible at /agent/obsidian/v1, with requiresApiKey false and no keychain id; - it adds one configuredModels entry per magpie model, with a deterministic uuid v5 id, plus limits, image input and reasoning efforts; - new models go into backends.chat.enabledModels; - on the first wire it sets defaultModelKey, and stashes the old value. A sync keeps the models the user turned off, their default, and the name they gave the provider. It writes only the keys that change (edit.PatchJSON, then temp and rename), and nothing when nothing changed. A provider named magpie counts as magpie's only when its baseUrl is magpie's Obsidian route. One the user added by hand under that name is theirs: it doesn't read as connected, Disconnect leaves it, and Connect says so and writes nothing. Disconnect takes magpie's entries out and puts the old default back. Copilot 3, a data.json it can't parse, and no vault with Copilot are each an error, and nothing is written. A notice asks the user to reload Copilot, since Obsidian holds the settings in memory. The gateway now answers CORS for app://obsidian.md keylessly (appOrigin). Copilot streams through the window's fetch, and without CORS headers it can read no reply. Only Obsidian's own window sends that origin, so it gets no more than its calls without an Origin get. From the network it still needs a key. Smart Connections is not wired. Its free plugin embeds with a local model only, and its API providers are in the closed Pro plugin, with keys in the keychain. Run (mote, at |
||
|
|
5e3f14f21f |
agent: Paimon, magpie's models through its litellm provider (ditangongyuan on X)
Paimon (aisk/paimon, `uv tool install paimon`) is a terminal coding agent on pydantic-ai. Read at 7f7fa51 (config.py, llm.py): its settings are one JSON file, $PAIMON_CONFIG_HOME/config.json, else ~/.config/paimon/config.json on every OS. "model" is provider:name, and "providers" keeps each provider's api_base and api_key. magpie connects it through pydantic-ai's litellm provider, an OpenAI-compatible proxy that profiles a vendor/model name by its vendor, as magpie's ids are spelled, and which Paimon's login never offers: model = litellm:<catalog id>, providers.litellm = the gateway's /v1 and magpie's key for Paimon (0600, as Paimon writes it), and compaction.context_window = the model's window. Paimon compacts against that only for names genai-prices doesn't know, which magpie's ids aren't; for a model whose window magpie doesn't know it gets the user's own back, never the last model's. What the user had in the three keys is stashed and put back on Disconnect (or `magpie paimon default`); the rest of the file is untouched, and a file magpie made goes again. A model picked in Paimon itself while magpie's provider stays is the user's from then on. Requests are told apart by Paimon's paimon/<version> User-Agent. WSL distros, the PAIMON_CONFIG_HOME isolation, notices in every language, icon, READMEs, docs/reference.md, agent-wiring.md and the site's list come with it. Run: mote refused SSH all session (kex reset), so the Linux runs went through wsl-run (magpie-desktop) and Windows through win-run: - go vet: linux -tags nogui, GOOS=windows, GOOS=darwin -tags nogui on internal/agent, agentenv, library: ok. gofmt -l: clean. - go test -tags nogui ./internal/agent/... agentenv library gui cli (WSL, base |
||
|
|
9c39edb92c |
agent: Avibe, magpie as a model source through its Model Hub (alex_metacraft on X)
Avibe (avibe-bot/avibe, avibe-os on PyPI, the `vibe` CLI) runs its own
agent, Vibey, and Claude Code, Codex and OpenCode, all on models from its
Model Hub. Its sources live in model_hub.sources of config/config.json in
$AVIBE_HOME (else ~/.avibe, else a legacy ~/.vibe_remote), but a source
can't be written there by hand: its key is sealed in the hub's credential
store and Avibe puts it into its agents' route chains as it is made.
So the Avibe row adds "magpie" the way Avibe's Models page does, through
its internal API (POST /internal/model-hub on state/dispatch.sock, or on
Windows the loopback port + bearer of runtime/control-ipc/endpoint.json):
create_source with kind api_key, vendor custom, base_url the gateway's
/v1, key agentKey("avibe"), protocol openai_chat and save_unverified.
Avibe then lists the models from /v1/models and adds the source to
Vibey's, Claude's, Codex's and OpenCode's chains itself.
- openai_chat, not openai_responses: for a Responses source Avibe's
CLIProxyAPI runs Codex's executor, which sends codex-tui headers the
gateway would take for Codex.
- Off is delete_source with force, sent again with the would_remove_hops
and would_interrupt Avibe answers, as its page confirms them. Sync is
refresh_source the same way; on a moved gateway the source is made
again (the key goes with the address; patch_source can't change it).
- The source id is stashed; a custom source at the gateway's /v1 counts
as magpie's too and is stashed once seen.
- Every change needs Avibe running; otherwise the switch says to run
`vibe start` (errAvibeDown). Nothing is written to config.json.
- A sync moves the source only from the gateway's own address on an
older port (avibeMoved). One the user pointed at a NAS's or the LAN's
magpie, a local proxy's route, or a WSL distro's way to Windows stays,
as kept.away keeps every file-written agent's; a Rewire after a port
move sets it again through the field's Set.
- Every test of the package but Avibe's own finds an Avibe running for
each home (runningAvibe, served in-process), so the tests that connect
every agent (gateway moved, LAN and proxy addresses kept, drift,
ListOnly) take Avibe in too.
- The logo is a tile solid to its edges, so it joins app.css's tile rule
(icon-tile.test.cjs went red without it).
- AVIBE_HOME joins agentenv and the ~-expanding path vars (Avibe expands
it). Icon from Avibe's assets/logo.png (MIT), 64px.
Run:
- Real Avibe 3.2.5 (uv tool install avibe-os) in a sandbox HOME in WSL
magpie-desktop, with a fake OpenAI server as the gateway: magpie's own
code (a throwaway test, AVIBE_HOME + MAGPIE_ADDR) connected it, Avibe
discovered both fake models with "Authorization: Bearer magpie-avibe"
and put the source in vibey/claude/codex/opencode chains; Sync
refreshed; a gateway move to :3592 made the source again there and
stashed the new id; a second run found the source by address alone
and still followed the move; off removed it (list_sources []).
Earlier, by hand: Anthropic /v1/messages and /v1/responses through the
hub reached the fake as chat completions.
- wsl-run, at this head rebased on origin/main
|
||
|
|
4011873001 |
catalog: models.dev unreachable falls back to the last copy or a shipped one, retried in minutes (creeksuen on X)
Where models.dev can't be reached (a network in China), the catalog that gives prices, context windows, reasoning levels and names degraded: - first run: no catalog file, so every model unpriced, no windows, and a plugin's provider listed no models, until a fetch got through; - a failed fetch: KeepFresh tried again only after an hour, and the app's backend waited up to 30s on models.dev before it asked the vendors for their lists; - Sync wrote models.json in place (os.WriteFile), so a reader could catch it half written, and a parse failure left no catalog at all. Now: - Sync writes the catalog through a temp file renamed over it (writeWhole, shared with labs.json). A refused, hanging or wrong answer (HTML, cut-off JSON) keeps the last good copy byte for byte. - The binary ships models.dev's api.json of 2026-11-10 (internal/catalog/bundled/api.json.gz, 608KB; go:generate refreshes it). loadGen reads magpie's copy, then OpenCode's, then the shipped one, passing over one it can't parse. Seed (app backend, magpie serve, the plugin host) writes the shipped copy into the cache when there is none or it is older, dated bundledAt, so the plugin host reads it and Stale still has the real one fetched. A test binary has it off (bundledOn). - The app's backend no longer waits on models.dev before the vendors' lists when a catalog is there; KeepFresh fetches beside them, and a failed fetch is tried again after 2 minutes, doubling up to the hour. - The fetch already goes through http.DefaultClient, which netproxy.Install routes through the proxy in Settings, *_PROXY or the system proxy; there is no models.dev mirror setting to honour. Run (mote, at the rebased head unless said): - gofmt -l: clean. go vet darwin (catalog, plugin, cli, gui), linux -tags nogui and windows: ok. - go test ./internal/catalog: ok at the rebased head; ./internal/plugin, ./internal/gui, ./internal/cli: ok at the pre-rebase head but for TestEveryRouteHasACommandOrIsNamed, red at that older base (a GUI route this change doesn't touch) and ok at the rebased head. - New tests, each fake models.dev on 127.0.0.1 (cut connection, hang, captive-portal HTML, cut-off JSON): TestFailedSyncKeepsLastGood, TestFirstRunOfflineAnswersFromShippedCopy, TestUnreadableCacheFallsBackToShippedCopy, TestSeed, TestSyncWritesThroughRename, TestFailedFetchRetriedSoon. - Windows (win-run): the catalog tests ok, 15 of 15 with -count=15; TestSyncWritesThroughRename skips there (it holds the file open). Broken by hand, each red: Sync back to os.WriteFile (TestSyncWritesThroughRename); load without the shipped copy (TestFirstRunOffline…, TestUnreadableCache…); Seed over a newer catalog and Seed dated now (TestSeed); first retry after the hour (TestFailedFetchRetriedSoon). Not tried: the real app started with models.dev blocked; the full suite (started after the tag). |
||
|
|
8cc4bd7e3c |
agent: Craft Agents, through a keyless connection at the gateway (springg1998 on X)
Craft Agents (lukilabs/craft-agents-oss, thecraftagents.com) keeps its LLM connections in config.json under $CRAFT_CONFIG_DIR or ~/.craft-agent (paths.ts, storage.ts, llm-connections.ts, v0.15.8). magpie adds one connection: slug magpie, providerType pi_compat, authType none, baseUrl at the gateway's /agent/craft-agents/v1, customEndpoint.api openai-completions. Its models are the ones picked for it, and defaultModel is always one of them, because Craft resets a default that isn't in the list to the first. magpie makes it defaultLlmConnection. The user's default is stashed (as JSON, "" for none) and put back on off when that connection still exists. A name the user gives magpie's entry stays, and a sync with nothing to change writes nothing. A config.json with no workspaces list is one Craft doesn't load, so magpie never creates one: open Craft once first. Picking one of the user's own models removes magpie's entry and sets that model on their default connection. Sessions keep the connection they started on, so the notice says new sessions use it (zh, zh-TW, ja, de). Detected by ~/.craft-agent, Craft Agents.app (com.lukilabs.craft-agent), or %LOCALAPPDATA%\Programs\@craft-agentelectron\Craft Agents.exe (per-user NSIS; the GUID is the UUID v5 of the appId, derived the same way as dsh's known one). Skills go to ~/.agents/skills. CRAFT_CONFIG_DIR is in agentenv.Vars. Icon from Craft's own icon.svg (#9570BE). README, reference, agent-wiring and site list it. Run on mote, first on origin/main |
||
|
|
987eac0aae |
gateway: a reported call keeps the model asked for and the one that answered (req, served) (#3534, realLemonawa on X)
POST /v1/magpie/usage/requests took a usage.jsonl line's fields except
req and served, and refused a record that carried them, so a call an
app reported showed an empty Requested and Served model on the
Requests page. Both are now optional fields: req is the model the app
asked for (an alias or a group of its own), served the one its vendor's
reply said answered. Each is checked as model is (a string, at most
256 characters, no control characters) and kept only as sent; a record
without served is never filled from model, so it says nothing of what
answered. The GUI already shows Record.Requested and Record.Served.
The issue's other metadata (the rest of a gateway row's columns) is
left out: only the two models were asked for by name.
Run (mote): go test -count=1 -run 'TestUsageIngest|TestReported'
./internal/gateway/ ok. go vet darwin (gateway, usage), GOOS=linux
-tags nogui and GOOS=windows go vet ./internal/gateway/ ok. gofmt clean.
Broken by hand: req and served taken out of ingestFields again;
TestUsageIngestRequestedAndServed went red ("req: not a field a
reported record takes").
Not tried: a real app reporting its calls; the full suite runs after
the tag.
|
||
|
|
d109ec8da8 |
agent: miniQ, its provider on magpie's gateway (xiancrong on X)
miniQ (LeadingThink/miniQ, 0.1.213) is a desktop coworker and a `miniq`
terminal, both clients of one miniq-daemon. Its model is one provider in
<data dir>/settings.json, {baseUrl, apiKey, model, apiProtocol}: the data
dir is $MINIQ_DATA_DIR, else the folder miniq-data-dir.json names, else
%LOCALAPPDATA%\miniq or ~/.local/share/miniq (macOS too).
Picking one of magpie's models writes the provider as the gateway's /v1,
magpie's key for miniQ (it sends no User-Agent of its own), the catalog id
and apiProtocol chat_completions ("auto" guesses a protocol from the model
name). What the user had is stashed whole and put back on Disconnect; the
rest of settings.json is left alone. A settings.json magpie made is 0600
and goes again when magpie steps out. The daemon reads settings.json once
and writes its copy back on every change, so a running one is told too:
settings.update over the WebSocket daemon.json names, as miniQ's own
Settings does, which also moves open chats. Notice compares the daemon's
settings.get with the file and asks for a restart when they differ.
"On magpie" is known by magpie's key, so a moved port or a proxy in front
of the gateway is told apart by Check (baseUrl and apiKey). WSL: the
distro's ~/.local/share/miniq. Icon, i18n (zh, zh-TW, ja, de), READMEs,
reference, site, MINIQ_DATA_DIR in agentenv.Vars.
Run:
- At the pushed head, rebased on
|
||
|
|
5a02bf8c14 |
agent: mu, Pi with a judgment kernel, wired in ~/.mu/agent (xteam3301 on X)
mu (github.com/qybaihe/mu, npm mu-agent, the mu command and the mu
desktop app) is Pi 1.4.0 with a judgment-kernel extension. Its
kyrn/bin/mu.mjs starts Pi on its own agent folder, so Pi's settings.json
and models.json live in ~/.mu/agent, and the desktop app runs the same
Pi on the same folder. magpie now wires it as it wires Pi.
- agent: mu (piLikeKeyed). Its folder is found as mu.mjs finds it:
$MU_AGENT_DIR, $KYRN_AGENT_DIR, $MU_CODING_AGENT_DIR,
$KYRN_CODING_AGENT_DIR ("~" expanded), else ~/.mu/agent, or
~/.kyrn/agent while ~/.kyrn is a folder and ~/.mu isn't. Its requests
say pi/<version>, so the provider's key magpie-mu names it. The alias
is mu-agent. Its judge (~/.mu/mu.json) is left alone.
- `mu` is also maildir-utils' command (brew, distros). A mu on PATH
that neither is nor names mu.mjs / mu-agent is not taken for it
(notMuAgent).
- Gemini models stay on Chat for mu, as for Pi and StepCode (piAsked).
- WSL kind at ~/.mu/agent (found by its folder, not the command); CLI
update through npm mu-agent; the desktop app (io.github.qybaihe.mu,
mu.app, %LOCALAPPDATA%\Programs\mu\mu.exe, /opt/mu).
- agentenv and appdir know the four variables.
- library: mu's AGENTS.md / AGENTS.override.md, its mcp.json (Pi's
native format) and skills in its folder; it reads ~/.agents/skills.
- GUI: a one-tone icon. Default in its model picker says it clears the
default and mu picks one itself (PICKS_ITSELF).
- docs: READMEs, reference.md, agent-wiring.md.
Run (mote, at this tree before the rebase):
- gofmt -l internal/ clean; go vet darwin, GOOS=linux -tags nogui and
GOOS=windows of agent, library, appdir (and agentenv on darwin): clean.
- go test -count=1 ./internal/agent ./internal/library ./internal/appdir
./internal/agentenv ./internal/usage: ok (agent after its maildir
fixture stopped using testenv.Program, which refuses a non-script).
New: TestMu, TestMuDir, TestMuNotMaildirUtils, TestMuTarget; mu added
to the handwired, spelled, Pi scope, scope-gone and Gemini-on-Chat
lists.
- Windows (win-run on xiaomi-gpu): go test -run 'TestMu|TestPiScope|
TestScopeGone|TestHandwired|TestSpelled|TestPiFolderKeepsGemini'
./internal/agent ./internal/library ./internal/appdir: ok.
- Real mu-agent 0.3.9 (Node 22.22.0) on mote in a sandbox HOME, a
sandbox gateway on 47822 over a fake OpenAI upstream: `magpie agents`
found mu with the user's deepseek model; `magpie mu magpie/fakeup/m1`
wrote defaultProvider magpie and providers.magpie with key magpie-mu,
keeping the user's deepseek provider; `mu -p ping` answered "pong from
fake upstream" (upstream saw POST /v1/chat/completions, model m1,
UA pi/0.3.9); `magpie usage today` counted the call under agent mu;
`magpie mu default` put settings.json and models.json back byte for
byte (cmp).
- GUI, chromium and webkit: pi-default-note (with mu added),
icon-one-tone, icon-tile, mono-icon-redraw, routing-client-icons,
usage-agent-filter-icons, i18n-keys, i18n-en-no-cjk, agent-connect,
agent-models, agent-layout: 88 of 88.
- Rebased onto
|
||
|
|
93a33d8174 |
agent: OpenBot's icon, its requests named its own, its skills in the Library (SSNQT on X)
SSNQT on X, magpie 0.1.3503 on macOS, OpenBot (
|
||
|
|
e7fe52fdc3 |
minimax: follow the data folder MiniMax Code Desktop moved, not ~/.minimax (YujunT46308 on X)
YujunT46308 on X (magpie 0.1.3519, MiniMax Code 3.1.13 CN): with the app's data folder moved to another parent (localRuntimeDataParentDir), magpie went on writing ~/.minimax/config.yaml, which the app no longer reads. How MiniMax Code 3.1.13 finds it, read from its own app.asar (dist/main/modules/local-runtime/data-dir.js, resolveLocalRuntimeDataDirSelection; @mavis/config's config.js for the runtime): MINIMAX_DATA_DIR, then MAVIS_DATA_DIR, then the desktop setting, then ~/.minimax. Settings' data-folder move keeps the parent as config.localRuntimeDataParentDir in its electron-store file (storage.ipc.js: minimax-agent-cn-config.json for the China build, minimax-agent-config.json for the global one) in Electron userData, named by app-identity.js: "MiniMax" (CN) / "MiniMax Agent". The data folder is <parent>/.minimax. What changed: - appdir.MiniMaxDirIn resolves the folder in that order, reading the store under ~/Library/Application Support on a Mac and %APPDATA% on Windows. A missing, unreadable or unparseable store, or a parent that isn't an absolute string, is ~/.minimax, as electron-store itself reads a file it can't parse as its defaults. - internal/agent's MiniMaxDir (detection, connect, restore, Sync, Check) and internal/sessions' MiniMaxDir (Usage's calls) both use it; the Library's skills follow a.Dir. WSL's mcode still uses the distro's ~/.minimax (no desktop app there). - MAVIS_DATA_DIR joins agentenv's variables, so tests sandbox it. - agent-wiring.md and reference.md say where the folder comes from. Run: - On mote, the real MiniMax Code 3.1.13 CN arm64 dmg: launched with no setting, userData was ~/Library/Application Support/MiniMax holding minimax-agent-cn-config.json; with config.localRuntimeDataParentDir set to a folder, the next launch created <parent>/.minimax/config.yaml. appdir.MiniMaxDir() against that real store printed <parent>/.minimax. (The test data I made on mote was removed after.) - mote-run go test -count=1 ./internal/appdir ./internal/agentenv ./internal/sessions ./internal/library: ok. ./internal/agent -run 'MiniMax|Minimax|WSL|Env|Spelled|Handwired': ok. - win-run go test -run MiniMax ./internal/appdir ./internal/agent ./internal/sessions: ok, TestMiniMaxDirIn and TestMiniMaxCodeMovedByDesktop ran (not skipped) with %APPDATA% paths. - gofmt -l clean; go vet of the touched packages for darwin, windows and linux (nogui, CGO off) ok. Broken by hand: with the desktop store read turned off, TestMiniMaxDirIn and TestMiniMaxCodeMovedByDesktop go red (the folder reads as ~/.minimax). Not tried: the Windows desktop app itself (userData %APPDATA%\MiniMax is Electron's appData plus the app name, the same rule seen on the Mac); the global build's store with a real install; a store mid-rollback (the app's guard writes the restored parent back to the same key on its next launch). A user who also runs the mcode CLI without MINIMAX_DATA_DIR has it on ~/.minimax, which magpie now leaves alone while the desktop folder is moved. |
||
|
|
efb75ad1f0 |
gateway: client certificates (mTLS), and Remote Magpie can show one (hhdaxia on X, #5596)
hhdaxia on X asked for mTLS so a shared magpie isn't open to the internet on a key alone; clxsh's #5596 asks Remote Magpie to send a client certificate and key (PEM) to an Nginx doing mTLS, the server still verified, the Gateway Key still sent, for models, the test and streaming. Server side (magpie's own CA, internal/mtls): - Settings -> Network and sharing -> Require a client certificate, or `magpie mtls on|off|issue <device>|list|revoke`. Issue saves client.pem, client-key.pem and ca.pem to ~/Downloads/magpie-<device>; the key is kept nowhere else. - With it on, a peer that isn't this computer or a WSL distro must finish the TLS handshake with a certificate the CA issued and hasn't revoked (RequireAndVerifyClientCert + VerifyConnection -> Admits). The TLS config is chosen per connection, so the switch needs no relisten; without --tls-cert the server certificate is made by the CA in memory. - lanGuard and ClientCertGuard (magpie web's page) refuse 403 what still arrives without a verified one: plain HTTP, a proxy or tunnel on loopback (unless MAGPIE_TRUST_PROXY=1), the page port, a connection from before the switch, a certificate revoked since its handshake. - Loopback, this computer's own address and a WSL agent with its key are answered as before. - A page open from another computer can't shut itself out: without a certificate it can't turn mTLS on, and it can't revoke or reissue the certificate it came with. Client side: a provider with a base URL of the user's own (Remote Magpie included) takes ClientCert, ClientKey and ServerCA paths (editor: Advanced -> Client certificate). netproxy.WithClientCert shows them to that provider's own hosts only, on a transport per identity keyed on the files' mtimes; through an https:// proxy such a request is refused. Save refuses half a pair, a pair that doesn't match and a CA that isn't one. Run (on mote, at 4024df0f9, this commit before its rebase): - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows. - go test -count=1 ./internal/mtls ./internal/netproxy ./internal/provider ./internal/settings ./internal/settingsapi ./internal/cli ./internal/gui ./internal/gateway: ok (gateway 893s). The first run had three reds of this change, each green at base and fixed here: TestEveryRouteHasACommandOrIsNamed (the mtls routes now name `magpie mtls`), TestSettingsSaveKeepsWhatItDoesNotSend (MTLS kept), and TestGoroutineDumpAnswersWhileRequestsWait (mtlsRefuses asks whether the peer is remote before reading settings, so a local request never waits on the settings lock). TestHandedOffGatewayAnswersAConnectionNotedLate was reset because ServeTLS now always wraps the listener: tlsListener hands a connection it took as Close came to the server instead of dropping it. -count=3 of these and every TLS/MTLS/Handover/Relisten test ok. - Every route without a certificate, with a foreign one, a revoked one and a good one: TestMTLSOtherComputerHandshake, TestMTLSGuardEveryRoute, TestMTLSThisComputerAndProxies, TestMTLSToggleWithoutRelisten, TestMTLSRevokeMidConnection, TestClientCertGuardPage. Remote Magpie against an httptest server asking RequireAndVerifyClientCert: models and the connection test fail without the certificate and pass with it (TestRemoteMagpieClientCert). - GUI: the 92 files near the change (settings-*, provider-*, editor-*, lan-*, i18n*, allow-ips, remote-*, mtls-settings new) in Chromium and WebKit: 2904 pass, 74 fail, all in nine files red the same way at base |
||
|
|
9e51c5c2a8 |
gateway keys: account groups a key may use or keep out (LeiWang_2000 on X)
LeiWang_2000 asked for account groups, so a gateway key can be limited to
a group of accounts, or keep a group out, instead of picking accounts one
by one (on top of v0.1.3504's "Keep accounts out").
An account group is a named set of accounts of any providers, kept in
account-groups.json beside caller-keys.json (access.AccountGroup). A key's
account list names one as "@<id>" (use only its accounts) or "!@<id>"
(every account but its). identityOf expands the groups of the key and of
its issuer on every request, so every route that reads the Identity
(AllowsAccount, HeldModels, the routes' model checks) holds to the group
as it is now: a membership change reaches every key naming it at once, and
an account signed out since matches nothing. Fails closed: a group gone,
or a used group with no account, holds the key to nothing
(heldToNothing); unreadable groups refuse a key naming one and leave other
keys alone. A group a key names can't be removed (the error names the
keys); ReplaceAccount moves a rotated key in the groups too. Groups are
backed up and synced (WebDAV) with the gateway keys. A magpie older than
the mark reads "@<id>" as an account of no provider and fails closed.
CLI: `magpie gateway-key groups add|set|rename|remove`, and
`gateway-key accounts <id> @Work` / `!@Work`.
GUI: an "Account groups" editor (modal, rows of name + accounts picked in
the app menu) from the keys' header; the key's account menus list the
groups as options; the badge says "Work" / "Not Work". No layout change to
the rows.
Tests:
- internal/access TestAccountGroupHoldsAKey / ...AnIssuedKey: save rules,
name->id, used+kept-out refused, held/kept-out allows and models, a
change reaching both keys, rotate, remove refused, empty group, groups
gone, unreadable groups.
- internal/gateway TestGatewayKeyAccountGroupsKeyedRoutes: a held and a
kept-out key on 7 routes, flipped by a group change, and nothing asked
once the group is gone.
- internal/cli TestGatewayKeyAccountGroupsCLI.
- GUI gateway-key-account-groups.test.cjs: 5 languages x chromium/webkit
x 1100/440.
Broken by hand (each red, then restored):
- identityOf not expanding groups: access test red, gateway test 403.
- a gone/empty held group not becoming heldToNothing: access test red
("held to an empty group"), gateway test asked kA with the group gone.
Run on mote at this tree: gofmt -l clean; go vet darwin (touched
packages), GOOS=linux -tags nogui ./..., GOOS=windows ./... clean;
go test -count=1 access, cli, gui (size budgets included), backup,
davsync, gateway: all ok;
GUI: every gateway-*.test.cjs plus i18n-keys, i18n-en-no-cjk, key-page,
plugin-kernel, readable-focus, chromium + webkit: 571 of 574 at
--test-concurrency=6. The 3 reds: gateway-caller-keys and
gateway-key-models chromium en (the 560px read, red on main too, fixed in
the next commit), and gateway-key-groups zh once, 12 of 12 alone (#1974).
Rebased on
|
||
|
|
0842bc517e |
gateway keys: a key may keep some accounts out and use every other, later ones too (LeiWang_2000 on X)
A gateway key could only be held to accounts picked one by one, so an account signed in after the key was saved was never used. An entry "<provider>/!<account>" (access.ExcludeMark) now keeps that account out: the key uses every other account of the provider, one added later too, and never the one kept out. - access: AllowsAccount refuses a kept-out account first, and counts only the entries naming accounts to use for "the providers it names", so a provider with only kept-out entries serves every other account. HeldModels and AccountModels ignore kept-out entries (keeping one out holds the key to no model). An issued key keeps out what its issuer does (foldAccounts). CleanAccounts resolves the ref after the mark and refuses an account both used and kept out. ReplaceAccount moves kept-out entries too. AccountsShown renders "X; every account but Z" for the CLI and the gateway's refusals. - CLI: `magpie gateway-key accounts <id> relay/!Second` prints "every account but relay/Second"; list and models read it. - GUI: the key row's menu has "Keep accounts out", which opens the app's menu (openProtoMenu, no native select); a badge names what is kept out and opens the same menu; an account the key was held to and is now kept out leaves the held ones. Strings in zh, zh-TW, ja and de. - docs: reference.md and providers-accounts.md. Run (mote, at this tree): - gofmt -l internal/ clean; go vet darwin, GOOS=linux -tags nogui and GOOS=windows of access, cli and gateway: clean. - go test -count=1 ./internal/access ./internal/cli ./internal/gateway: ok. New: TestKeptOutAccounts, TestKeptOutFolded, TestKeptOutReplaced; TestGatewayKeyKeptOutAccountsKeyedRoutes (chat, messages, responses, count_tokens, images, videos, System One and /v1/models over a key provider, a remote magpie and a Decide provider: the kept-out key never asked, every account kept out asks nothing, a key added after the gateway key was saved is used); TestGatewayKeyKeptOutCodexAccounts (Codex sign-ins, one signed in later used); TestGatewayKeyKeptOutQuotaCards; TestGatewayKeyAccountsCLI extended. - GUI: gateway-key-kept-out.test.cjs, chromium and webkit, 1100 and 440 px, en zh zh-TW ja de: 20 of 20. Every gateway-*.test.cjs and i18n-*.test.cjs file in both engines: 496 of 516, the 20 red all gateway-card's count of the row menu's items (5, now 6), updated here; then gateway-card, api-key-theme, gateway-connect-keys, gui-de, gui-ja and gui-zh-tw: 39 of 39. - Again after rebasing onto |
||
|
|
b922e51685 |
agents: nanobot gets magpie as a provider of its own (Niapyaya on X)
nanobot (HKUDS/nanobot, pip install nanobot-ai) is now an agent magpie connects. Its config is read from its own source (5c72ced, 0.4.1): ~/.nanobot/config.json, camelCase or snake_case keys, any extra key under providers an OpenAI-compatible endpoint whose name is stripped from the model. magpie adds providers.magpie (apiBase at the gateway's /v1, its key, and extraHeaders User-Agent nanobot), and sets agents.defaults provider magpie, model magpie/<id> and contextWindowTokens when the window is known. What the user had there, both spellings, and a modelPreset that would go over magpie's model, is stashed and put back on disconnect, the window as a number. A file magpie made goes again. Also in WSL distros, with a notice in every language, the icon (a tile in app.css's rule), READMEs, site list, docs/reference.md and agent-wiring.md. Run: - real nanobot 0.4.1 on mote in a sandbox HOME (~/nbsb), a sandbox gateway on 47812 over a fake OpenAI upstream: `magpie nanobot magpie/fakeup/m1` wrote the config and kept the user's relay provider and channels; `nanobot agent -m ping` answered "pong from fake upstream"; the upstream saw POST /v1/chat/completions, model m1, UA nanobot; `magpie nanobot default` put relay/glm-4.6 back exactly. - go test ./internal/agent ./internal/gui ok; ./internal/gateway and ./internal/cli -run 'Client|UA|Agent|Empryo' ok; go vet darwin, linux -tags nogui, windows ok; gofmt -l clean. - GUI, chromium 110/110 and webkit 65/65: i18n-keys, i18n-en-no-cjk, agent-notice-lang, gui-de, gui-ja, gui-zh-tw, icon-one-tone, icon-tile, routing-client-icons, usage-agent-filter-icons, agent-connect, agent-models, agent-layout. Broken by hand, each red in TestNanobot: modelPreset not stashed (preset left over magpie's model), the made file not removed, and the window restored as a string. Not tried: a real vendor behind the gateway (fake upstream only), nanobot's long-running `nanobot gateway`/WebUI picking the change up live, and WSL. |
||
|
|
40d39e1176 |
provider: Codex's account is read every 30 minutes while Codex sits idle
dludream on Discord: with Codex signed in, magpie asked chatgpt.com every
five minutes, 288 times a day, used or not, and they worry about ban
risk. KeepOnAnAccountWithRoom read the account Codex is signed in to
(/wham/usage, through SwitchWhenSpent, CodexUsedUp and the app-left
restart) on every full look, every loginSwitchEvery.
Now a full look reads Codex's accounts only when codexDue says so:
- while no Codex session file was written in 30 minutes
(codexSessionsQuiet over CODEX_HOME/sessions) and the account isn't
near out, the next read is codexIdleLookEvery (30m) later;
- a session written again makes the next full look (5 minutes at most)
read it;
- near out or held, it is codexNearOutEvery (1m) as before;
- a sessions folder that can't be read counts as written, so the
cadence stays 5 minutes.
Claude's looks, the proxy sync and noteCodexGoneNow keep their cadence.
Requests magpie sends on the account keep its windows current from the
reply headers (NoteCodexLimits), so routing doesn't lean on the poll.
docs/reference.md says the new cadence.
Run at this tree (origin/main
|
||
|
|
62a9ab743f |
update: Stable's "Up to date" names the newest version out (ylspcm on X)
ylspcm (macOS) on X: Check for updates always says up to date, but the
installed version is behind, so they reinstall from the site each time.
On Settings' Stable channel the feed answers Stable's weekly version.
An app installed from the site is newer than that, so every check
answered "Up to date" while newer releases were out on Every version,
and the Version row never named the channel. `magpie update` already
said "up to date on the stable channel"; the app didn't.
Now, on Stable with nothing newer there, the check also asks the feed
on every version (update.LatestEvery, before u.mu is taken).
/api/update says channel "stable" and, when it is newer than this one,
newest. The Version row reads "Up to date on Stable · {v} is out on
Every version" with Switch to Every version, which saves the channel
and the existing channel-change path checks again. With nothing newer
it says "Up to date on Stable". On every version nothing changes, and
there is no second request. en, zh, zh-TW, ja, de. reference.md's
Update channel section says so. The row's code fits in the core
script budget with four of renderUpdate's comments cut, no raise
(1,533,753 of 1,533,802).
The cause is inferred, not confirmed: the tweet gives no channel or
version. The live feed has every version at 0.1.3476 and Stable at
0.1.3078. The rest of the check (semver compare, bundle, mirrors, the
worker's 5-minute cache) gave "Up to date" only for a feed answering a
version at or below the running one.
Run on mote at this change on
|
||
|
|
6fe754cb20 |
claude: Fable 5.2 on Vertex, Bedrock, Desktop's fable tier and Anthropic's fast mode
Anthropic launched Claude Fable 5.2 (claude-fable-5-2) on 11-09 (thelegendof2414 on X: not in magpie's list). Checked against Anthropic's "What's new in Fable 5.2" page, AWS's model card, models.dev and Claude Code 2.1.321's own bundle: - Claude subscription and Anthropic API: the list follows models.dev, which already has claude-fable-5-2 (8/40, cache read 0.2, write 10, 1M context, 128k out), so it shows once the catalog syncs (at most 24h). TestClaudeAccountListsFable52 holds that with the literal models.dev row: listed first, priced, 1M window, low to max efforts. - Vertex global and Bedrock presets list it (global.anthropic.claude-fable-5-2 is on AWS's card). - Claude Desktop's fable tier now behaves as claude-fable-5-2 (2.1.321's latest_per_family); Desktop's own catalog v4371 still ends at 5.1. - Fast mode on Anthropic's API key: Fable 5.2 has it ($16/$80; 2.1.321's fast-mode opt-in set is fable-5-2 and mythos-5-2). Fable 5.1 never had it and stays off. A Claude subscription account still gets no fast mode in magpie, as before. - Claude Code's effort: 2.1.321 reads the top-level effortLevel only for models up to Fable 5.1 and Mythos 5.1, so 5.2 goes in modelSettings, as Opus 5.5 does (claudeReadsTop unchanged, test added). - Gateway: adaptive-only thinking, no sampling, thinking off never sent, xhigh kept: the version rules already cover 5.2; tests now name it. Run at this tree (mote): gofmt -l clean; go vet ./... (darwin), GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... ok; go test -count=1 ./internal/agent ./internal/gateway ./internal/provider -run 'Fable|Claude|Fast|Vertex|Bedrock|Effort|Thinking|Xhigh|XHigh|Desktop|Sampling|Adaptive' ok (84s, 178s, 36s). Not run before the push: the full go test ./... (mote had six suites queued on suite.lock at load 420); it runs after, and a red is filed. Not tried: a real Fable 5.2 request through magpie; fast mode on a real API key. |
||
|
|
a6e4cf7635 |
settings: what routing does sits under Models › Routing, and the Routing page opens it
The scattered settings audit after netube99 on X. Ask again after a
refusal, the Retry-After cap and the intent classifier's timeout were
under Models › Replies beside rows about a reply's content, and Busy
models last sat in Network and sharing, far from the routing it changes.
The four are now one Routing section under Models, after Replies, and the
Routing page's header has a Settings › button that opens Settings at that
section with its first row lit. The docs (reference.md, the site's
plugins page in en, zh and ja) name the new place.
Run (mote, mote-run):
- settings-places, retry-after-cap-setting, refusal-retries-setting,
classify-timeout-setting, model-load, i18n-keys and bare-ids, both
engines: all pass.
- mobile-web against origin/main
|
||
|
|
88b541a25c |
images: every pointer names Settings › Models › Images, where the page is
The image models moved under Settings › Models, but the Library's Magpie
Image sheet, the MCP server's instructions to agents, the gateway's
"no image model" errors, the video tool's text and the docs still sent
users to "Settings › Images", a tab that no longer exists (the scattered
settings audit after netube99 on X). Every user-facing string now names
Settings › Models › Images in en, zh, zh-TW, ja and de, as do the site's
Qwen docs (en, zh, ja), llms-full.txt, the subsystem pages and comments.
Run in the tree with this change and the rest of the audit's fixes
(mote, base
|
||
|
|
5611e7274e |
plugin: a plugin's sign-in words show in the window's language when it gives them
mahiro233 on Discord (v0.1.3372, Kiro plugin 0.1.34): in a Chinese
window, the Kiro sheet's "Choose a sign-in method" and its choices read in
English, while the rest of the sheet is Chinese. magpie showed a plugin's
method labels, questions and choices only as the plugin wrote them, and no
plugin had a way to give them in another language.
A plugin may now give them by language, magpie's own fields beside
OpenCode's English, as a page gives its titles: a method's labels, a
question's messages, a select option's labels and hints, each
{"zh": "…", "zh-TW": "…", "ja": "…", "de": "…"}. host.js passes them on
(byLang: string values, codes of 1-16 characters, at most 16, empty ones
left out); plugin.Method and plugin.Prompt carry them; the app shows the
window's language, then its first part, else the English (inLang), on the
way picker, a question, its choices and their hints, a key's field and
the site step's other ways. `magpie plugin login` stays English. Kiro
0.1.35 gives its words in all four (plugins 588b3611).
Tests: TestPluginSignInWordsByLanguage (a plugin's words reach magpie as
given, bad ones left out, none for a plugin that gives none);
TestPluginOwnIconAndKeyHint compares a Method with reflect.DeepEqual now
that it holds a map. The GUI side is checked by plugin-ask-ways.test.cjs
in the next commit.
Run on mote at this tree: gofmt -l empty; go vet ./internal/plugin
./internal/provider ./internal/gui (darwin), linux -tags nogui, windows:
ok; go test -count=1 ./internal/plugin ./internal/provider ./internal/cli:
ok. Broken by hand: with origin/main's host.js the new test fails (no
labels, messages or hints reach magpie). Not tried: a real Kiro sign-in
(no keys or passwords entered anywhere); the full suite is queued on mote
under suite.lock after the push.
|
||
|
|
4314f4b776 |
otel: export the gateway key's name as magpie.gateway_key.name (#5751)
reyoung (#5751) shares one magpie through several gateway keys and wants requests in Langfuse or another collector told apart by key. The ledger row already had CallerKeyName, but the OTLP allow-list dropped it, and the observer's root and attempt records never carried it. Ported from reyoung's 9d82162aa (reyoung/magpie feat/otel-gateway-key-name), applied unchanged onto current main: - observeRequest takes access.Caller(r).KeyName when observing begins and puts it on every End and Attempt record (CallerKeyName), so the root span and every try (failures, retries, fallbacks) carry it with no lookup at export time. - otlp's allow-list grows by this one attribute, on generation and ledger spans (otelAttributes, so the duration and token histograms too) and on the root span. Omitted when the name is empty. The key's id and secret are never sent; provider account names stay out. - docs/reference.md, plugin-runtime.md and the en/zh/ja privacy pages say the name goes to the user's collector. Added on top: docs/reference.md says each key name multiplies a metric's series, and that keys sharing a name are counted together. Review of the fork (read every line; run only on mote): no new address, dependency or credential; the name is read from the auth context at request time, the same source appendUsage uses for the ledger row; reported rows (another computer's) already have the caller key cleared and never reach observers; session spans of local transcripts have no key. READMEs (en, zh) mention OTLP only as a feature, with no list of what is sent, so they are unchanged. Run on mote (lockf ~/suite.lock), at base |
||
|
|
3fc6ee4111 |
site: release files from Cloudflare R2, GitHub behind them
Updates and the installer downloaded every file from github.com, which answered 504 for every release file for hours on 2026-11-08. The site now keeps a copy on R2 (bucket magpie-releases, binding RELEASES): - A five-minute cron copies the newest release and the Stable one from github.com (or, when that fails, GitHub's API) into R2. R2's put takes a file only with the SHA-256 the release's SHA256SUMS gives. A run starts no copy after 4 minutes; the feeds' tags and the 4 newest besides are kept, older ones deleted. - /files/<tag>/<file> serves R2's copy, Range and conditional asks included; a file R2 doesn't hold, or a failing R2, is a 302 to github.com. - /api/latest (both channels) and /download name /files only for a file R2 holds under the release's hash, and give every file's github.com address as `github`, which the previous commit's clients fall back to. Older clients only mirror a github.com address, so a mirror never goes in front of the site's. - start (en, zh, ja), privacy (en, zh, ja) and reference.md say where files come from. Run (mote): node --test site/*.test.mjs 104/104, with files.test.mjs (R2 stood in for by r2stub.mjs) and new worker tests for the feed, /download, /files and the cron. wrangler deploy --dry-run binds RELEASES. Broken by hand: onR2 taking any held file regardless of hash, two tests red (the feed test and "bytes R2 holds under another hash"). Not tried yet: the real cron run and R2 serving (after deploy). |
||
|
|
c66cdbea97 |
update: a release file github.com won't serve comes through GitHub's API
On 2026-11-08 github.com answered 504 for every file of
yetone/magpie-releases (…/releases/download/<tag>/<file>) for hours, while
api.github.com/repos/yetone/magpie-releases/releases/assets/<id>, asked
with Accept: application/octet-stream, redirected to the same bytes.
Every self-update and the install script failed (kurutodenzeru, wjbdx,
isee1_1 on Discord). Retrying the same address (
|
||
|
|
b0926e81a2 |
import: a link can say where its key's balance is read (balance=, balance_path=, balance_method=)
A relay's "Add to magpie" link can now name the URL that tells a key its balance, where the amount sits in the reply, and GET or POST. magpie takes it only on the host of one of the link's own base URLs, over https, with no userinfo or fragment, so a link can't send the key anywhere its requests don't already go; anything else refuses the whole link. balance_path or balance_method without balance is an error. No header or token is taken from a link: an account-wide token is worth more than a key, and a URL stays in browser history. - provider.ParseImport: linkBalance checks and sets BalanceURL, BalancePath and BalanceMethod. - CLI: the import preview shows the balance URL and doesn't ask it before yes (showProviderAsking). - GUI: the import dialog shows method, URL and field (.imp-bal). - Docs: docs/import in en, zh and ja (table rows, a note on headers, the builder's three fields with the same host check, a security bullet); docs/reference.md's parameter table. Run on mote at this tree (rebased on |
||
|
|
7880a00ac6 |
models: a model of a key's provider can be asked on System One
axelburks on Discord: a relay serves its decision model under a name of its own (an Ark endpoint id). A key's provider with a System One URL beside a conversation URL can set a model's API to decide (System One in Model settings' API row, its chip's right-click, or `magpie model api <pid/model> decide`). The model is then a decision model there: asked on System One by its own name, offered to routing groups, kept out of the conversation models, and a turn for it is refused with 400 before the vendor is asked. Auto gives it back. A provider with no System One URL, with that URL alone, an account, a remote magpie and Vertex refuse it, saying why. Chat routing (apisAmong) ignores decide. Broken by hand: removing the decideSet check in DecidesModel turns TestModelSetToSystemOneIsADecisionModel and TestModelSetToSystemOneAskedThere red. Run, on this stack over origin/main |
||
|
|
7a6211d047 |
providers: a model's own headers, in Model settings
axelburks on Discord: a vendor routes one model by a header of its own. A key's provider (built-in or custom) can give each model headers (settings.ModelHeaders["pid/model"]). They go on that provider's requests for that model alone, after the provider's headers and after auth: a name both have is sent once, as the model's, so a user's value is never overridden by the provider's or magpie's key header. The gateway names the model (provider.WithModel) on every route that asks one: chat on each API, translated and streamed, count_tokens, System One's decision, embeddings, images, videos and the model test. A fallback provider serving the same model id gets its own headers only. Accounts and plugins carry their sign-in's headers and take none. The editor's "Name, price and reasoning level" panel is now "Model settings" (every language), with + Add header per model, staged and made with the Save; Restore default takes them away. The rows being typed are kept out of the draft's compare, so an untouched editor still closes without asking. Broken by hand: dropping WithModel from gateway.go turns TestModelHeadersReachTheirModelOnEveryRoute red; dropping the provider id check in modelOf turns TestModelHeadersStayWithTheirProvider red. Run, on this stack over origin/main |
||
|
|
d32a7a70cb |
remote magpie: once magpie updates, the Remote magpies it uses update too
nnlrl_75403 on Discord: a magpie used as another's Remote magpie stayed on
its old version after the local one updated, and had to be updated by
hand on the other computer. Now nothing needs setting up:
- provider.KeepRemotesUpdated (started by the app's updater and by
magpie serve) runs UpdateRemotes 30 s after start and hourly. A
released build with automatic updates on reads each Remote magpie's
version (GET /v1) and, when it is older, asks it through
POST /v1/magpie/update?version=<v> with the provider's key, at most
once in six hours per version. Off here, or a dev build: nothing asked.
- The remote updates as its own automatic update would: the app
downloads and restarts once idle (updater.updateAsked → download,
waitIdle); magpie serve puts the latest in where it runs from, one at
a time, never elevated, and serveFollow restarts into it. Automatic
updates or downloads off there: it answers "off" and stays.
- A copy that can't replace itself says why: a container (docker pull
ghcr.io/yetone/magpie:latest), a package manager's (its command), a
folder it can't write, a build from source. A magpie from before the
route answers 404 ("too old"), a read-only or held key is "refused".
The provider's row on the Providers page adds a short status to its
line ("updating to v…" for 30 min, or "can't update itself" etc.),
with the reason and the command in its tooltip. en/zh/zh-TW/ja/de.
- The route replaces the program, so it takes the Codex reset's
admission: another machine only while shared, never a browser page,
an enabled key with full access from loopback too (401 without one),
read-only 403 gateway_key_read_only, held 403 gateway_key_held. It is
in readOnlyRefused and the CORS route list.
App.js stays under TestCoreScriptBudget by cutting two comments; the
budget is not raised.
Run (on mote, at the tree committed here):
- gofmt -l internal/: clean. go vet of gateway, gui, cli, provider for
darwin, GOOS=linux and GOOS=windows: ok.
- go test -count=1 ./internal/gui ./internal/cli ./internal/provider
./internal/gateway: gui and cli ok but for #5644's two settings tests
(red on main since
|
||
|
|
3b541a7f36 |
routing: Smart ranks an account by its week once its month can't be used up before it renews (#5639)
Smart ranked a Volcengine Agent Plan (5 hours 2,000, week 7,000, month
20,000) by its month, the biggest window, so it always stood behind
accounts renewing weekly, and its month could reach a point where it
could no longer be used up before it renewed.
The rule keeps #1778's reasoning: a month holding less than its weeks add
up to is the real cap while the weeks can still carry it. Once what the
biggest window has left is more than the next window (a day or longer,
same unit, counts known) can let through between its own reset and the
biggest one's (Of x time between / Span), what the week leaves at its
reset is lost, and the week ranks the account.
- provider: Allowance.Unreached counts the biggest windows to pass over.
Renewal and Seat.Soon are unchanged for other strategies and plugins.
- routes: Seat.Unreached; Smart compares Soon past it.
- gateway: weighRouted fills it; the trace's Weighed carries `unreached`.
- GUI Routing: renewsBy skips those windows, and a new story line says the
shorter window decides. The Smart header and the group hint say so in
en, zh, zh-TW, ja and de.
- docs: reference.md (How magpie picks an account) and
subsystems/gateway-routing.md.
With the issue's numbers as reported (month 696 h away, 18,372 left),
four weeks carry 28,017, so the order is unchanged. Two weeks before the
month renews, 14,017 < 18,372, and the plan goes first, ahead of the
point where a week's leftover is lost.
Run on mote at this tree (base 2dac9b84e; origin/main
|
||
|
|
c7810ea5cc |
gateway: /v1/decisions asks a System One decision model, and /v1/systemone a Decisions-only one (wudi_boy)
wudi_boy on Discord: a Decisions request (Python-urllib) to the Qwen
decision model, decision-model-preview, was refused, while the same
model answered on /v1/systemone. canDecide sent Decisions only to an
OpenAI key, Azure or another magpie, and nothing translated between the
two APIs.
Now a Decisions request whose model answers System One (Qwen's, Ark's,
a Jev, a Clef, a plugin's, or a decision group whose members do, none
of them a provider that serves Decisions itself) is asked there
(decisions_systemone.go): predicate -> noul, choice -> criteria map
(boolean values as "true"/"false", typed back on the answer), score ->
criteria list "label: description" least first, an unnamed question ->
question_N answered with a null name, input -> state (a string as it
is, items as {"messages":[{role, content, refusal}]}, input_json as its
JSON text). The answer comes back in the Decisions shape in the
questions' order, a missing answer as refusal, with input and output
tokens. prompt_cache_key/options and safety_identifier change no answer
and are left out. Everything with no counterpart is a 400 naming it,
before the vendor is asked: an image unless every target is a Clef or
another magpie, an http image, function/custom tool calls and outputs,
an image or refusal in a question, any other field or question type.
The reverse: /v1/systemone whose model no System One provider has but
the Decisions API serves (openai/gpt-6-luna) goes through
serveRetrieval as /v1/decisions does, and is answered as System One.
A vendor's error passes through as it was said.
Tests, against fakes with the real shapes (Ark's 2026-11-01 System One
answer, Cloudflare's result envelope, openai-python's Decision):
TestDecisionsAskSystemOne, TestDecisionsMessagesAsSystemOneState,
TestDecisionsUntranslatableRefused, TestDecisionsImagesToClef,
TestSystemOneAsksDecisions.
Run on mote (mote-run) at this change on
|
||
|
|
21a89fa4e8 |
liveagent: a model or provider of magpie's deleted in LiveAgent stays out
zero2sin on Discord: every LiveAgent restart brought back magpie's three providers as magpie wrote them (one Anthropic model, two OpenAI providers of twenty or thirty models each) over what they had edited in LiveAgent. LiveAgent's developer pointed at magpie, rightly: SyncCatalog runs at magpie's start and on every catalog change, and LiveAgent's Sync wrote every model of magpie's into magpie, magpie-responses and magpie-anthropic each time. A model the user deleted, or a whole provider of magpie's, came back on the next sync, and LiveAgent read it at its next start. TestLiveAgentProvider even asserted that a model missing from the file is put back. magpie now remembers, per config.json, which of its models and providers LiveAgent has had (liveAgentKept, in the stash). One gone from the file since is the user's: it stays out until they put it back in LiveAgent, or turn magpie off and on for LiveAgent. A model new to magpie's list is still added, once. A provider of magpie's whose models the user all deleted is left as they have it. The user's own providers were never touched and still aren't. LiveAgent's backend writes back what it holds on any settings change, so a model magpie adds while LiveAgent runs is dropped by its next save without the user doing anything. Such a model is held as pending under the LiveAgent/k-brain pids then (liveAgentPIDs, pgrep): missing under the same pids, or after LiveAgent quit, it is written again; once other pids run (LiveAgent restarted and read it), it counts as had. Windows can't be asked what runs, so there each counts as had at once. Run (wsl-run, magpie-desktop; mote's disk is full, 553MB free): gofmt, go vet ./internal/agent for linux, windows and darwin, go test ./internal/agent: every test passes but TestGrokInstalled, red on WSL2 at main too (#3548, Windows binfmt interop takes the fake grok). On mote before its disk filled: go test -run TestLiveAgent -v ./internal/agent, all 10 pass. New tests: TestLiveAgentKeepsWhatTheUserTookOut (the reporter's case: magpie-anthropic and a Chat model deleted, a provider of their own added; two syncs leave the file byte for byte; a new magpie model is added once; a model put back stays; off then on gives everything back), TestLiveAgentAddedWhileRunning, TestLiveAgentAddedThenQuit. TestLiveAgentProvider now expects a deleted model to stay out and a model new to magpie to be added on and last. Broken by hand: take() returning want unchanged (the old behaviour) turns TestLiveAgentProvider, TestLiveAgentKeepsWhatTheUserTookOut and TestLiveAgentAddedWhileRunning red ("sync 0 undid the user's edits"); wrote() marking every added model as had turns TestLiveAgentAddedWhileRunning and TestLiveAgentAddedThenQuit red. Not tried: a real LiveAgent; the reporter's own config.json; a LiveAgent that saves over a pending model and is restarted before any sync (reads as the user deleting it, documented); baseUrl/apiKey/type edits on magpie's providers are still magpie's and are written back. Reported-by: zero2sin |
||
|
|
abe7b00631 |
gateway: a key+URL provider is sent the agent's own User-Agent by default, through a remote magpie too
nb5p runs a gateway of their own behind magpie and saw nearly every request arrive as "magpie/<version>". The agent's User-Agent now goes on as the agent sent it, wherever magpie isn't itself the client. What each path sends now: - Key+URL providers (official vendor keys and custom OpenAI/Anthropic compatible ones), on chat, Anthropic, Responses, Gemini, count_tokens, embeddings, images and videos: the agent's User-Agent, as sent. Before, this was the opt-in passUserAgent (#1851) and the default was magpie's. The opt-out is magpieUserAgent: `magpie provider set <id> user-agent=magpie`, or untick "Send the agent's own User-Agent" in the editor. passUserAgent is no longer a field, so a file that set it true reads the same as the new default. A provider someone turned back off after opting in can't be told apart from one never touched, and now sends the agent's too. - When the agent sent no User-Agent, and on magpie's own requests (classifier magpie-router/1, vision, search, the image tool, model lists): magpie's, unchanged. - A header.User-Agent the user set: still wins over both. - Subscription accounts (Claude, Codex, Copilot, Google, ZCode…), plugins, and OpenCode/Cline/Kilo: unchanged. Their signing sets the official client's UA (provider.PassesUserAgent still refuses an Account or OwnClient). - Claude Code and Codex header copies: unchanged. - Remote magpie: the near magpie still asks as magpie/<v>, because the far end trusts X-Magpie-Agent/Via only from that. It now adds X-Magpie-User-Agent (passOnUA, on forwardOnce, embeddings, draw and video; the classifier's decision request names none). The far end takes it only from a magpie/ request (callerFrom) and strips it on arrival (withCaller). agentUA/callerUA then hand it to userAgentFor, so the far vendor sees the agent's. A client that writes the header itself, straight to a magpie, is ignored. magpie's own UAs are never relayed (magpiesOwn). Vendor check: invalid-key requests with magpie/, claude-cli, a Chrome UA and pi's went to Anthropic, OpenAI, Gemini, DeepSeek, Moonshot, Kimi For Coding, Zhipu, OpenRouter, xAI, DashScope, MiniMax, Volcengine Ark, Groq and Mistral. Every vendor gave the same auth error for every UA, so no edge-level UA gating was seen. Kimi For Coding's agent allow-list sits behind a valid key, which wasn't tried. Run (mote): - go test -run 'UserAgent|RemoteMagpie|ZCode|Blocked' ./internal/gateway: ok - go test ./internal/provider ./internal/cli ./internal/gui: ok - node --test provider-user-agent, provider-native-compaction and i18n-keys (chromium and webkit; en/zh/zh-TW/ja/de; 900 and 440 wide): 123 of 124 pass. The red is i18n-keys "a plugin's words are its own" (plugins' words said in files this change doesn't touch), already filed as #5327/#5332, #5426 and #5482. - gofmt -l clean; go vet; GOOS=linux -tags nogui and GOOS=windows vet: ok at the rebased head (on |
||
|
|
191f3c0af1 |
gateway: POST /v1/decisions goes to OpenAI, Azure OpenAI or another magpie
A Discord user's POST /v1/decisions was answered 404 ("magpie serves
/v1/chat/completions, ..."). It is OpenAI's Decisions API (gpt-6-luna):
one input, up to 400 questions, typed answers, input tokens billed only.
The shape was taken from openai-python (resources/decisions.py,
types/decision_create_params.py, types/decision.py, added in #4033 on
10-06) and the Decisions guide, not guessed: POST /v1/decisions, a JSON
body of model, input (a string or messages/items with input_text,
input_image as a data or http(s) URL, JSON parts; function and custom
tool calls and their outputs), questions (predicate / choice / score),
and optional prompt_cache_key, prompt_cache_options, safety_identifier.
The answer is {answers, model, usage}, not streamed; usage.input_tokens
includes input_tokens_details.cached_tokens and cache_write_tokens. The
Azure client sends it on the v1 API (/openai/v1/decisions), the model in
the body.
- decide (decisions.go) goes through serveRetrieval as embeddings and
rerank do, body as sent with only model changed. So a disabled model,
a key's models, accounts and spent limits, pause rules, keys/accounts
of the provider, masking and the Routing page hold here as on every
route.
- Only a provider canDecide takes is sent it: an OpenAI API key on
api.openai.com, Azure OpenAI (IsAzure, at its OpenAIBase, so
/openai/v1/decisions with api-key), or another magpie. Anyone else (a
relay, a plugin, a ChatGPT sign-in) gets a 400 that says who serves
it, checked in serveRetrieval's try loop beside the no-OpenAI-API
check (refusingRetrieval), never the vendor's 404; a group moves on.
- A bare gpt-6-luna is a kind group "decision" (servesDecision), so a
relay that lists the same id is never its member.
- Usage is recorded as "decisions" (countedRetrieval): input less the
cached and cache-written tokens, those as CacheRead/CacheWrite, and
no output, so gpt-6-luna's own models.dev rates price it as OpenAI
bills ($0.10/1M input, cache read/write at their rates).
- /decisions joins the one-port client prefixes, another magpie's URL
suffixes, the 404's route list and info's apis. The readonly, LAN
and CORS guard tests list the route.
- native_endpoints is left alone: it names the chat APIs a model is
relayed on (Cursor's names, a remote's API choice).
- docs: gateway-routing.md has a Decisions row; reference.md a section.
Run on mote at this tree (mote-run): gofmt -l clean; go vet of gateway
and provider; GOOS=linux go vet -tags nogui ./...; GOOS=windows go vet
./...; go build ./..., linux nogui and windows builds ok;
go test -count=1 -timeout 45m ./internal/gateway ./internal/provider
./internal/usage: ok (gateway 413s, provider 88s, usage 18s).
Red on the old code (
|
||
|
|
32fc5809e1 |
agents: OpenMausBot gets magpie as an engine of its own, written as its own Claude endpoints are (a user on X)
A user on X asked for OpenMausBot (github.com/milind-soni/OpenMausBot,
read at 516ca75; released 0.1.145). Its bots run on engines from
`instances` in ~/.openmausbot/config.json ($OMB_DATA_DIR,
server/config.ts:713). Without this, a Claude bot reached magpie only
through ~/.claude/settings.json, and its picker listed Claude's static
models alone: OpenMausBot doesn't read the model from env
(readClaudeModelCatalog, claude.ts:296-316).
- openmausbot.go writes `instances.magpie` in the shape of OpenMausBot's
own "Claude endpoint" (newClaudeEndpoint, claude-endpoints.ts:91-139):
- driver claudeAgent, access custom
- config.configDir is <data>/providers/magpie. Given that,
OpenMausBot starts Claude Code with that CLAUDE_CONFIG_DIR and
strips account keys the engine doesn't set (claudeEnvironment,
claude.ts:111-136, 158-179), so the engine owns its routing.
- requireApiKey
- ANTHROPIC_BASE_URL, AUTH_TOKEN, API_KEY and MODEL point at the
gateway
- endpointModels holds magpie's models, kept to the ids
CLAUDE_MODEL_ID accepts. One bad id makes OpenMausBot refuse the
whole engine (claude.ts:636).
- A non-empty `instances` is the whole fleet (config.ts:1173). With
none saved, magpie writes DEFAULT_FLEET (instance-fleets.ts) beside
magpie, stashed as openmausbot.fleet. Off takes the fleet out again
if the user hasn't changed it.
- What stays the user's: the engine's name, a model they picked from
the list, their other env and an inherited `cli`.
- Check reports the base URL drifting away from the gateway.
- OpenMausBot reads config.json once at start (index.ts:780), and an
engine edited in it writes back the fleet it holds
(routes/instances.ts:132, config.ts:997-1012). So Set is refused
while it runs (errOMBRunning), and the notice asks to quit it first,
since Windows can't tell.
- ListOnly, ListsModels, OMB_DATA_DIR in agentenv. The icon is
OpenMausBot's build/icon.svg (Apache-2.0).
- i18n in zh, zh-TW, ja and de. Docs: reference, agent-wiring, both
READMEs.
- Codex bots use ~/.codex (codex.ts:373-386), which the Codex wiring
already covers.
- The agent package's TestMain holds ombRunning false. An OpenMausBot
open on the test machine refused every test that turns magpie on for
each agent: my own sandbox OpenMausBot on mote turned
TestSyncKeepsAnAddressOnAnotherMachine, TestListOnlyAgentsReadConnected
and TestReverseProxyIsStillMagpie red. With a process named
openmausbot running, they now pass. LiveAgent's, OpenPencil's and
NewMax's running checks have the same hole and are left to #5587.
Run (all on mote):
- gofmt -l: clean
- go vet ./... on darwin, GOOS=linux -tags nogui and GOOS=windows: ok
- go build for the same three targets: ok
- go test -tags nogui ./... -timeout 45m at e1453a168 (this change on
origin/main
|
||
|
|
6ac1e04244 |
provider: a Claude model on Copilot has its 1-hour cache write priced as Copilot bills it, at the 5-minute write (#3435)
Copilot bills a cache write at one price however long it is kept. Its copilot_usage counts a 1-hour write as the cache_write a 5-minute one is, and GitHub's "Models and pricing for GitHub Copilot" (docs.github.com/en/copilot/reference/copilot-billing/models-and-pricing) lists one "Cache write" price per Claude model, no 1-hour tier (Opus 5.5: input $4, cached input $0.20, cache write $5, output $20). magpie gave every Claude model's list price Anthropic's 1-hour write, 2x input (catalog.OneHourFor), so copilot/claude-opus-5.5 was priced at $8 per million for an hour's write where Copilot bills $5: on the reporter's request, $0.125456 against Copilot's own $0.078443. A Copilot price (tariffOf, cacheWritesAlike) now has no 1-hour write of its own, so an hour's write is billed as a 5-minute one (catalog.Price.OneHour), its tiers alike, copied as they may be the catalog's. This holds for a call read after Copilot was signed out too (tariffOf's unknown-provider path, MakerPrice), which the reporter's patch left at 2x. A price the user gave for a Copilot model keeps the 1-hour write they gave, and one they left out isn't filled with 2x input (userPrice, so UserBasePriceIn reads it alike). Every other provider is as before: Anthropic, Bedrock, Vertex and relays bill the hour at 2x, so the rule is scoped to Copilot's id, not taken off every non-Anthropic provider. Usage rows are priced as they are read (Record.CostAt), so calls already recorded read at the new price too. docs/reference.md and ModelPrice's comment say so. Run on mote (go1.26.8, macOS) at |
||
|
|
d55881730d |
gateway: a key can be held to some MCP servers and tools
wakaka on Discord (#help, 11-06) asked for gateway keys limited to some MCP servers and tools, as keys already are to models (#882). A key's MCP list (caller-keys.json "mcp") holds entries "server" (every tool of it) or "server/tool"; "-" alone is no MCP server; an empty list is every server, as before. A key issued under another is held to its issuer's list too. Every MCP route checks it: - magpie's own servers (web search, vision, image, Magpie Browser, plugin tools) through serveMCP: initialize/tools/list/tools/call are refused or filtered per server and tool, and /v1/magpie/key-limits names "mcp"; - the Library hub ("magpie"): only the backing servers and tools the key may use are listed, and a call by name or by fallback is refused; - /mcp/<name> and /mcp/run/<name>: the server is refused, tools/list is filtered in JSON and SSE replies, tools/call refused; a reply the filter can't read (an encoded body) is a 502, never passed through. GUI: "MCP servers" in the key row's menu opens the app's own picker (no native select) with All, No MCP server, each server and its tools (GET /api/caller-keys/mcp lists magpie's own servers and the Library's). A key held to some shows a badge saying which, that opens the same list; a free key shows nothing more in its row, on hover either. A hover badge was tried first: it pushed the row past 560px (gateway-caller-keys) and squeezed the masked key under a drag at 420px (gateway-key-arrange). CLI: magpie gateway-key mcp <id> github fs/read_file | none | all. zh, zh-TW, ja, de strings; docs/reference.md and the gateway-routing and library subsystem pages. Not covered: a model's own built-in web search (a vendor tool, not MCP). GET /api/caller-keys/mcp is named in the CLI parity test's notYet (its list is what `magpie gateway-key mcp` takes; TestEveryRouteHasACommandOrIsNamed caught it at the rebased head). Run on mote (mote-run), at the pushed head: - go test ./internal/access ./internal/cli ./internal/gui ./internal/library ./internal/gateway at a9c40186d (this change on |
||
|
|
80ae904c23 |
routing: routing groups get a page of their own, beside Routing
The owner asked for the groups to leave the Routing page (11-06): under the live stage and every request they were a long scroll down, and New group with them. The design was reviewed before this was built. - New page, Routing groups (#view-groups), drawn by the routing plugin's same script (routingPage), so the editor, its dirty/discard and every group action are unchanged. Toolbar: filter, "N groups · M on", Templates, Import, Select, and New group as the filled button. The list is right under it, and a Settings section under the list holds Found groups (with Exclude providers…) and Names in agents' lists. - No Export button: each group already has its own Copy to share. - Routing keeps the live stage and the requests. A request's group opens the groups page at its row. - The sidebar has a Routing groups tab right after Routing (from 1024 points). The header's row has no room for one: at 860px the extra tab pushed the logo out (brand.test). There the tab is hidden, Routing's tab is lit for both pages (markNav), and Routing's head has a "Routing groups ›" button, hidden beside the sidebar. - Every way in now goes to the groups page: the guide's Open routing groups, the panel's and the provider editor's Make a routing group (window/main?view=groups&newgroup=…). mainView still takes view=routing&newgroup from an older panel. - Words: "Routing groups", "Open routing groups", "Once saved, make a group of them in Routing groups.", and the editor's names note now says the setting is under the list, in zh, zh-TW, ja and de. "Open Routing" stays for the Agents page's button. - Docs: providers-accounts, gateway-routing, plugin-runtime, gui-shell and reference say "Routing groups page" where they mean the groups. - Core budget: the core's scripts are 1,533,774 of 1,533,802, paid for by three show()/setGatewayMode comments cut in app.js. No raise. Tests: routing-groups-page.test.cjs (new) covers the page in Chromium and WebKit, en/zh/zh-TW/ja/de, at 1280, 640 (window) and 420 (web): no groups on Routing, the tab or the head's button by width, the lit tab, toolbar order, New group primary and in sight, list then Settings, no sideways scroll, no native select, no left-border accent; a request's group to its row; quotas redrawn with an open editor left alone. The trace tests (routing-compact, -pause-folder, -rule-models, -folder) open Routing, then show the groups; routing-editor-foot and name-suffix-where-named scroll by wheel, as the scroll guard lets a reader; builtins expects the groups tab beside the sidebar only. Removed: routing-groups-jump (the head's "Routing groups ↓" that scrolled down to them, gone with them), routing-pointer-pin and routing-steady (the groups kept in place under requests streaming in above them: no request is above them now). Their guarantee that what redraws leaves an open editor and its typing alone is routing-groups-page's quotas case; Routing's own lists keep their keepInView. The groups page's jump: a request's group, or a pool's "Several keys" chip, opened the groups page and scrolled the row to the centre, and the next frame show()'s backAfterLoad put the page back where the reader last left it, then brought the focused segment in by "nearest": in WebKit the pool sat half under the window's foot (routing-mode-goes, 9 of its 10 WebKit cases). goRouting now jumps at once on a page it opens and marks it arrived(). The wheel in routing-many-keys turns over the keys: at the page's foot, now shorter, the mouse rested over the requests list (.rt-reqs, overscroll-behavior: contain), which took every wheel up, and the test stopped with 2 keys in sight. That is #4082's cause. routing-days-fit's fixture has 12 requests, a day that fills the window, since the day bar held needs room under it. Run on mote (macOS 27, load 25 to 65), Playwright 1.62.0: - Go: go vet, gofmt -l and go test ./... at the rebased head ( |
||
|
|
e1eeeed734 |
browser: the extension's key connects Magpie Browser and nothing else; own needs this computer; a key turned off closes its browser
|
||
|
|
650bf84128 |
docker: a daily tag that moves once a day, for Renovate
magpie releases many times a day, and YaoFur on X runs the image with
Renovate, which opened a PR on every tag ("改成每天凌晨更新一次").
Releases stay as fast as they are. ghcr.io/yetone/magpie:daily is new:
.github/workflows/docker-daily.yml points it at :latest's image once a
day, at 20:00 UTC (04:00 in China), by digest, as docker-stable.yml does
for :stable. It never builds, and touches no other tag; a click on Run
workflow moves it too. A Renovate user follows daily with its digest
pinned and gets at most one PR a day; stable is still there for one a
week.
The docs name it: the Tags row and the Updates line of the Docker page in
en, zh and ja, and the Docker section of docs/reference.md.
site/docker-tags.test.mjs holds that the three languages name the same
floating tags with daily among them, that a workflow writes each tag the
docs name, and that daily has one daily schedule, copies latest and
builds nothing.
The desktop app is unchanged: it already checks every 6 hours by
default, and Settings > About offers Check every 24 h and the Stable
channel (one a week).
Run (mote): node --test site/*.test.mjs, 90 of 90 ok; without the
workflow and the docs, two of docker-tags' three tests are red.
actionlint on docker-daily.yml and docker-stable.yml: clean. No Go file
changed; go test ./... -timeout 45m runs on the Linux box (wsl-run) at
this tree, since mote had another session's full suite running.
Not tried: the workflow itself before this push; it is run once with
workflow_dispatch right after it.
|
||
|
|
1f439ecc5e |
gateway keys: a limit can count only some models or providers (zola_xynb)
zola_xynb on X asked for a cap per model or per provider under one gateway key. A key limit can now name models (access.Limit.Models, "<provider>/<model>" or "<provider>/*"), so one key can have, for example, a month of $20 on openai/* next to a month for the whole key. Limits without models still cover the whole key, as before. - budget: sums are kept per window and scope, and count a ledger row only when its provider/model matches (any of the model's ids). reserve holds a request to a scoped limit only when the model it names is served there. windowsOf keeps every scope's sums, so the ledger is not read again on each request. - gateway: keyLimited puts the key's spent scopes on the caller (withSpent), count_tokens included. A direct request for a spent model gets a 429 with Retry-After and no X-Magpie-Limit-Reset, so a remote magpie rests only that model. A routing group, a provider's fallback and embedding/image/video/decision groups skip spent members (groupKeeps, allowedCandidates) and get a 429 only when none is left. System One, count_tokens and magpie's own calls for the key are held too. Model lists are unchanged. A refusal turned away before routing now records its ErrType in the ledger. - CLI: magpie gateway-key limit <id> add month --cost 20 --model openai/* (--model repeatable, --models a,b). - GUI: the key limit editor has a Models field that opens the app menu (multi-pick: All models, every model of a provider, each model). It has no <select> and no new screen. The badge, line and tabs name the models. Strings are in every language. - docs: reference.md and subsystems/gateway-routing.md. Run at d52725d32 (this change on |
||
|
|
483b131ef0 |
browser: magpie in Docker uses the host's own browser, through a key the page hands out
noahhrreion ran magpie in a container and its Magpie Browser never
connected. The host's Chrome dials ws://127.0.0.1:3425/v1/magpie/browser/
extension, which reaches the container from the bridge (172.17.0.1). That
is not loopback, so the gateway refused it (403). The browser MCP also
refused every caller from elsewhere, and the hub marked the browser
HereOnly. The extension's folder under the container's HOME can't be
loaded by the host's browser either.
Nothing is opened to the network without a key:
- The extension takes a gateway key: its popup has a Gateway key field,
and config.js carries KEY (extension 0.1.7). From another computer the
extension connects only with ?key= of a gateway key that is on, and
only from the extension's own Origin (checked first). Loopback is
unchanged, and a page's origin, null, a keyless call or a rebound Host
are all still refused (TestBrowserExtensionOnlyFromItsOrigin).
- A browser that connects with a key belongs to that key. Sessions are
tagged key:<id>/... (browserOwner, keyedSession), and a remote caller's
session is forced to its own key's whatever it names. The relay filters
every lookup (forSession, all, choose) through browserConn.serves. The
browser MCP admits a remote caller only with a gateway key; a web page
is refused as before.
- The key the page makes is recorded as this magpie's own browser's: its
id goes in settings.Dir()/browser-key, written temp-and-rename. This
goes by where the key came from, not by its name. A browser connecting
with it serves this computer's sessions too, so agents inside the
container use it as they would one on loopback. A record that can't be
read names no key, so no keyed browser is this computer's.
- Router: magpie mcp browser is HubServer.Keyed. A visitor from
elsewhere gets it only with a key (HubVisitor.Key), and hubCall names
its session key:<id>/..., so it reaches only that key's browser.
- GUI: a page whose browser can't reach magpie's folders (InContainer, or
a page from another computer) is "away". The Magpie Browser sheet's
button then reads Download the extension. It does a POST to
/api/library/browser/extension with the page's origin, which answers a
zip pointed at that origin (3430 passes the gateway's routes on) and
holding the recorded key's secret. The key is made the first time and
reused while it is on. The steps (unzip, chrome://extensions, Developer
mode, Load unpacked) are shown in every language. It is a POST so that
a link from another site can't mint a key.
- Docs: reference.md (Docker), subsystems/library.md and mcp-router.md,
and site docker.html in en, zh and ja.
Run, at this tree rebased on origin/main
|
||
|
|
fe61503e60 |
provider: a Remote magpie whose computer took another address is found on the network
luckymanjc (Discord) uses computer A's magpie from computer B over the
LAN. A's router hands it a new DHCP address after a boot, and B's Remote
magpie, saved at the old one, reached nothing until the address was
typed in again.
When B can't connect to a Remote magpie at all (a dial error, not an
answer), the list fetch (models.go) and the gateway's request (forward
in gateway.go) now call provider.SeekMoved (remote_moved.go). It dials
every address of the old one's /24 and of up to four of B's own private
/24s at A's port (500ms each, 128 at once). The first that lists
/v1/models 200 for the provider's key, and whose list this magpie didn't
make (magpie_via), is A: a LAN caller always needs a gateway key, so
another magpie answers 401. That address is saved as the provider's and
the request is made again there. A name or a public address is never
looked around, an address the user changed meanwhile stands, and a
provider is looked for once a minute at most, callers at once sharing
one look.
Run:
- mote-run go test -count=1 -run 'TestRemoteMagpie|TestLANNeighbours|TestDialable|TestRemoteSelf' ./internal/provider ./internal/gateway: ok
- mote-run go vet, GOOS=windows and GOOS=linux go vet of both packages: ok; gofmt -l clean
- Live: A was a real magpie on mote (10.0.0.121:3511), B a -tags nogui
build in WSL magpie-desktop (127.0.0.1:3522), sandbox HOMEs. B's
provider was saved at the dead 10.0.0.250:3511. B's start fetch found
A ("found at 10.0.0.121:3511, saved there") and a chat answered 200 in
4.2s. Then, with B running, the address was set dead again: a request
to office/group/rot found A and answered 200 in 4.4s, saved at .121.
Broken by hand, each red: the gateway hook off (502), the fetch hook off
(fetch error), the self check off (saved at this magpie itself).
Not tried: a real Windows A; a mDNS name (.local) that changed address
(left to the name); A on a different /24 than B. On Linux a dial to a
dead LAN address took ~54s (no route to host) before the look starts;
not changed here.
Reported-by: luckymanjc. (Discord)
|
||
|
|
f285426ac2 |
library: the MCP router turns on with no agent, and in gateway mode
treeman_26897 on Discord runs magpie as an MCP entry point for remote clients on a server with no agents. The router could only be turned on from the Library, and the Library said "No agents to write to" with no agent. In gateway mode (magpie web on a headless server, on by itself with no agents) GATEWAY_HIDES left the Library out altogether. The router's switch also showed only once a server was in the library. The gateway and `magpie library mcp router on` had no agent gate: the gate was the page's alone. Now, with no agent to write to, or in gateway mode (where no agent is shown), the Library is its MCP tab alone (`agentless` in client.js): - servers without agent chips, found servers or projects; - the router's switch, there before the first server too; - its lines and status say any app connects at its address, the router is on or off; - the servers it serves are checked once it is on; - Connect… has Other apps alone, with the gateway key line. Gateway mode hides only Agents now. The two keys of the empty state are gone; the gateway-mode subtitle no longer says "no Library". Remote use goes through the guard /v1 has, unchanged: lanGuard and serveMCP. TestHubMCPRemoteEntryNeedsKey holds /mcp/magpie/hub to it from another computer: not shared 403; shared with no key 401 (no Origin, tools/list, a wrong key); Origin null, chrome-extension://, file://, moz-extension://, a foreign site and another computer's page refused from there and from here; a rebound Host with a browser's marks (Origin = Host, Sec-Fetch only, a Mozilla UA) refused from here and there; a proxy or tunnel here (X-Forwarded-For, Cf-Connecting-IP) with no key refused; nothing ran for any of them; with the key it runs, through the proxy too. Run on mote at ef20ff690 (on origin/main |
||
|
|
c42522e241 |
quotas: the gateway's whole-page refresh reads saved Claude accounts again too (#5443)
POST /v1/magpie/quotas/refresh with no card named ran ReadAllCards, which only cleared the caches (AskUsage). A saved, inactive Claude account's /usage was never run again, so another magpie's refresh of this one, or an app with a gateway key, kept showing its old numbers. #5380 ( |
||
|
|
e17c6976b2 |
provider: Voyage AI preset, its embedding and rerank models (heatonz on Discord)
heatonz on Discord asked for Voyage AI, its embeddings and rerank. The gateway already had /v1/embeddings and /v1/rerank; what was missing was a way to add Voyage and have its models found there. - presets.go: `voyage`, a vendor with an API key at https://api.voyageai.com/v1 (docs.voyageai.com, keys at dashboard.voyageai.com). Voyage has no /models, so it is NoList and the preset names its models in two new PresetDef fields, Embeddings (voyage-4-large, -4, -4-lite, code-4, finance-2, law-2, 3-large, 3.5, 3.5-lite, code-3, code-2) and Rerankers (rerank-3, -3-lite, 2.5, 2.5-lite), as Voyage's docs list them on 11-06. Region gets Rerankers too. - models.go: planMedia marks each plan model with what it serves (catalog.Model.Serves), falls back to the preset's own lists when the provider has no region, and PlanRerankers / PlanRetrieval(kind) sit beside PlanEmbeddings. A NoList provider's ListAll has them too, marked, so catalog.Chat keeps them out of agents' lists, keys and Routing's chat pickers. - gateway: resolveRetrievalModel and servesKind look up the kind asked for (PlanRetrieval(kind)) and not only embeddings. Before this, a plan's embedding model named on /v1/rerank was sent there, and a plan's reranker was never found. - catalog.ServesOf: `voyage-*` is an embedding model (its ids have no "embed"), so Test, detection and a relay serving voyage ids know it. - test.go / gui providers.go: the retrieval-only Test fallback and the editor's "retrieval" count read PlanRetrieval as well. - docs/reference.md: a new "Embeddings and rerank" section with both routes' bodies (OpenAI's for embeddings; the Cohere/Jina/Voyage shape for rerank, top_n or top_k) and the Voyage preset. READMEs and the import docs pages (en, ja, zh) list it. Not served: Voyage's contextualized and multimodal embeddings (their own endpoints). A Voyage 4xx comes back as its raw {"detail": ...} body with its status (errorSaid has no "detail" reader). Tests (no network; a fake built from Voyage's documented request and reply shapes): TestVoyageEmbeddingsAndRerank (bare and provider ids, input_type/output_dimension and top_k/return_documents passed on, usage total_tokens recorded), TestVoyageModelsStayOnTheirRoutes, TestVoyageRefusalSaysWhy, TestVoyagePreset, TestVoyageTestAsksItsRetrievalAPIs, TestServesOf's voyage cases. Run on mote: go test -count=1 -timeout 45m ./internal/provider ./internal/catalog ./internal/gui ./internal/gateway. provider, catalog and gateway ok. gui has one red, TestMainWindowCorners/macOS_26_SDK, which is #3949 (red on macOS 27); this change doesn't touch AppKit. go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./... ok. gofmt -l clean. Broken by hand: - resolveRetrievalModel/servesKind back on PlanEmbeddings: TestVoyageEmbeddingsAndRerank red (rerank-3: 404 "magpie knows no model"), TestVoyageModelsStayOnTheirRoutes red (voyage-4 on /v1/rerank answered 200). - the voyage- prefix out of ServesOf: TestServesOf and TestVoyagePreset red. Not tried: against the real API. No Voyage key was available, so the endpoints, auth and shapes come from Voyage's docs alone. Not tried in the GUI's Add sheet by hand, and not on Windows or Linux beyond vet. |
||
|
|
baf70992f6 |
usage: a call the vendor answered with another model is priced as the model that served it (#5340)
The ledger priced a call at the model asked for and fell back to the
model the reply named (Served) only when the asked-for one had no price
(#1498). That order is right for a relay that sells kimi-k3 as
moonshot-kimi-k3 and bills by the name it sold, but it also priced a
real substitution: claude-opus-5-5 asked, claude-opus-5 served. The
vendor bills for the model that ran. kaimo455's ledger had 836 such
rows, every one at the asked-for rate: $374.06 reported against
$493.28 at the served model's rate. gateway-key cost limits (KeySpent,
NewCoster) and budgets read the same pricer.
Pricer now prices a call the ledger marks swapped at the served model's
price. That covers a price the user set for the served model and every
other layer of BasePriceIn. A price the user set for the model asked for
still wins, 0 included (new provider.UserBasePriceIn is BasePriceIn's
user layer alone). When the served model has no price, the asked-for
one's stands. Renames, vendor aliases, serving names and region
deployments price as before, and rate windows still read each record's
own time. apiPricer, the API price behind a subscription window's whole,
follows the same rule: the served model's API price first, then the
asked-for one's.
Review changes on top of ggbdpq's patch:
- The swap is judged the way the ledger's Swapped column judges it: on
the model id and on the name that went out (SentNameIn over the
user's ModelWires). A model the user sends under the served one's name
was answered as asked, so it keeps its own price. The patch judged the
model id alone, so such a row was priced as swapped while the Requests
page said it wasn't. The pricers' memo keys now include the effort,
because the sent name depends on it.
- apiPricer (window holds) got the same rule. The patch left it on the
old order.
Tests:
- TestLedgerPricesASwappedCallAsTheModelThatServed (patch, plus a
ModelWires case) checks the ledger and the Requests page.
- TestLedgerPricesARenamedModelAsTheOneServed: the sol row (sol asked,
kimi-k3 served, both priced) is a genuine swap, so it now prices at 3,
not 2.
- TestHoldsPriceTheModelTheReplyNamed: claude-opus-4-7 answered by
gpt-5.5 is priced at gpt-5.5's API price. Answered by an unpriced name,
it keeps opus's.
Run on mote at this tree, on origin/main
|
||
|
|
845e324b13 |
liveagent: each model on its own API, and the request format the user picks stays (xiaoxiaofei)
xiaoxiaofei on Discord: "magpie 默认导入的是 message 格式的,要可以自定义请求格式".
magpie wrote one LiveAgent provider, "magpie", type claude_code with
api anthropic-messages, for every model. K-brain asks all of a
provider's models on the provider's one API (routing/client.go builds
the client per provider; PiModel.api is only validated), and LiveAgent's
settings lock an Anthropic provider's API: only an OpenAI provider
(type codex) has a request format to pick (ProviderModalView.tsx,
resolveProviderApi; K-brain settings_provider.go accepts
openai-completions and openai-responses). So the format couldn't be
changed, and a GPT served on Responses was translated from Messages on
every turn.
Now, as dsh's routes do (dshKinds), each model goes on the provider of
the API it is served on natively (catalog.Model.APIs):
- magpie: type codex, Chat Completions, baseUrl the gateway's /v1, for
every model with no Responses or Messages API of its own (groups, Chat
providers' models);
- magpie-responses: type codex, Responses, baseUrl /v1;
- magpie-anthropic: type claude_code, Messages, baseUrl the root (K-brain
appends /v1; for OpenAI it appends only /chat/completions or
/responses, hence /v1 there).
A codex provider is written with api and requestFormat, as LiveAgent's
settings write one; when the user switches it in LiveAgent, a sync keeps
their format (one LiveAgent doesn't offer goes back to magpie's). A
provider left with no model is taken out. A config.json from before (all
on one claude_code "magpie") is moved on the next sync: each model brings
its record (the user's display name) and whether it was turned off, and
a default/compact/task pick of it follows it to its new provider.
Disconnect takes all three out. Docs: reference.md, agent-wiring.md.
Run (mote, through mote-run):
- go test -tags nogui ./internal/agent -run '^TestLiveAgent|Key': all pass,
new TestLiveAgentRequestFormat and TestLiveAgentFormatMove included.
- go test -tags nogui -timeout 45m ./internal/agent: ok (320s).
- GOOS=linux and GOOS=windows go vet ./internal/agent: clean; gofmt -l clean.
- K-brain 507f560 (the version LiveAgent af89ea7 pins), with Go 1.27.0
on mote: config.LoadFile on the config.json magpie writes in
TestLiveAgentRequestFormat loads it, and routing.ClientForProvider
builds *ai.OpenAI at http://127.0.0.1:3425/v1 for magpie,
*ai.Responses at /v1 for magpie-responses and *ai.Anthropic at the
root for magpie-anthropic (a throwaway test, not committed).
Broken by hand (a copy), each turned a test red:
- the user's format not kept -> TestLiveAgentRequestFormat;
- no carried record from another provider of magpie's -> FormatMove;
- picks not following their model -> FormatMove;
- Responses models left on magpie -> both;
- an emptied provider not taken out -> FormatMove;
- turned-off not carried to the new provider -> FormatMove.
Full suite at
|