1ccacad63281094de8a3372d5a507d38f9969e5c
2176
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7e1858515b |
remote magpie: name its models by the provider serving them there (lcc580 on X)
lcc580 asked for a pass-through on the Remote magpie provider: show the
upstream magpie's own provider beside each model, so an agent can tell the
same model from two of its providers apart. Before, the names followed
both magpies' Provider in model names: with either one Off, both relays'
DeepSeek Chat reached the agents as "DeepSeek Chat · Office" (or plain
"DeepSeek Chat").
- The list a magpie gives another magpie (X-Magpie-Drawers) now names,
as magpie_by, the provider serving each model there (Entry.ServedBy):
"routing group" for a group, and for a model of its own Remote magpie
the provider at the start of that chain. The fetch keeps it as the
model's By (catalog/live.go).
- A Remote magpie provider gets upstreamProviders: the editor's "Model
names" tick ("With the provider serving it there"), or
`magpie provider set <id> upstream-providers=on`. With it on, each of
its models is labelled "DeepSeek Chat · Office › Relay A" in every
agent's list, whatever either magpie's Provider in model names says,
unless the user named the model themselves under Own
(Entry.Label/upstream, LabelsFor). Model settings' "Agents' lists show"
line follows the tick at once.
- Ids are unchanged, so a request still goes by office/relay-b/model.
Off (the default) names everything as before. A remote older than
magpie_by has nothing to add, so its names stay as before.
- The core's scripts stay in budget: four long comments in app.js were
cut to pay for it, no raise.
Run:
- Tests that fail on the old code: TestRemoteMagpieUpstreamNames
(gateway: an httptest remote with two relays' DeepSeek Chat and a
group, every Provider in model names mode, on and off, the third
magpie's magpie_by, ids kept), TestServedByAndUpstreamLabel (provider),
and name-suffix-remote.test.cjs's new case (tick, hint, save body).
- Broken by hand: upstream() returning "" and the magpie_by line removed;
both Go tests went red with the plain labels, then restored.
- Two real gateways, built -tags nogui on the Linux box (WSL) under
sandbox HOMEs: B with Relay A and Relay B both serving deepseek-chat,
A with B as Remote magpie "Office". A's /v1/models before:
"DeepSeek Chat · Relay A · Office"; after
`provider set office upstream-providers=on`:
"DeepSeek Chat · Office › Relay A" / "› Relay B" / "› routing group".
A request for office/relay-b/deepseek-chat reached relay-b on B.
- gofmt -l clean; go vet darwin, linux (nogui), windows on the touched
packages; go test catalog, provider, gateway, cli, gui on mote
(macOS) at the rebased head: ok (catalog 2.6s, provider 165s, gateway 948s, cli 56s, gui 149s).
- GUI on mote, chromium and webkit: name-suffix-remote, remote-magpie,
remote-self, i18n-keys, i18n-en-no-cjk, gui-ja, gui-de, gui-zh-tw,
provider-detect-draft, provider-unmasked, routing-remote-windows,
usage-remote-cards: all green except reds that fail the same on origin/main
|
||
|
|
b9a1b4aa1d |
copilot: each account's own models, listed together and routed only to the accounts that have them (applemacssma on X)
"支持多个ghcp账号轮换和平均负载均衡吗,每个ghcp账号有的模型不一样。"
Several Copilot accounts and the Routing strategies (In turn, by usage)
worked already. What didn't: the copilot provider's list was the first
account's /models alone, so a model only another account's plan has was
nowhere to pick, and the gateway took every account to have every model.
Now each Copilot account's /models is kept as its own (accountModels,
read by Account.Lists), and the provider's list is their union
(copilotPoolModels over poolModels, the body codexPoolModels had). A
fetch of the first account's list also asks the other accounts on: one
with no list at once, of the rest the stalest once its list is a day
old, one per fetch. Only a failed ask is remembered (retried after an
hour). A model Copilot refused one account (model_not_supported) stays
in the list while another account on lists it (copilotOthersList).
Run (WSL magpie-desktop at 425195bf3; mote refused SSH all session):
- go test ./internal/provider/ ./internal/gateway/ -timeout 45m: ok
- go vet linux, GOOS=windows, GOOS=darwin CGO_ENABLED=0 for both: ok
- gofmt -l: clean
- TestCopilotAccountsWithOtherModels: octocat lists gpt-4.1 and
claude-opus-9, hubot gpt-4.1 and gemini-9-pro; the list is the union,
each model goes only to its account under In turn, gpt-4.1 to both.
- TestCopilotRefusedModelGoesToTheAccountServedIt: octocat's list has
gemini-9-pro but Copilot refuses it; it then goes to hubot alone and
stays listed.
Broken by hand:
- copilotPoolModels call removed: the first test red ("lists [gpt-4.1
claude-opus-9 auto], without gemini-9-pro").
- models.go's union check dropped: the second test red (gemini-9-pro
left the list).
- A refusal check in Account.Lists made no difference (the gateway
already keeps a refused account off that model), so it isn't in.
Not tried: real Copilot accounts on two different plans; the full
suite (runs after the tag).
|
||
|
|
6bac8f8a59 |
gui: magpie web on a phone has a tab bar with More (geraldpppppp on X)
On a phone, magpie web's pages sat in a strip under the header that scrolled sideways, with nothing to show that more pages lay past its edge. Agents, Library and the rest looked missing. The pages are now a tab bar at the foot, as an iPhone app's (HIG): each tab its mark over its word, the page open marked. Five tabs at most: with more pages than that, the fifth is More, and its menu lists the rest with their marks and a tick on the open one. More is marked while one of them is open, and it carries the dot when one of them has one. phonetabs.js does this. app.js loads it lazily only on a phone, so the core script doesn't grow. A status line comes up over the bar. The bar is only for the window, never the tray panel (body.panel). Agents still isn't shown in gateway mode on a machine with no agents, as designed (Settings > General > Gateway mode brings it back). Library has been shown in gateway mode since |
||
|
|
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).
|
||
|
|
388ca9ad45 |
agent: Claude Desktop says how to go on with the signed-in chats on magpie (Jacky_yyyyyyyy on X)
Jacky_yyyyyyyy on X asked that connecting Claude Desktop keep the earlier chats and let them be continued. They are kept already: in 3p mode Desktop runs in Claude-3p (its own userData), the signed-in profile's Code and Cowork sessions stay untouched in Claude/, claude.ai chats stay on Anthropic's servers, and Off brings them all back ( |
||
|
|
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
|
||
|
|
ca7a392919 |
gateway: MiniMax's image-01 draws on its own image_generation API (rocbomb123 on X)
minimax-cn/image-01 went to chat completions (catalog.ImagesAPI doesn't
know image-01), and MiniMax answered "invalid params, unknown model
'image-01' (2013)". MiniMax draws only on POST <host>/v1/image_generation
(platform.minimax.io and platform.minimax.cn API reference, t2i and i2i,
checked against the docs, not the report).
- draw_minimax.go: a MiniMax API key (filmsMiniMax: the minimax and
minimax-cn presets, or any provider at api.minimax.io, api.minimaxi.com
or api.minimax.cn) lists image-01 and image-01-live as drawers and
draws them at its own host: size -> aspect_ratio (a listed ratio or its
size; else image-01's width/height in 512..2048 by 8; else the nearest
ratio; 21:9 image-01 only), n, response_format base64, edit images as
subject_reference type character, the caller's seed, prompt_optimizer,
aigc_watermark and style passed on; mask and markup refused before
asking. data.image_base64 / image_urls are read; base_resp failures in
a 200 are told by code (1004/2049 key 401, 1008 balance 402, 1026
content 400, 1002 rate 429, 2013 400), and all images held back
(metadata.failed_count) says so.
- draw.go: viaFor sends them to the images path, drawImages to
drawMiniMax, DrawersOf adds them for a MiniMax key.
- A relay serving MiniMax models under another host is unchanged. The
minimax-code plugin sign-ins are not API keys and are untouched.
Run (mote, at
|
||
|
|
a1ba92ad8c |
library: a market of Pi's packages, installed and removed by pi itself (nineruiing on X)
Library -> Pi now has a Discover list of Pi packages: npm packages with the pi-package keyword (pi's own docs: the keyword makes a package eligible for the pi.dev/packages gallery), sorted by monthly downloads, with search. Like the other markets it ships a 500-entry snapshot (market_pi.json), keeps a 6h memory and disk cache, and refreshes from npm. Install and remove run that Pi's own `pi install npm:<name>` / `pi remove npm:<name>` with PI_CODING_AGENT_DIR set to its folder, so settings.json's packages list and <agentDir>/npm are written by pi, not by magpie. Each card says which Pis have it; Install goes straight to the only Pi without it or asks which one; the Pi's list gets a remove button behind a confirm. New routes: GET /api/library/market/pi, POST /api/library/pi/install and /api/library/pi/remove. Run: - mote: go test -count=1 -timeout 45m ./internal/library ./internal/cli ./internal/gui at this head: ok, ok, ok. - mote: gofmt -l clean; go vet of library, gui, cli for darwin, linux (-tags nogui) and windows: ok. - mote: library-pi-market, library-pi-extensions, i18n-keys, i18n-en-no-cjk in chromium and webkit: 52 of 52; the 17 market and library GUI files: 598 pass, 0 fail (pre-rebase tree). - win-run: go test -tags nogui ./internal/library -run 'TestPi|TestMarket' ok (TestPiRunGivesAgentDir skips on Windows). - wsl-run: library TestPi|TestMarket ok; library-pi-market 22 of 22. - Real pi 1.5.1 in a sandbox HOME on WSL: PI_CODING_AGENT_DIR=$A pi install npm:pi-btw wrote packages ["npm:pi-btw"] beside the existing theme and installed node_modules/pi-btw; pi remove put packages back to []. The live ~/.pi was untouched. Broken by hand (each red, then green restored): - the pi-package keyword filter dropped: TestPiMarketFromNPM; - the name check dropped in the market: TestPiMarketFromNPM; - the name check dropped in install: TestPiInstallAndRemove; - PI_CODING_AGENT_DIR not set: TestPiRunGivesAgentDir; - the identity dedupe dropped: TestPiInstallAndRemove; - the installed marking always "live": library-pi-market 11 of 11 red. Not tried: a real magpie binary driving pi install end to end; pi on native Windows; git: and local package sources (the market lists npm only, and the Pi's list still shows and removes them as before). |
||
|
|
10c4dc109a |
update: a restart by itself waits while magpie's window is in use (BESTLJP0412 on X)
With Restart automatically on, magpie restarted to update as soon as the
gateway was idle, even while the user was adding a provider or changing
settings in its own window, which closed what they were doing.
The page now tells the app it is in use: any pointerdown, keydown, input
or wheel posts /api/update/using (at most every 20s, and at once when a
dialog opens or closes, with whether #modal is open). inUseAt holds a
restart for 2 minutes after the last input (usingFor), or 15 minutes
while a dialog was open at the last input (openFor). waitFor skips the
restart while the window is in use, unless the restart was asked for
(the tray's Restart to update, Settings' Restart now), which still
restarts at once. A `magpie update` from a terminal (restartBeside) waits
the same way. The route writes nothing, so held doesn't drop caches for
it. /api/update says `using`, and Settings' Version row and the Update
pill add "waiting while you use magpie" (en, zh, zh-TW, ja, de).
docs/subsystems/gui-shell.md describes it.
Run (mote, at this head):
- go test -run 'AutoRestart|Wait|Idle|Restart|Using|EveryRoute|CoreScript|Budget'
./internal/gui/ ./internal/cli/: ok.
- go vet darwin, GOOS=linux -tags nogui, GOOS=windows for internal/gui
and internal/cli: ok. gofmt -l: clean.
- GUI, chromium and webkit: update-using (new), every update-*.test.cjs
and i18n-keys.
- TestCoreScriptBudget: fits with no raise. Main had 40 bytes left, so
the update code's comments next to this change were cut to one line
each (no code, every issue and reporter kept): 1,533,641 of 1,533,802.
- One webkit run of update-wait.test.cjs had a red subtest while mote
needed 10 ssh tries (its output was cut by my grep, so not filed);
update-wait passed 3 of 3 in webkit at this change and 3 of 3 on
origin/main
|
||
|
|
71075af726 |
codex: "subagents on any model" tells Codex V1 for a relay of the ChatGPT backend too (brethhbbm on X)
brethhbbm on X: lead on relay/gpt-6-astra, subagent model set to
relay/gpt-6.1-terra, "Codex subagents on any model" on. A new session's
subagents still ran on Astra, and Routing said the task was sealed and
only a ChatGPT account could read it. The model's catalog entry still
said multi_agent_version "v2".
Cause: the setting (settings.CodexAgentsV1) stamped V1 only on the
ChatGPT account's own models (codex/) and the groups one is in (Fast).
The relay lists Codex's own entry for gpt-6-astra (a sub2api asked with
Codex's client_version), "v2" included, and a relay offering Ultra is
given "v2" (AgentsV2) besides. In V2 Codex hands the lead the
collaboration namespace (spawn_agent etc.), whose arguments a relay of
the ChatGPT backend seals as the backend does (#1109), so
codexSubagentPick kept the subagent on the lead's model (sealedKept).
Fix: catalog.Model.Seals (provider.CodexSeals) marks a model whose
provider is of no sign-in on the Responses API, as the gateway's
canSeal, or a group with such a member. With the setting on, its entry
says V1 like the ChatGPT account's, listed by its relay or made by
magpie, so the task goes as text and the model set for subagents takes
it. Seals is in the list's tag, so Codex asks for the list again. A
model of an account that seals nothing (Copilot's Ultra, #656) keeps
V2, and with the setting off every entry is as before. No prompt text
or instructions change.
Real Codex (0.165.0, sandbox HOME/CODEX_HOME, fake Responses server,
model_catalog_json with the user's gpt-6-astra entry as
relay/gpt-6-astra): with "v2" the first request carries the
collaboration namespace (spawn_agent, send_message, followup_task,
wait_agent, ...); with "v1" it has none.
Run (Linux box via wsl-run; mote refused SSH for the whole session):
- go vet -tags nogui (linux), GOOS=windows go vet, GOOS=darwin
CGO_ENABLED=0 go vet -tags nogui on codexcat, provider, agent,
catalog, settings: ok; gofmt -l clean
- go test -tags nogui -count=1 ./internal/codexcat ./internal/catalog
./internal/settings ./internal/provider: ok
- ./internal/agent, and -run 'Codex|Ultra|Subagent|Sealed|Collab|AgentsV1'
./internal/gateway, were still running when this was pushed; their
results go on the release's issue thread if red
- at the pushed head (rebased on
|
||
|
|
10bef5fe09 |
codex: every account shares one list of the Codex app's projects, removals remembered (Michael25651150 on X)
The reporter wants the Codex app's projects kept however magpie switches
ChatGPT accounts. v0.1.3559 (
|
||
|
|
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
|
||
|
|
e6f151507f |
sessions: each session's output speed, a curve of its last two minutes
The owner liked a tweet's token-speed curve and approved a mockup
(claude.ai/artifact/7mrkMKdVi6jA3HA1Z6pRr5). Each Sessions row now
shows its output speed with a small curve; clicking it opens a popover
with the current tok/s, two minutes of seconds, tool gaps, and the
round's average, fastest second and output so far. A row not live
shows "Avg {n} tok/s".
Gateway: a curveMeter (session_speed.go) on the Server counts every
reply's content bytes per agent and session, from liveRow.observe, the
same count the Live view uses, and turns them into tokens with the
learned per-model rate (tokenRates.rate). A model with no rate yet
shows the curve's shape and no number: a guess would be a wrong
number. counted() opens a session's in-flight span, so a second with
nothing in flight is a gap (a tool ran), not a zero. A pause past 2m
starts a new round; 10m of quiet forgets the session; at most 256
sessions. Codex's own sign-in (codex_backend.go) went past serve and
liveRow before; it now has a liveRow too, so its sessions are counted.
GUI: GET /api/speeds, kept out of /api/sessions* so a once-a-second
poll doesn't set off session reading. The page polls only while
Sessions is shown and visible. managedJSON gains keys, so a row
matches a session the gateway saw under another of its keys. The
curve hides below 620px.
Run (mote's sshd resets every connection today, so Linux and Windows):
- Linux (magpie-desktop, wsl-run): gofmt clean; go test -timeout 45m
./internal/gateway ./internal/sessions ok except
TestGroupFailoverTimesEachTry, red once under load, 5/5 green alone
here and on main (#5948); node --test over every sessions-*.test.cjs
and i18n-*.test.cjs: 546/549, the reds sessions-export en in both
engines, the same on origin/main
|
||
|
|
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 |
||
|
|
18c932385e |
claude: a Claude model Claude Code doesn't know is run to 1M, so Codex compacts on Fable 5.2 (magicalaciw18 on X)
Codex on claude/claude-fable-5-2 (the Claude subscription bridge) never
auto-compacted. magpie tells Codex the model's 1M window and Codex
compacts at 272K, but Claude Code 2.1.316 doesn't know claude-fable-5-2,
so it assumes a 200K window. It turned every conversation past 200K away
before Anthropic was asked ("Prompt is too long", blocking_limit, 0
tokens). Codex got that refusal as a failed turn, not a compaction.
claudeRunName now asks Claude Code for such a model by its "[1m]" name.
That applies to a Claude model of generation 5 or later that Claude Code
doesn't know (claudeKnownLong) and whose window magpie doesn't know to be
under 1M. Models it knows keep their names, since a new name misses the
prompt cache once. Every generation 4 model keeps its name too:
claude-sonnet-4-6[1m] is refused even a short turn on an account without
usage credits. Only Claude Code's --model changes. The reply, the saved
session and the logs keep the model as asked.
Real runs (sandbox CLAUDE_CONFIG_DIR, real accounts, claude -p 2.1.316,
~275K-token prompt):
- claude-fable-5-2: Prompt is too long / blocking_limit.
- claude-fable-5-2 with CLAUDE_CODE_MAX_CONTEXT_TOKENS=1000000, or with
CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT=1: still blocked.
- claude-fable-5-2[1m]: OK.
- fable-5-1, sonnet-5-5, opus-5-5, haiku-5-5 plain, and fable-5-1[1m],
sonnet-5-5[1m]: all OK.
- Short turn: sonnet-4-6[1m] got 429 "Usage credits required for 1M
context" on one account; opus-4-6[1m], opus-4-8[1m] and fable-5-2[1m]
were OK.
- The live gateway gave the same refusal: 230K to claude/claude-fable-5-2
was refused, while claude/claude-fable-5-1 took 269K.
Siblings: Copilot lists max_prompt_tokens 200000 for claude-sonnet-5.5,
while magpie says 1M. A real 265K turn on copilot/claude-sonnet-5.5 (and
on copilot/claude-fable-5.2) was served, so that limit isn't enforced and
was left alone.
Tests: TestClaudeRunName, and TestClaudeRunAsksUnknownModelLong, which
uses a fake claude that records its args.
Run on mote:
- the new tests with TestClaudeCLI* and TestClaudeRunKept*: ok;
- go test -count=1 -timeout 45m ./internal/gateway/: ok (900s);
- go vet for darwin, linux -tags nogui and windows on ./internal/gateway/;
- gofmt -l: clean.
Broken by hand:
- passing the bare model to claudeCLIArgs made
TestClaudeRunAsksUnknownModelLong red (asked for "claude-fable-5-2");
- dropping the generation 4 floor made both tests red (sonnet-4-6[1m],
haiku-4-5[1m], opus-4-8[1m]).
Not tried:
- a real Codex session compacting through a sandbox build end to end;
- Claude Code versions other than 2.1.316, where the list of models it
knows differs;
- Windows (the fake claude is a shell script, so the test skips there).
The full suite runs after the tag.
Rebased on
|
||
|
|
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
|
||
|
|
e8fbee60ea |
gui: pause the gateway without quitting magpie (me2seeks on X)
Disconnect and quit was the only way to stop the gateway, and it quits magpie too. Pause does the same without the quit, from the tray's Pause Gateway (Resume Gateway while paused), Settings › General › Gateway (On/Paused, the app's only) and the Gateway page's Resume gateway, all through POST /api/gateway/pause. - Pause disconnects each connected agent as its row's Disconnect does (its own settings put back), keeps their ids in gateway-paused.json in the config folder, and stops the listener with requests in flight drained. An agent that can't be disconnected keeps the gateway serving, those before it connected again, and is named in the status line. - While paused, serveGatewayLocked serves nothing: not the 15s watch, a port change nor a handover; a magpie started again stays paused. A pause file that can't be read counts as paused. - Resume serves again and connects the agents the pause disconnected. A port held by something else keeps the pause and says what holds it. The Gateway page's Start/Restart, connecting an agent and picking one of magpie's models for it resume too. - quitask's wired list and the pause share wiredOf. - Strings in en, zh, zh-TW, ja, de. gui-shell.md documents it. Run (mote was unreachable for the later runs; the Windows box instead): - mote, before the rebase: go vet ./internal/gui; go test -run 'TestGatewayPause|TestGatewayResumes|TestTray|TestGatewayFix|TestQuit' ./internal/gui: ok. - at this tree on |
||
|
|
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). |
||
|
|
b46f23ffa5 | docs: the model list's provider ticks and a provider's billing | ||
|
|
543eb39b94 |
gateway, claudetui: an interactive run asked another effort goes on in its run, the conversation read from the cache
#5584 (Suge8, magpie 0.1.3216, Claude Code 2.1.318, Pi on Opus 5.5,
interactive mode): a turn asking another effort than the one before let
the run go ("its effort is set at its start, and the next turn asks
another"), and a new Claude Code was told the conversation from a
transcript: 72,416 tokens written to the cache on a 108-message
conversation, 178,309 on a 148-message one (first token after 94.4s).
-p runs take a new level by apply_flag_settings (#502). The interactive
mode can't, as measured on the real 2.1.318 (Haiku 5.5, tmux, magpie's
own arguments):
- typing `/effort high` keeps the cache (55,310 read before, 55,400
after), but saves the level as the default for new sessions:
modelSettings.<model>.effortLevel in the settings.json of the
account's folder, the user's own ~/.claude for Claude Code's own
sign-in, even with --setting-sources ''. Only `max` is session-only.
- a --settings file rewritten (effortLevel, or modelSettings.<model>)
changes nothing: the request stays at medium, with or without
--effort. Claude Code pins the file's content as it starts.
- after `/effort max`, the one field of its requests that changes is
output_config.effort.
Fix:
- Every interactive run has the guard file (guard.json, {} with no
safeguards); guardBody writes its safeguards and, once the run was
told another level than its --effort (ownEffort), "effort" beside
them. setSafeguards and the new setTUIEffort both write it from the
run's state (tellGuard, under settingsMu).
- tap.js asks each main request (x-claude-code-request-class: main) at
the file's effort in output_config.effort, and leaves Claude Code's
other requests as they were; CLAUDE_CODE_EXTRA_BODY gets the file
without "effort". It writes guard.json.live at the first main request
as well as the first one carrying safeguards.
- resume: an interactive run asked another effort calls setTUIEffort.
A run with no .live (no tap), or a turn asking Claude Code's own
level ("") of a run started at another, is let go as before, the log
saying which.
- A level the model refuses (real 2.1.318 on claude-haiku-4-5 through
such a rewrite: "API Error: 400 This model does not support the
effort parameter.") fails the turn as a run started at it would; the
existing path (ended, !ok) lets the run go, and the turn asked again
starts a Claude Code at that --effort.
- docs/subsystems/claude-subscription-bridge.md says so.
Run at this tree (base
|
||
|
|
99b080e2ee |
agents: an agent can have its own Provider in model names (KillTry27355 on X)
"希望 可以在不同的 agent中选择是否显示供应商名字,现在只能统一开关":
Provider in model names was one switch for every agent. An agent's
Details on the Agents page now has a Provider in model names row: As in
Settings · <mode> (the default, kept for everyone), On, Not on names I
set, or Off, for that agent alone. The CLI has the same thing:
`magpie model suffix <agent> [on|own|off|every]`.
- settings.AgentSuffix keeps the agent's own mode by the id its lists are
kept by (Agent.ListsFor, lower-cased, without @wsl: or #profile). An
agent with none follows PlainNames/PlainOwnNames as before, so nothing
a user already set changes.
- provider.LabelsFor(agent, es) reads that agent's mode. Every place
that named models with Labels for an agent now passes the agent: Codex's
catalog, the agents' written lists (route.go, Pi's extension), the
gateway's /v1/models (by agentOf(r)), Muse, Antigravity, Ollama, Claude
Desktop's catalog and descriptions, Claude Science. Labels is
LabelsFor("").
- POST /api/settings/agent-suffix sets it and rewrites the agents'
configs (catalog.Touched), as Settings' switch does.
- docs/subsystems/agent-wiring.md says where the mode is kept and read.
- The picker is in agentsuffix.js, imported when an agent's Details open,
so the core grows by the one line that loads it (1,529,335 of its
1,533,802 budget, after the previous commit's move). An agent whose
list takes no names of magpie's (noNames) has no row.
Tests, each red on the old code: TestAgentSuffix (provider: modes, keys
with @wsl and #profile, reset, bad input), TestAgentSuffixReachesItsFileAlone
(agent: Pi's file follows its own mode while Codex's follows Settings'),
TestModelsListFollowsAgentSuffix (gateway /v1/models per agent),
TestModelSuffixAgentCmd (cli), settings_keep (AgentSuffix survives a
Settings save), agent-suffix.test.cjs (5 languages x 1180/390 x chromium
and webkit, and a noNames agent has no row).
Broken by hand (a copy with LabelsFor ignoring the agent and the picker
reading no own mode): TestAgentSuffix, TestAgentSuffixReachesItsFileAlone,
TestModelsListFollowsAgentSuffix and every agent-suffix GUI case went red.
TestModelSuffixAgentCmd stayed green; it checks what is saved, not the
names.
Run on mote at this change on top of
|
||
|
|
327fb57659 |
redact: Never mask holds from the next text on, earlier turns stay masked (NicoleS76448271 on X)
A value let go from the request view's menu (Never mask) went as written
in the conversation's earlier turns too, so the prompt the vendor had
cached no longer matched and the whole conversation was read again at
full price. Now a text sent masked on a route keeps that value masked,
with the same placeholder, while magpie remembers the text; new texts
(the next turn, another conversation) send it as written. It holds for
values added in Settings too.
allowkept.go remembers a maphash of (route, text) and of the value,
never the value, in two generations of 2^17 like sentSpans' memo. Only a
request with a route (Options.sent and Route) keeps it; a search's query
or an embedding's input has the value as written at once. Keeping a
value masked is the safe side: a collision masks a value the user let
go, and a text no longer remembered (after a restart) sends it as
written, as before. The menu's message now says earlier messages stay
masked so the cache holds (en, zh, zh-TW, ja, de). The request view's
inline Never mask was already there (yew_fence on Discord).
Run (mote refused SSH for ~30 min at load ~125, so on the Linux box):
- wsl-run go test ./internal/redact/ ./internal/masking/ ./plugins/redact/
ok, at the pushed head b9d1f00a5 too.
- wsl-run go test -run "Mask|Redact|Allow|Sent" ./internal/gateway/ and
-tags nogui ./internal/gui/: ok.
- go vet: GOOS=windows (redact, gui), GOOS=darwin (redact), linux -tags
nogui (redact, gui): ok. gofmt -l clean.
- node --test mask-value-menu, i18n-keys, i18n-en-no-cjk (chromium and
webkit, every language): ok. masking-records: the same reds as fresh
origin/main
|
||
|
|
82962db79a |
routing: a rule can match the system prompt or the last user message, by words or a regex, with no model asked (SucroseMoE on X)
SucroseMoE asked for routing on plain string and regex matches instead
of an intent model: `system[0] matches /^你是对话标题命名/` → model A,
`user[-1] matches /^正在上下文压缩/` → model B, so any harness's title
and compaction calls can be routed without a classifier.
Two new rule condition fields, beside message/effort/subagent/agent:
- system: any block of the system prompt as the agent sent it (Anthropic
system blocks, Chat system/developer messages, Responses instructions
and system/developer items, Gemini systemInstruction). Any block, not
only the first, because Claude Code's first block is its billing
header.
- last: any text of the request's last user message as sent, reminders
the agent adds included, so an anchored ^ still meets a compaction ask.
Ops for both: contains, doesn't contain, starts with, matches (regex,
case-insensitive; a value written /…/ has its slashes dropped). The
gateway reads system and last only when a rule asks (RulesRead), and
decodes raw system JSON lazily then. Like every rule, the decision is
made as a turn starts and its tool rounds keep it.
GUI: Routing → group → Rules, "+" on a rule row offers "System prompt text"
and "Last user message" pills (no modal), with tooltips, placeholders
and the bad-regex mark; zh, zh-TW, ja, de. CLI: `--when "system matches
^You are"`, with aliases system[0], user[-1], last-user. TUI hint, docs
(gateway-routing.md, site start pages) say the same.
Ran, on mote (macOS) until its sshd began refusing connections: gofmt
-l internal/ clean, go vet of provider/gateway/cli/tui, the rule tests;
the routing GUI files (routing-rule*, routing-rules-line,
routing-pause*, group-*, i18n-*, routing-compact, routing-intent-*,
routing-smart-intent) in chromium and webkit: 751 of 781, the 30 reds
being "System prompt" taken by a core word (now "System prompt text"),
routing-rules-line's + menu count (now with system and last), and
routing-intent-entry, red on main since
|
||
|
|
b358677305 |
gui: open a server's magpie in a window of the app (xuanwo on X)
xuanwo runs magpie on a server and wants the desktop app to show that
magpie's routing and usage. Browser access in Settings › Network and
sharing goes the other way: it serves this app's page to a browser.
Settings › Network and sharing has a new section, Another magpie. It takes
an address and a key. You can paste the whole link the server printed
(`magpie daemon install --web`, `magpie web`, or another app's Browser
access), and its k= becomes the key. The app then opens that magpie's own
web page in a window of its own. The window signs in through the server's
own webGuard with ?k=, the same way a browser does, and is traded for its
cookie. Nothing new is served here: the page in the window talks to the
server alone and gets no bound calls from this app.
- remoteAddr:
- https:// is used when no scheme is typed.
- Plain http is allowed only to an IP, localhost, a .local name or a
one-word name, so the key never crosses the internet in the clear.
This is also the rule a Mac's webview applies.
- userinfo and other schemes are refused.
- remoteProbe: before the window opens, it asks for the link without
following redirects. Only a 303 that sets a magpie_web_* cookie counts
as success. A 401, a 403 (allowed addresses), an untrusted certificate,
no answer, or any other reply is reported in Settings, translated.
- remote-magpie.json:
- It sits beside settings.json, mode 0600, and the key is never in
settings.json.
- GET /api/remote returns the address and hasKey, never the key.
- POST with no key reuses the key kept for the same address.
- POST /api/remote/forget removes the file.
- The routes are on the app's own windows' API only (!isWeb). A host that
can't open windows refuses.
Run (on mote, at this tree):
- go test -count=1 ./internal/gui/: ok.
- Go tests:
- TestRemoteAddr
- TestRemoteOpensTheOtherMagpie: real webHandler; wrong or missing key
refused, nothing kept; the pasted link opens; 0600; the key is not
returned; a cookie-jar client following the opened link reaches the
page behind the key; the kept key is reused; forget.
- TestRemoteNotMagpie
- TestRemoteNotOnBrowserPages
- GUI test, new: another-magpie.test.cjs. Covers 5 languages, 360px,
and a browser page with no section that never asks /api/remote.
- GUI suite: every GUI file that draws Settings › Network (18, the new one included), plus
i18n-keys, i18n-en-no-cjk and gui-de/ja/zh-tw. Chromium and WebKit:
307/307 pass. Also remote-magpie.test.cjs (the Remote magpie
provider's add sheet), run with the new file at the rebased head.
- gofmt -l: clean.
- go vet: darwin, GOOS=linux -tags nogui, and GOOS=windows on
internal/gui; ok.
Broken by hand:
- A 303 without the magpie cookie taken as signed in:
TestRemoteNotMagpie red.
- remoteRoutes outside !isWeb: TestRemoteNotOnBrowserPages red (200).
- renderRemote drawn on a browser's page, and errors not translated:
another-magpie.test.cjs red in zh/zh-TW/ja/de and the browser case,
in both engines.
Not tried:
- The real Wails window on macOS, Windows or Linux.
- A real server over https.
- Links on the remote page that open a new window (target=_blank,
window.open) inside the remote window.
- Settings › Text size does not rezoom a remote window that is already
open.
|
||
|
|
248268ce4c |
codex: a switch of the preferred account leaves the Codex app running unless asked (Michael25651150 and ykj5353 on X)
After v0.1.3562 a switch of Codex's ChatGPT account made by hand in
magpie, between accounts that both had room, still ended the Codex
app's app-server with "Restart the Codex app when magpie switches its
account back" off. The app shows that as an error, relaunches, and
signs in as the new identity. ChatGPT.app 26.1103+ keeps its sidebar
projects per ChatGPT identity (electron-account-renderer-state-v1), so
on an identity that never had them it shows "没有项目" and every thread
under Recent: ykj5353's screenshot is the Codex app's sidebar, not
magpie's Sessions page.
codexAppStep no longer counts c.switched && !c.auto as by hand. Such a
switch is left running, logged, and the account rows' "still signed in
as" notice with its Restart is the way to follow, as for magpie's own
switch back. Still restarted with the tick off: a switch off a used-up
account (needed, the app greys Send there), Connect/Disconnect, the
takeover in and the takeover turned off by hand. RestartApp on restarts
on every switch as before.
Run (mote, at base 40ca0c88d; rebased onto
|
||
|
|
bc0d9e8739 |
agent: magpie's own Claude work folder isn't Claude Code bypassing magpie (ifccod7391564 on X)
The bridge runs Claude Code in os.TempDir()'s magpie-claude-work(-<uid>), and on the user's own home those prompts go into ~/.claude/history.jsonl too. LastUsed read them as Claude Code used with none of its requests reaching magpie, and the Agents page warned "Claude Code 最近绕过了 magpie". The owner's own history.jsonl has 1594 such lines, project /private/var/folders/.../T/magpie-claude-work-501. LastUsed now passes over lines whose project is that folder (inMagpieWork: the last path element, either slash, so a Mac's /private/var, C:/…, C:\… and a WSL mount all match; magpie-claude-workshop does not). lastJSONLTime takes a skip; Codex's history.jsonl has no project and passes nil. Run (wsl-run, magpie-desktop; mote refused SSH the whole time): - go test -count=1 -timeout 45m ./internal/provider ./internal/agent: provider ok; agent ok but TestGrokInstalled, the known WSL2 binfmt red (#3548), unrelated - TestClaudeBridgePromptsArentBypass, TestDriftBypassed on Windows: ok - cross-OS go vet as in the provider commit; gofmt -l clean Broken by hand: LastUsed with skip nil: the new test is red with the reporter's bypassed drift. Not tried: the GUI (no GUI change), the macOS run (mote down). |
||
|
|
980a4b981f |
provider: an answer naming only five_hour keeps the week kept on disk (ifccod7391564 on X)
On a cold start nothing of a Claude account was in claudeUsage, so the first rate_limit_event, which often names five_hour alone, became the account's whole reading: withHeardClaude laid that one window over the card read from quotas.json, and the 7-day ring, not renewed yet, was gone. NoteClaudeLimits now merges what an answer tells into what is kept, and with nothing in memory into the windows quotas.json kept that haven't renewed since (keptClaudeWindows). A renewed week isn't brought back. quotas.json is read before claudeUsage is held: lastQuotas has its own lock. Run (wsl-run, magpie-desktop; mote refused SSH the whole time): - go test -count=1 -timeout 45m ./internal/provider ./internal/agent: provider ok; agent ok but TestGrokInstalled, the known WSL2 binfmt red (#3548), unrelated - TestNoteClaudeLimitsKeepsTheWeekOnDisk on Windows (win-run): ok - GOOS=linux go vet -tags nogui ./internal/..., GOOS=windows and GOOS=darwin (nogui) go vet of agent/provider/gateway: ok; gofmt -l clean Broken by hand: NoteClaudeLimits ignoring the disk (kept = onDisk[:0]): the new test is red with the card holding only "5 hours", as reported. Not tried: a real cold start against a real account's rate_limit_event; the macOS run (mote down). |
||
|
|
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 |
||
|
|
2fbead7983 |
provider: a relay URL typed without its /v1 (CRS's …/openai) is tested, detected and listed under it (Cyrus_4433 on X)
Cyrus_4433 added a claude-relay-service provider as OpenAI compatible at
http://<ip>:55088/openai. The list couldn't be fetched and Test models
said "gpt-6.1-sol: 404 · Not Found". From CRS's src/app.js and routes:
/openai mounts unifiedRoutes (POST /v1/chat/completions) and
openaiRoutes (/responses, /v1/responses); /api mounts GET /v1/models.
There is no /openai/chat/completions or /openai/models, and anything
unrouted is 404 {"error":"Not Found",...}. magpie asked base +
/chat/completions, i.e. /openai/chat/completions.
- probe: a Chat/Responses 404 at an unversioned base equal to the
provider's URL is asked once more at base/v1/... (missingV1; not
accounts, Azure, Bedrock, Vertex). Answered OK there, the saved URL
takes /v1 (setV1) and the result carries it (Result.V1); Detect uses
it as the base; the editor's URL field follows (draft.onV1) so Save
doesn't undo it. A 404 at both stays the first 404.
- catalog: an unversioned …/openai base is also listed at
<origin>/api/v1/models (RelayOpenAIList), and fixV1 adds /v1 when the
list answered there.
Run (WSL magpie-desktop via wsl-run; mote's sshd reset every
connection this session):
- at 630b0de98 (this change on
|
||
|
|
f1996e7e5d |
gateway: a provider named past its usage cap is not sent on to a group (Anotiaww on X)
Anotiaww on X: magpie on server B asked magpie on server A for claude/claude-opus-5-5. A's Claude account was past its usage cap (the trace: "a usage window at 98%, over the account's 98% cap"), and the Claude provider had no fallback set. The request was answered by a WorkBuddy member of the user's routing group claude-opus-5.5 (the trace row marked Fallback), with nothing said. They expect the cap's refusal. Cause: |
||
|
|
6b92824ff5 |
usage: a window's whole also at base rates, without long-context premiums (#5861, Norethcy on X)
A window's whole (WindowHolds) is priced at API list prices, which charge
GPT-6.1 Sol's input above 272K at a premium a subscription's own use
doesn't pay. A cycle with more long calls then reads as a larger
allowance: NorethSea's previous week came to $76.56, $53.52 without the
premium, against $56.99 for the current one.
Each priced call is now also costed at its model's base rates, the
long-context tiers left out and a peak hour's price kept (baseRates), and
the window's whole sent as BaseCost beside Cost, only when the two differ.
Past cycles get it too (HistoricalWindowHolds goes through windowHolds).
On the card the figure then says which it is ("≈ $76.56 API") and is a
button: a click switches every card, past cycles too, to the base figure
("≈ $53.52 base") and back, moves nothing, and is kept in the browser.
Its tooltip names both and says neither is an official dollar allowance
or a fixed quota. A window that paid no premium is drawn as before. The
ledger's and the API's real cost are unchanged. #4181 (auto-review calls
counted in the whole) is not part of this.
app.js and the core stay in their budgets with holdsLine's and holdsWhy's comments cut, no raise.
Run (mote's sshd reset every connection, so on the Linux box through
wsl-run; the package run at base
|
||
|
|
4921bf5a97 |
usage, sessions: one model option for a found routing group's two ids (#5892, Norethcy on X)
A found routing group is called by its public id (auto/<model>) and is kept as group/auto-<slug>; calls recorded under either were counted as two models, so Usage › Sessions' model filter listed the same group twice and the ledger, summaries and session lists split its calls. Ported from NorethSea's 30d6261cd on their fork: UsageAlias names a found group by its public id before the user's alias (both spellings, old session files too), sessions' lists, the ledger keyer, the summary cache's key and Codex's model/effort read through it, and a cache keyed on the group names (UsageNamesKey) is read again when a group is renamed. A user's own provider named "auto" keeps auto/<model> (autoRefsOn). Changed in review: the patch's ledger filter compared every record with provider.SameRef, which reads the providers (customIDs, a stat of providers.json) for each record a filter passes over. FilterOf, the one place a Filter is made from a query, now canonicalizes the model once, and keepsRecord asks the providers only for an auto/ record under a group/ filter (sameGroupModel). Run (mote's sshd reset every connection all afternoon, so on the Linux box through wsl-run; the package run at base |
||
|
|
25c36e862a |
gateway: a relay's pooled refusal of one model rests that model, not the key (Jray05343207 on X)
Jray05343207 (Windows) connected Codex through magpie and got
"auth_unavailable: no auth available (providers=codex, model=gpt-6-sol;
last upstream error: model_not_found: The 'gpt-6-sol' model is not
supported when using Codex with a ChatGPT account." That text is not
magpie's: it is CLIProxyAPI's (sdk/api/handlers/handlers_errors.go,
enrichAuthSelectionError), a relay pooling ChatGPT accounts. It lists
gpt-6-sol whatever its accounts' plans serve, and once every account
refused it answers 503 with the last refusal in its words.
modelRefused read only 400/403/404/422, so the 503 was a plain outage:
the whole key rested on the backoff ladder, every model on the relay
with it, and the model stayed offered. Now a 5xx whose body is that pool
answer ("no auth available (providers=…; last upstream error: …)",
poolLastError) is judged by the last upstream error's own words, as a
404 would be: a model refusal rests only that model on that key
(restID), and the key's other models are asked straight. A last error of
quota, or none named, reads as before. plainUnavailable leaves such a
refusal to modelRefused too. docs/subsystems/gateway-routing.md says so.
Run (WSL magpie-desktop, Linux; mote's sshd reset every connection):
- TestPoolModelRefusalRestsTheModelNotTheKey (two keys on a relay
answering the reporter's exact body as 503) and TestPoolLastErrorRead:
pass.
- Broken by hand (the poolLastError branch removed): both red; each key
rested whole ("Why:other Status:503 By:backoff") and gpt-6-sol didn't
rest on its own.
- TestModelNotInPlan*, TestFallback*, TestEscapedWords*: pass.
- go vet ./internal/gateway for linux, windows and darwin; gofmt -l clean.
- go test -count=1 -timeout 45m ./internal/gateway: ok (1025s, Linux)
Not tried: a real CLIProxyAPI with a plan lacking gpt-6-sol (fixture is
the reporter's literal text in CLIProxyAPI's body shape); the user's
Codex still gets the 503 if gpt-6-sol is the model it asks for and no
other provider serves it, so the reply asks them to pick another model.
|
||
|
|
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.
|
||
|
|
720200092e |
agent: turn off an agent's own telemetry from its settings (OipsAnthony on X)
An agent with a documented telemetry switch has a Telemetry row in its
Settings on the Agents page (opened row and settings sheet). Off writes
that switch into the agent's own config the way magpie writes it already:
- Codex: [analytics] enabled = false in config.toml (feedback left alone)
- Claude Code: env DISABLE_TELEMETRY and DISABLE_ERROR_REPORTING = "1"
- Gemini CLI, Qwen Code: privacy.usageStatisticsEnabled = false
Nothing is written until the user turns it off. Off writes only keys the
file lacks and records them in the stash; a key the user set on refuses
Off and names it; one they set off stays, and the row says so. On takes
out only the keys magpie wrote that still hold magpie's value. An
unreadable config is unknown: the row says so and can't be pressed.
Agent.Telemetry is not a Field, so profiles never carry it and Unwire
leaves it. Only agents on this computer (no WSL distro, #3896).
POST /api/agents/telemetry/{id}; strings in zh, zh-TW, ja, de.
The row is paid for in the core budget with sixteen Agents-page comments
cut in app.js (core 1,532,840 of 1,533,802 after the rebase), no raise.
Run (mote, at this head on origin/main 1ad9d157f; vet, the three packages and agent-telemetry, i18n-keys, agent-details-ready, click-scroll again there, 98 of 98):
- go test -run Telemetry ./internal/agent, then go test -count=1
./internal/agent ./internal/gui ./internal/cli: ok
- go vet ./..., GOOS=linux -tags nogui, GOOS=windows: ok; gofmt clean
- GUI, chromium and webkit: agent-telemetry (34 pass: every language at
1100 and 640px, no scroll on click, no select, the user's own off,
a refusal, the sheet), and 104 agent-*, i18n-*, click-scroll,
settings-search, panel-agent and agent-settings files: reds only in
page-width-steady and mobile-web (red the same at origin/main
|
||
|
|
1ad9d157fe |
gateway: a compaction a ChatGPT-account relay refuses as system asks again with the roles as sent (#5067, acui145 on X)
Codex's summary ask to a provider that isn't OpenAI's carries its developer messages as system ones (forVendor, #2955). A plugin provider fronting a ChatGPT account (magpie-sub2api -> sub2api -> Codex backend) is such a provider, and the backend behind it takes developer alone: every compaction came back "System messages are not allowed", the sessions that got through fell to the conversation-as-text summary, and the ones whose refusal came as an error event after a 200 skipped every retry and were held after three (compactFails). Now a summary refused "System messages are not allowed" (as passed through, or as a current sub2api words it), or with a relay's bare "Upstream request failed" (the reporter's sub2api), as a 4xx or as an error event in the stream (roleRefused), is asked once more with the roles as Codex sent them (askAsSent turns off the compaction marker, whose only reader is forVendor's swap), then as text, then made by magpie. A summary with no developer message to give back is not asked the same twice. Every route a compaction reaches a Responses provider by (CodexPath, Codex's own models through magpie's accounts, the mask route, a CC Switch table) goes through codexCompact and serve's one forVendor call, so all of them are covered. #2955's chat-only vendors take system and are unchanged. Ported from ggbdpq's patch (fix/5067-compaction-system-messages, 79ec15d26), which matched only the passed-through wording on a 400. The review added the reporter's own "Upstream request failed", the error-event shape, the developer gate, lazyre for the words, and the subsystem page. Run on mote at this change on 6a253f8af; rebased onto |
||
|
|
15acba5347 |
codex: the Codex app's projects follow an account switch, and the app isn't quit unasked (Michael25651150 on X)
"切换账号 codex 添加的项目丢了 发生过好几次了 另外额度用尽时会强制重启 codex 客户端"
Projects. The Codex app (ChatGPT.app 26.1103 and on) keeps its sidebar's
projects per ChatGPT identity in $CODEX_HOME/.codex-global-state.json,
under electron-account-renderer-state-v1 ({owner, inactive:{<sha256 of
JSON.stringify([chatgpt_user_id, chatgpt_account_id])>: {atoms, globals}}}).
On an account change it parks the old identity's account-scoped globals
and loads the new one's, so magpie's switch (auth.json, then the
app-server's restart) showed an account that never had the app open with
no projects (#5497, #5602, #5702, #5874). Read from the app's own bundle
(early-bootstrap-133 selectRendererOwner, -815's owner hash). The app reads
the file only at launch and writes its memory over it, so magpie writes
it only while the app is closed (codex_projects.go): from the 3s loop once
the file, auth.json or logins.json changed (process listing at most every
30s), and between the quit and the open of every reopen (appQuitDone in
reopenBundle and restartWin). Each identity of auth.json and the saved
Codex logins whose snapshot has no local-projects key gets the project
keys of the identity with the most; an own list (an emptied one too) is
left; g-p- ChatGPT project mirrors and their ties aren't carried, and a
backing naming another account is dropped (the app refuses those). A
file without the key or that doesn't parse is not written; the first
write keeps the file as it was beside it (.magpie-before-projects).
Restart. When quota runs out magpie restarts the app's app-server (the
takeover needs it: the app reads its account only as its app-server
starts, else Send stays grey). A ChatGPT app can then show "hit a snag",
and magpie quit and reopened the whole app (CodexAppRelaunch), and on
Windows reopened an app that started no app-server (codexAppGotNone).
Both now happen only with "Restart the Codex app when magpie switches its
account back" ticked (codexRestartsApp, off by default); otherwise the
Agents row says to quit and reopen, as it did where a relaunch failed.
Run (mote unreachable all session: ssh kex reset on every try; so on the
Linux box and Windows box instead):
- wsl-run: go vet -tags nogui, GOOS=darwin CGO_ENABLED=0 go vet and
GOOS=windows go vet of internal/provider and internal/agent: ok.
- wsl-run go test -tags nogui ./internal/provider ./internal/agent:
provider ok; agent red only on TestGrokInstalled (#3548, WSL binfmt).
- win-run go test -run 'TestCodexProjects|TestCodexRendererOwner|
TestCodexApp|Restart' ./internal/provider ./internal/agent: provider ok;
agent red on TestWorkBuddyRestartOnMac (#4115) and
TestOpenMausBotRestartOnMac (added to #4115), neither touched.
- gofmt -l: clean.
- The owner hash checked against node's crypto (TestCodexRendererOwner).
Broken by hand: carryCodexProjects returning at once -> the four
TestCodexProjects* red; the snag gate removed -> TestCodexAppNotQuitUnasked
red (relaunched 1); the Windows gate removed -> red (reopened 1); the
backing strip removed -> TestCodexProjectsFollowASwitch red.
Not tried: the real Codex app. This Mac's ~/.codex state has no
per-identity key (read-only check), so the switch is reproduced against a
Go port of the app's selectRendererOwner on the issues' layout, not the
app itself. No macOS test run (mote down). The takeover (no account)
still shows no projects in the app, by the app's own rule; they come back
with the account. Projects added while the app runs reach other accounts
once it is closed.
|
||
|
|
ece12b370d |
search: TinyFish is a built-in search API (Niapyaya on X)
Niapyaya asked on X for TinyFish (tinyfish.ai) among the search APIs. TinyFish has a plain Search API beside its browser agents, so it is added as vendor "tinyfish", following Yuanbao Search ( |
||
|
|
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
|
||
|
|
f2b9ec354a |
gateway: Codex's auto-review goes on where its conversation does when the sign-in is out (riverleaf88 on X)
riverleaf88 on X: with Codex's ChatGPT allowance spent and magpie routing Codex on to another model, Codex's automatic review still failed. Codex's guardian (codex-rs guardian-v2 sync_reviewer) asks the same provider, so magpie's /backend-api/codex/responses, on codex-auto-review (approval_review_preferred_model) with x-openai-subagent: guardian. On a spent sign-in codexFallsBack and serve's groupsAfter looked for fallbacks and routing groups of codex/codex-auto-review, a model no group names, so the review was handed ChatGPT's 429 while the conversation's turns went on to the group. - codexReviewAfter: an auto-review on the codex sign-in takes the model its conversation's own turns go on (codexLeads). A codex model brings that model's fallbacks and groups (fallbacksOnly on the lead too); a magpie model the caller may use (servedSession) is tried itself. codexFallsBack and groupsAfter add them. - codexHolds: once a 429 naming a reset held the account, later turns (main turns too) were answered with the held refusal before any fallback. The held branch now hands a /responses turn with fallbacks to codexFallBack as the first spent turn was. - docs/subsystems/gateway-routing.md says both. Run (mote): go test -count=1 -run 'TestCodexReviewSpent|TestCodexHeld| TestCodexOneAccount|TestCodexSpent|Hold|Held' ./internal/gateway/ ok 71.2s; gofmt -l clean. New tests red on the old code: TestCodexReviewSpentFollowsTheGroup and ...FollowsMagpieModel (review got 429 usage_limit_reached); the held case in TestCodexHeldTurnFollowsTheGroup. Broken by hand: codexReviewAfter returning nil turns TestCodexReviewSpentFollowsTheGroup, ...FollowsMagpieModel and TestCodexHeldTurnFollowsTheGroup red; dropping the held-branch fallback turns TestCodexHeldTurnFollowsTheGroup and ...FollowsTheGroup red. Not tried: a real exhausted ChatGPT account; guardian-v2's async scorer; the multi-account pool path past serve's candidate loop is covered only through the one-account tests. Also run (mote, at this tree): go vet ./internal/gateway/ for darwin, GOOS=linux -tags nogui and GOOS=windows: clean. go test -count=1 -timeout 45m ./internal/gateway/: ok 1037.9s (base |
||
|
|
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
|
||
|
|
00e8242e85 |
library: Hermes folds its context with billion-context through its /bili/ prefix (Duckb7si on X)
Library › billion-context said no agent could use it on a machine where
Hermes was connected to magpie. Hermes was left out of the lanes on
purpose: bili's native Hermes plugin (hermes-plugin/__init__.py,
apply_env, billion-context 0.1.213) only sets HTTPS_PROXY, HERMES_CA_BUNDLE
and SSL_CERT_FILE. magpie's Hermes provider is http://127.0.0.1:3425/v1,
plain http on loopback, so that proxy never sees it: the plugin would add
its tools and fold nothing.
Hermes now takes the route Zed takes, bili's documented /bili/ prefix.
Turned on, magpie runs `bili start --port 8787` and sets base_url of the
magpie and magpie-anthropic providers to http://127.0.0.1:8787/bili/<gw>,
in config.yaml and in every profile that has magpie's provider
(agent.HermesThrough). Each later Sync or pick keeps a loopback prefix
with a path (hermesPrefix), and drops anything else back to the gateway.
Turning it off puts the gateway back. The empty-list string, docs (en, zh,
ja), llms-full.txt and docs/subsystems/library.md name Hermes.
The other agents bili supports that magpie wires (dsh, Kimi, ZCode, Codex,
Gemini, Qwen, ...) are #5915.
Run (mote, at the rebased head unless said):
- go test -tags nogui ./internal/library: ok (252s) at the rebased head
- go test -run 'TestHermes|TestZed|TestProxy|TestBili|Kept'
./internal/agent ./internal/library: ok before the rebase (base
|
||
|
|
6a253f8af7 |
memory: pick several memories and keep, archive or delete them at once (RealZeroP27 on X)
Library -> Memory reviewed one memory at a time: To review held
candidates that had to be opened and kept or deleted one by one.
- Select (beside the filters, shown when two or more are listed) puts a
box on each memory. A click picks one, Shift-click the range from the
last one clicked, up/down move between the boxes (Shift picks as it
goes), Cmd/Ctrl+A picks all shown, Escape ends it. A search or filter
unpicks what it hides.
- The bar under the list (the library's lib-pickbar, as Skills' Select)
keeps (To review), archives (In use) or restores (Archived) the picked
ones, and deletes them on a second click.
- POST /api/memory/status {ids, status}: memory.SetStatus changes them in
one write, each as Edit by the user (an archived inferred memory is
dismissed, so it isn't proposed again). Unknown ids are skipped; none
found, or a bad status, is a 400 and changes nothing.
Delete reuses POST /api/memory/remove {ids}.
Run (mote, at this head):
- go test ./internal/memory ./internal/memdistill ./internal/library: ok
- go test -run 'Memory|Distill|Dream' ./internal/gui: ok
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet
./..., and the three builds: ok. gofmt -l: clean.
- library-memory-select.test.cjs (new): 22/22, chromium and webkit,
en/zh/zh-TW/ja/de at 980 and 420 wide (no native select, no sideways
overflow).
- Every library-*, i18n-* and gui-* GUI file (67), both engines: 1309 of 1309 pass.
- Rebased on
|
||
|
|
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 (
|
||
|
|
97fcbe3540 |
library: billion-context's card shows the tokens it saved (Scott__D on X)
The RTK tab says what RTK saved (rtk gain); the billion-context tab said nothing of its effect. bili 0.1.213 has no command that prints its savings. Its running proxy serves its dashboard's numbers at GET /__bili/overview, summed over every session in its one store, and each bili that runs registers in <state>/instances/<id>.json ($XDG_STATE_HOME or ~/.local/state, then billion-context, on every system; read from bili's dist and its Hermes plugin's twin reader). readBiliSaved (internal/library/bili_saved.go) asks the registered bilis newest first, loopback http origins only, 3s in all, and puts the first answer on BiliView.Saved: netSavedTotal (bili's headline "net savings", after post-fold rebuilds and the summaries' cost, only with hasFoldData), grossSavedTotal (which bili calls an upper bound), foldsTotal, sessions, requests. The answer is kept in bili-saved.json in magpie's config folder and shown "as of" its time when no bili runs; a kept file that doesn't parse is no answer. magpie never starts a bili to ask (it would auto-update and start watchers). The card says "166.3k tokens saved over 7 folds in 1 session", bili's own count over every session on this computer, the gross before costs; "Nothing folded yet over N requests" before a fold; and that it shows once bili has run when no bili ever answered. zh, zh-TW, ja and de; site docs (en, zh, ja) and docs/subsystems/library.md. Run: - Real bili 0.1.213 on mote in a sandbox HOME (ACP_AUTO_UPDATE=0, 20000 token window, bili start on 18799, a fake OpenAI upstream answering usage = bytes/4): ten turns of a growing conversation through /bili/<upstream>/ gave overview net 166285, gross 166390, 7 folds, 1 session, 10 requests. That literal answer is the Go fixture (testdata/bili/overview-0.1.213.json) and the GUI test's numbers. readBiliSaved/ReadBili run on mote against that live bili with that HOME read the same numbers (Live true, Version 0.1.213). - go test -tags nogui ./internal/library ./internal/gui on mote: ok. - win-run go test -run 'TestBiliSaved|TestBiliLoopback' ./internal/library on xiaomi-gpu: ok. - library-bili, i18n-keys and i18n-en-no-cjk in chromium and webkit (every language, 1100 and 420 wide): 92 pass, 0 fail. - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui and GOOS=windows for internal/library and internal/gui: ok. - site/public/llms-full.txt regenerated (node llms-full.mjs); site worker.test.mjs: 38 of 38 ok. Broken by hand: - the loopback filter taken out: TestBiliSavedFromRunningBili red (192.0.2.7 asked first, the 3s budget gone, nothing read). - net read from tokensSaved, and a kept answer marked live: TestBiliSavedFromRunningBili and TestBiliSavedOnThePage red. - the card's line taken out: library-bili 40 of 42 red (chromium). Not tried: a real agent session with a real model through bili (the upstream was a fake with made-up usage, so only the plumbing of bili's numbers is checked, not how much a real session saves); a bili with money data (hasMoneyData; its dollars are passed as usd but not shown); the card on Linux WebKitGTK. |
||
|
|
eff7f9f62a |
library: a market server starts the way its registry entry says (fwxkogaia on X)
Serena from Library → MCP's market showed "已退出 (2)": magpie ran `uvx serena-agent`, which prints its help and exits 2. The registry has uvx run it as `uvx -p 3.13 serena-agent start-mcp-server --project-from-cwd --context desktop-app`: its runtimeArguments, which the shipped crawl (market_servers.json) had dropped and magpie never read. The class, fixed in launchLine (market_launch.go): - runtimeArguments are read: the runner's own options (uvx -p/--from/ --with/--prerelease, npx --package, docker's mounts, -e and --entrypoint) go before the package, the program's words after it, then packageArguments. A required option with no value magpie can fill keeps the package from being offered. - An executable not named after its package is reached with `uvx --from <pkg> <bin>` / `npx -y --package <pkg> <bin>`. The crawl now keeps each package's executables (`bins`: npm's `bin`, the wheel's console scripts); a package with none, or several with none standing out (pickBin), isn't offered. `python -m mod` among runtimeArguments runs that module from the package. - One package that can't be started no longer hides another of the same server (npm, then pypi, then oci). - serverKey/packageOf skip uvx's option values, so Serena's key stays "uvx serena-agent" and an installed one is still found. Audit of the 500 shipped entries (old line → new): 101 change. Among them firebase (`npx -y firebase-tools mcp`), basic-memory, docling, ouroboros, pm-claude-skills, llm-sandbox, polymarket-paper-trader, visualtorch, canvas-mcp, alfanous (python -m), uniswap, pyscrappy, llmtrim, reddit-research-mcp, word-mcp-live, omega, tinysearch, haiku-rag, orcareplay, terravision, watch-skill, PyMemoryEditor, edgartools/mirobody/new-term-radar/backlot (--with/--python), docker robin/funasr/MARM (mounts). No longer offered (no line that starts): aihawk and mcp-sap-docs (not on PyPI/npm), mcp-video, unifi-mcp-server, antigravity-link-extension (no executable), token-savior, flyto-core (several, none for MCP), maintenant and apollo (a docker mount to fill in). Users who installed one already: heal() gives a uvx/npx server whose command and arguments are exactly the line magpie offered before the line the registry says (healMarketLines), so the next start of magpie rewrites library.json and every agent given it. A line the user edited is left as it is. Run (mote, via mote-run): go test ./internal/library ./internal/gui; go vet darwin, GOOS=linux -tags nogui, GOOS=windows; gofmt. TestRegistryLaunchLines uses the registry's own entries (Serena, docling, olcli, alfanous, visualtorch, basic-memory, firebase, MARM, ...); TestPopularSerenaStarts reads the shipped crawl; TestInstalledMarketLineHealed seeds `uvx serena-agent` given to Codex, syncs, and checks config.toml and library.json. No network in tests. Real starts on mote in a sandbox HOME (MCP initialize): `uvx serena-agent` exits 2 with usage; the new Serena line answers initialize (serverInfo Serena). Also answer: polymarket pm-trader-mcp, basic-memory, llmtrim, pm-claude-skills, visualtorch-mcp. canvas and reddit start but need their keys. Broken by hand: ignoring runtimeArguments and the bins check turns 14 of TestRegistryLaunchLines' cases and TestPopularSerenaStarts red; dropping healMarketLines from heal turns TestInstalledMarketLineHealed red. Not tried / still wrong upstream: omega and tinysearch now run their real executable but their registry entries omit the `[server]` extra (omega also needs `serve`), so they still don't serve MCP; that is their registry entries. Docker lines weren't started. No GUI asset changed, so no GUI files were run. The full suite runs after the tag. |
||
|
|
d374168d04 |
gui: Settings stays where it was clicked in the sidebar (jen_celeus on X)
In the sidebar layout Settings sits at the sidebar's foot, and opening it
listed its eight tabs under the button. The foot is anchored at the
window's bottom, so it grew upward and the button rose about 223 points,
out from under the pointer, and dropped back when another page folded the
list.
Settings' tabs now open above its button and grow up from it, so the button
and the gateway's line stay where they were. The foot is laid from its end
(`.side-foot` is `column-reverse`, its rows ordered tabs, Settings, gateway
and kept whole). A window too short for the list scrolls the foot from its
end, so the button stays in sight, and the foot may take 80% of the sidebar
while the list shows instead of 55%. The list's DOM order is the order
shown, so Tab reads tabs, Settings, gateway. The rows rise from the button,
nearest first. The overlay bar's thumb math takes the reversed scroll
origin. Nothing else in the layout changes: pages' own tabs still open
under their rows. The core-script budget is paid by cutting two sidebar
comments, with no raise.
Run (mote, at this head after rebasing on
|
||
|
|
281a7e024f |
sync: a computer can follow the server, taking its setup and sending none (Ramon317317 on X)
Ramon317317 asked for a main profile: one computer the others take their
setup from, so they never drift apart. Sync merged both ways only;
Restore is a one-time pull and an agent's own fields cover agents only.
A computer can now be set to follow the server (Settings -> Sync -> This
computer: Both ways / Follows the server; /api/davsync/follow-server;
`magpie webdav|s3|github follow on|off`). It is chosen per computer and
kept in sync.json (Config.FollowServer, kept by Configure like AutoEvery).
A following computer:
- takes every changed part from the file, whichever side is newer;
- never writes the file: no push, no merged sign-in, no rebuild of a
damaged file;
- keeps a change made on it in the sync folder, as a join does, and the
notice says it was replaced because this computer follows the server
(Notice.Followed; GUI and CLI);
- still keeps an unset part on the server from emptying its own, and own
agent fields and agents only here;
- refuses to follow a server with no file yet, sending nothing.
The computer followed stays two-way; nothing changes for anyone who
doesn't pick it. Usage sharing is unchanged. docs/subsystems/sync-backup.md
says so.
app.js stays inside the core script budget (TestCoreScriptBudget) with
no raise: renderSync's comments are cut down to pay for the row.
Run (mote, at this head):
- go build ./...; go vet ./... (darwin), GOOS=linux go vet -tags nogui
./..., GOOS=windows go vet ./...; gofmt -l clean.
- go test ./internal/davsync ./internal/cli ./internal/gui: ok (cli
with the route guard fix committed beside this one).
TestFollowServer (empty server, join, own change replaced and kept,
both changed, unchanged sync, Configure keeps it, back to both ways)
and TestFollowServerSendsNoSignIn are new.
- GUI (node --test, Chromium and WebKit): sync-follow-server (new; en and
zh, 900px and 400px: name, sub, picked segment, the post, the notice,
no scroll, no overflow, no select, re-pick posts nothing), plus
sync-auto-restore, sync-note-show, sync-own-fields, sync-not-backup,
sync-other-kind, sync-signins, sync-spin, i18n-keys, i18n-en-no-cjk,
gui-zh-tw, gui-ja, gui-de: all pass.
Broken by hand:
- push guard removed: TestFollowServerSendsNoSignIn red ("sent its
sign-in: 1 puts").
- follow branch off: TestFollowServer red ("b's own change stayed:
[deepseek=k1 kimi=kb2]").
- the row's click not posting: sync-follow-server red, 8 of 8.
Not tried: a real WebDAV, S3 or GitHub server (fake servers only); two
real computers; Windows run of the tests (vet only). The full suite starts
after the tag.
|
||
|
|
86825005e2 |
plugin: a gateway hook given more than 10s gets up to 30s (#5890)
gatewayTimeoutMs was capped at 10000 and the Go side cut every hook RPC at 11s, so a recall hook (Nowledge Mem) asking for 15s was cut at 1s (any value over 10000 fell back to the default) and could never finish. - host.js: gatewayTimeoutMs takes integers 100-30000; a value outside is clamped to the nearer bound, a non-integer gets the 1000 default. gatewayBudget() is the old chain budget (sum, clamped 2-10s) or the longest hook's own timeout, whichever is larger. With no hook over 10s nothing changes. - gateway.go mirrors both (gatewayTimeout, gatewayBudget, cached with the HasGateway scan). GatewayBegin's request RPC, Finish's completion RPC and GatewaySignIn now wait the budget plus 1s, never less than the old 11s; host startup and the lock wait stay bounded at 11s. Caller cancellation still reaches the hook at once, a failing hook still rolls back, and the request-state limits are unchanged. - Docs: gateway-request-hooks subsystem page, plugins docs (en, zh, ja). site/public/llms-full.txt regenerated with `node llms-full.mjs`; it was already stale on origin/main (OpenCode 2 keys, billion-context tab, data-folder move, vendor presets, group rule), so those docs pages' text lands in it too. Run on mote at this tree (base 03a800ac6; origin/main has one newer commit touching none of these files): - gofmt -l internal/plugin internal/gateway: clean - go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go vet ./...: rc 0 - go test -tags nogui -count=1 -timeout 45m ./internal/plugin/... ./internal/gateway/...: ok plugin 161.6s, ok gateway 897.0s - site: node --test worker.test.mjs: 38 pass (llms-full red before the regeneration) New tests (internal/plugin/gateway_budget_test.go): a 12s onRequest and onResponse with gatewayTimeoutMs 15000 both land (24.2s); the default and 10000 are still cut with outcome "timeout"; two 8000ms hooks still share 10s; 130000 is clamped, not dropped; cancelling a 15000ms hook's request stops its fetch at once (0.07s); the Go mirror matches host.js. Broken by hand, each red: - A host.js as on main: SlowRecall red at 1.10s, Clamps red - B Go RPC kept at 11s: SlowRecall red at 11.04s, Mirror red - C chain capped at 10s: SlowRecall red at 10.13s - D default per-hook 30000: DefaultStillCuts/default red - E caller signal off the begin chain: LongBudgetCallerCancellation red - F chain budget 30s for every config: ChainStillTenSeconds red Not tried: a real Nowledge Mem server; the full ./... suite; GUI tests (no GUI change); a Windows or Linux runtime run (vet only). Reported-by: aboat0625-cpu |