c51b0ca9fab9f1afc86d3098dfd1202ebbe673b3
382
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b325718f0a |
antigravity: turned-away lines go reworded, not broken up; Antigravity min 0.1.12 (#1118)
Since 11-14 Google's check reads past invisible characters. A system prompt with Claude Code's billing line and Agent SDK line, broken up with two U+200B in every word as the cloak sent them, was turned away 5 of 5 with the bare 429 "Resource has been exhausted". Claude Desktop's Code tab through magpie to Antigravity failed every turn (hc295971796 on X, tweet 2121429628019781849), and on v0.1.4110 with the Antigravity Cloak plugin Antigravity hit 429 very often (daoche_wuzui, tweet 2121432333769433178). The built-in cloak (codeassist.go) now rewords each line Google turns away, in plain words: - the x-anthropic-billing-header line is left out to its line's end; a system part or message holding only it is dropped; - "built on Anthropic's Claude Agent SDK" -> "built on the Claude Agent SDK by Anthropic"; - Codex's "based on GPT-5" -> "built on GPT-5"; - Hermes' "created by Nous Research" -> "built by Nous Research"; - omp's RFC "keywords" -> "key words". A copy an older magpie or middleware broke up (U+200B, U+2060, soft hyphen, inside or between words) is matched and reworded as the line. The Code tab's main line passes as written and is kept. The plugins repo's packages carry the same rewording (plugins 5bb41941: opencode-antigravity-auth 0.1.12, opencode-agy-cli-auth 0.1.41, middleware-antigravity-cloak 0.1.7 on the dist branch). The Antigravity mover's min goes to 0.1.12, the version dist has (these packages are not on npm); the cloak middleware is Official and updates itself. Run: - real Antigravity account, sandbox HOME, gemini-3.8-flash, 10 sequential requests each through the new plugin: Code tab main prompt as Claude Desktop sends it 10/10 200, Agent SDK subagent line 10/10, an old two-U+200B copy 10/10, Codex GPT-5 10/10, Hermes' earlier persona 10/10, omp's RFC line 10/10. The zero-width break went 0/5. - mote-run: gofmt -l; go vet, GOOS=linux go vet -tags nogui and GOOS=windows go vet of internal/gateway, provider, cli; go test -count=1 -timeout 45m ./internal/gateway/ ./internal/provider/ ./internal/cli/ ./internal/middleware/: all ok (gateway 926s); vet clean, gofmt clean. Broken by hand: codeassist.go from origin/main with these tests: 6 fail (TestAntigravityCloakClaudeCode2316, ...RewordsEveryLineItTurnsAway, ...AnswersHermesAndCodexByDefault, TestOnlyAntigravityIsSentThePrompt Reworded, ...LineWrappedOrWidened, ...TurnsCodexsGPT5ThreadAwayOnce). Not tried: models other than gemini-3.8-flash; the whole go test ./... (only the four packages this touches); Claude Desktop itself (its Code tab's system prompt was captured and replayed instead). |
||
|
|
4e770f733a |
library: subagents imported from a repository
CHENGJIAHEGOXIS on X asked for an easy way to install a repository of
subagents such as msitarzewski/agency-agents. Library → Subagents now
has a find line. It takes what the skill installer takes: owner/repo, a
GitHub or GitLab link to a repository, folder or file, any git address,
or a folder on this computer. It lists the subagents found, lets the
user tick all or some, and imports them as Library subagents for the
agents ticked.
- Fetching is the skill importer's: resolvePluginRoot's source handling
moved into fetchSourceRoot, which both use. tooBig still refuses a
whole repository that is too big and asks for the folder's link.
- A subagent is a Markdown file whose front matter has a description.
- Its name is the slug of `name`. In an `agents` or `droids` folder
with no `name`, it is the file's own name.
- The description is folded to one line of at most 1000 characters.
- The body is the prompt.
- Dropped: every other front-matter key (agency-agents' color, emoji
and vibe, and tools, model, author or anything else). A Codex TOML
role is not read. A skill's folder (one with SKILL.md) and .git,
.github and node_modules are skipped.
- Two files with one name: the shallower is taken, and the other is
listed as left out, with why. So is a file Subagent.check refuses.
- An imported subagent records its source and file (From) and a hash
of its description and prompt as imported (FromHash). Imported again,
a subagent from the same file is:
- have, when it is unchanged;
- update, when upstream changed and the library's copy still matches
FromHash (description and prompt replaced; agents, skills, servers
and model kept);
- edited, when the user changed it in magpie (left as it is).
- A name the library already uses for another subagent is never written
over: the import takes the next free name-N.
- A carried library carries From.
- The page has Select all, a filter past eight, a tag per state, the
files left out, and a summary of what was imported and updated.
i18n: zh, zh-TW, ja, de.
- The fixture is agency-agents' own files in
internal/library/testdata/agency-agents. No test reaches the network.
Run on 80ae5ba24, which is this change on
|
||
|
|
5211fd3ba2 |
usage: a currency "By provider" shows each provider's costs in what it sells in
onkashiko on X: DeepSeek, Kimi (China), Zhipu and other domestic vendors
price in yuan, the rest in dollars, and one currency for every cost made
the Usage page read wrong for half of them.
Settings > Usage > Currency gains a third choice, By provider. With it,
a figure of one provider's calls (a model's, an account's, a key's row,
a request, a routing try, a quota card's whole) shows in the currency
that provider sells in, and every sum across providers (the total,
agents, sessions, charts, the tray, Bark's daily, the day page) in the
currency a "Totals in" row picks, a row shown only while By provider is
chosen. GUI, TUI and CLI agree. Costs stay stored in dollars; only the
display converts, at the live rate (internal/fx).
Which providers sell in yuan (provider.PricesInYuan): a .cn host; a
preset at its own site that is a yuan preset (deepseek, zhipu,
volcengine, tencent-cloud, bailian, siliconflow…), ends in -cn, or is in
its China region; a plugin id ending in -cn; a provider of one's own
with a yuan models.dev catalog served at that catalog's site. A relay
made from DeepSeek's preset, Z.ai, Kimi's and MiniMax's international
endpoints stay in dollars: they share a catalog with their Chinese
twins, so the catalog alone can't tell.
Known limit: models.dev has only dollar prices (converted from the
vendors' yuan at ~6.7-7.0), so a yuan figure is that dollar price at
today's rate and can differ a few percent from the vendor's own list.
A second ask from onkashiko: set the currency of the menu bar and of
the totals apart, sums converted by themselves.
So Settings > Usage also gains an Advanced fold (closed by default, open while
set) with one row, Menu bar currency: Same as totals (the default), $ or
¥ (settings.TrayCurrency, TrayCostIn). It sets the menu bar's totals
cards and the tray tooltip's cost; the Usage page, the panel, the TUI,
the CLI and Bark's daily message stay in the totals' currency
(totalsCurrency). Like the other menu bar settings it stays on this
computer (KeepOwn). Every sum is still made in dollars and converted
once, at the live rate, so a mixed-currency total is never added up
from yuan and dollars.
Settings' currency rows (Currency, Totals in, Menu bar currency and the
rate in the tooltip) moved out of app.js into currencyprefs.js, imported
when Settings draws its usage prefs, and costInYuan is packed: the core
is 3 bytes under coreScriptBudget, with no raise.
Run:
- go test -count=1 at this tree on mote: internal/settings,
settingsapi, tui, cli, catalog, provider, fx and gui all ok
(TestCoreScriptBudget included). The full go test ./... and the whole
GUI suite are queued behind other sessions' suites on suite.lock
(mote and mica, load 35 and 60) and had not started at push.
- GUI files at this tree (mica): currency-provider, currency, i18n-keys,
i18n-en-no-cjk, tray-cost, tray-totals, every settings-*, old-webkit:
362 pass, 28 red. Every red is red the same at origin/main
|
||
|
|
533f351085 |
library: billion-context.json syncs, its settings change from its tab, running bilis reload
@Luxzinw on X asked for three things: sync billion-context's config, edit its settings in the Library's billion-context tab, and have running bili proxies reload after a change. Sync. billion-context.json goes in the library part (library.Bundle.Bili), by sync and backup file alike. magpie finds it the way bili's src/paths.ts does: BILI_CONFIG_FILE, else $XDG_CONFIG_HOME (or ~/.config, %USERPROFILE%\.config on Windows), then billion-context/billion-context.json. - The text is carried as written, comments kept. - magpie's summary recipe is carried at the canonical gateway address and localized to this computer's gateway when written, so two computers on different ports don't trade it back and forth. - A newer local file is never blindly overwritten. Before a carried file replaces a different one here, this computer's copy is kept with the backups. - An unreadable file, or one over 1 MiB, counts as unknown and is never carried as empty. A bundle without the file leaves this computer's alone. - A file naming a DSN is left out of keyless backups. - The credential store (<config>.summary-credentials.json) never travels. - A library with no such file hashes as before. - The new sync preview names the file when it would be added, changed or removed. Settings. GET/POST /api/library/bili/settings, and a Settings section under the agents in the tab: - In front: "Summarize with a fast model" (externalSummary), picked from the app's menu, never a <select>. It offers magpie's served models and the file's own recipes. "Fold only when nudged" (requireNudge) and "Nudge every N tokens" (nudgeGrowthTokens). - Under Advanced, collapsed: the compression philosophy (prompts.compressPhilosophy with acknowledgePromptsRisk, which bili needs before it reads a prompt override). Writes go through edit.PatchJSON and temp+rename, so unknown keys, comments and the BOM are kept. bili disables its whole compress section on one bad value, so magpie writes only values bili accepts. A magpie model becomes a providers.magpie recipe whose key is saved in bili's own credential store, the way bili writes it (0600, O_EXCL .lock, temp+rename). A user's own providers.magpie is never taken over. A file bili can't read is said so and left alone. Reload. After a change, and after sync writes the file, every running bili on loopback is sent POST /__bili/config/reload. bili reloads routes and compress there. The status line says whether it did, or that the agent needs a restart. Also: agentenv.Vars clears BILI_CONFIG_FILE in sandboxes, and the settings-parity list names the two routes for stage 3, as the other bili routes are. Run (mica, macOS): - At abcbc632e, this change on origin/main |
||
|
|
58ea9cade8 |
daemon: a launch agent written as Background is mended to Standard (#2961)
The commit before writes ProcessType Standard for new installs. Every
agent already installed kept Background until the user ran `magpie
daemon install` again, which no one is told to do. Now `magpie serve`
rewrites that one line of the installed launch agent as it starts
(daemon.Mend), leaving the rest of the user's install as it is, and
says so in the log. launchd reads the file when it loads the agent, not on
a kickstart: so it is taken up at the next login, or at `magpie daemon
restart`, which now takes the agent out and loads it again instead of
`kickstart -k` (and `start` does the same when it mends the file).
This is the same class as #6261: the gateway's process held to
background priority by macOS while agents wait on it.
Run:
- TestLaunchdOldAgentMended: an installed agent rewritten to the old
Background line is mended byte for byte to what Install writes, 0600,
with no launchctl call from Mend; Restart boots it out before loading
it; on Linux nothing is touched. TestLaunchdInstall's restart now
expects bootout, then load. Broken by hand (mended never mends):
red at "Mend: the plist is" and "want a bootout first".
- TestLaunchdInstall (plutil -lint on darwin), the whole daemon package,
vet on darwin, linux, windows: ok; and the package run named in 6261's commit: all ok (gateway 908s, plugin 159s, cli 52s) at base 7eecbcc56; at the pushed head (rebased on
|
||
|
|
459d668b35 |
sync: pick what syncs, preview a sync, undo the last one (#6428)
jinpwng (#6428, on X) syncs two computers and wants only Library and memory to go between them: each keeps its own providers, settings and models. They also want to see what a sync would change before it applies, and to roll the last one back. What syncs: providers, settings and profiles now have switches like agents' models, library and memory (Config.Providers/Settings/Profiles, *bool, nil = synced as before, so an existing setup syncs exactly what it did). The sync form shows Providers (and its API keys), Settings and Agents' models up front; Profiles, usage and sign-ins sit under Advanced, closed unless one is set away from its default. The form sends a part's choice only when it is or was off. A part left out stays as it is here and on the server; turning it back on joins it like a first sync (st.Off, rejoin). The sync's line says which parts each computer keeps ("Stays as it is on each computer: ..."). The setup text and the CLI carry it: magpie <webdav|s3|github> set providers=no settings=no profiles=no. Preview: davsync.Preview (plan.go) says, per part, what syncing now would bring in, send up, or leave; library items and memory files by name, sign-ins and plugins gone. Preview... in Settings > Sync shows it, and Sync now from there runs SyncPreviewed(token): if the server or this computer changed since, it says so and shows the new plan instead of syncing something else. CLI: magpie <kind> preview. Undo: a sync that brings parts in records them (st.Applied) and keeps a sealed copy of this computer first (keepSealed, as Restore does). Undo the last sync puts those parts back from that copy, on this computer only (st.Local, so the next sync sends it up rather than fetching the server's again). If one of them changed here since, it asks first (409 changed, Undo anyway). CLI: magpie <kind> undo-sync [anyway]. Restore's own Undo is unchanged. docs/subsystems/sync-backup.md and the site's sync docs (en, zh, ja) have a section on it. i18n: zh, zh-TW, ja, de. Run (worktree at base |
||
|
|
6fc8fdae41 |
cli: the Usage page's switched-off check-ins route is named (wxkwxk666 on X)
|
||
|
|
0fda3a1c12 |
cli: provider set resolve.<host>=…, the editor's Connect to from the CLI (quantum_lsfc on X)
v0.1.4012 added Advanced › Connect to (Provider.Resolve) in the GUI
only; the reporter asked for it from the CLI. `magpie provider set <id>
resolve.<host>=<IP or dns:name>[,…]` sets a host's connect addresses,
an empty value takes the host out, and `resolve=` clears them all (any
other resolve= value is refused, never saved). provider.Save checks
them as the GUI's do (netproxy.CheckResolve, TakesResolve), so a bad
place or a vendor's own host is refused with nothing written. `magpie
provider <id>` lists them as "connect". Usage and docs/reference.md say
how.
Run on mote: go test -count=1 ./internal/cli ok (166s);
TestProviderSetResolve ok; go vet ./internal/cli for darwin, linux
(-tags nogui) and windows ok; gofmt -l clean. A nogui build in a
sandbox HOME on mote: provider add + set resolve.api.corp.example=
10.0.0.5,dns:gw.corp.example saved and shown as connect; resolve=oops
and a bad place refused; resolve= cleared it; provider set --help
printed usage.
Broken by hand: not deleting the host on an empty value, and taking a
non-empty resolve=, each turn TestProviderSetResolve red.
Rebased on origin/main
|
||
|
|
a95a7a1cd8 |
providers: each API key can bill at a price rate of its own (tnt12231 on X)
A relay sells keys in groups that bill at different rates against the
official price (0.5x on one, 1.2x on another) under one endpoint, and
magpie had only the provider's price rate. Now a key can have its own:
- provider.KeyPriceRates, keyed by key id like KeySpendCaps: cloned,
normalized on save, carried when a key is replaced. A key without one
bills at the provider's PriceRate. A price the user set for a model
stands as set, as it does under the provider's rate.
- Usage prices each call at its key's rate (usage.Pricer memoizes per
key id, BaseKeyPriceIn), so the Usage page, a key's spend cap and its
typed balance follow it. PriceAt, used to route by price, takes the
rate of the key the provider holds.
- GUI: the provider editor's Advanced has "Price rate per key" under
Price rate, shown only with two or more keys, folded past 8 keys like
the per-key proxies. An empty line shows the provider's rate as its
placeholder. Save sends keyPriceRates ({} clears, left out keeps).
The lines, the check and the placeholder live in keyrates.js,
imported when a provider with two or more keys opens. The core's
budget goes up 397 for what is left in app.js (the import, the
draft's copy, Advanced opening for it, the save's line, proxyLines
drawing another kind of line); app.js stays under its own.
- CLI: magpie provider key-rate <id> [key [rate|default]].
- docs/subsystems/providers-accounts.md: a Key price rates row.
Run, at this head (rebased on
|
||
|
|
51b98b1a85 |
model efforts: a relay listing no levels says where magpie's come from, and a set that changes nothing says so
@czhhcz on X (magpie 0.1.4016, Claude Code, a third-party relay): the relay's /v1/models gives a Claude model `reasoning_levels: []`, yet `magpie model efforts` lists five levels for it, and setting every level was "silently dropped"; only hand-editing modelEfforts worked. What happens: a custom relay that names no levels for a model gets the model's own levels from models.dev (borrowedEfforts), and the gateway fits requests to them, so Claude Code's max and xhigh already reach the relay as asked (TestRelayListingNoLevelsStillGetsTheAgentsEffort). A set of every level is the default, so nothing is saved, but the CLI printed "✓ … offers every level it has" as if it had changed something; the hand edit changed nothing either. An empty list stays "unknown", not "none": magpie writes [] itself for levels it doesn't know. - provider.KnownBorrowed(model) says when a model's levels are borrowed. - `magpie model efforts` prints, for such a model, that the provider's list names none and these are the model's own from models.dev, and that `off` sends no reasoning field. - ChangeModelEfforts / ChangeModelSpec report whether anything changed. A set that changes nothing prints "· nothing changed" with what it already offers, and no ✓. - Sibling: `magpie model spec --reasoning` printed "✓ saved" over the same no-op; it now says nothing changed. - GUI: its level chips show the current state, and ticking every level is the default, so nothing is sent; no silent-drop path, unchanged. Run on mote: go test ./internal/cli ./internal/provider (whole packages); go test ./internal/gateway -run 'Effort|Reasoning|Relay|Adaptive|Spec'; go vet, GOOS=linux -tags nogui and GOOS=windows go vet of the three packages; gofmt -l. New tests: TestModelEffortsOfARelayThatListsNone (a httptest relay with reasoning_levels: [] in a sandbox HOME) and TestRelayListingNoLevelsStillGetsTheAgentsEffort. Broken by hand, each red: the no-change check skipped (✓ printed again), the borrowed line left out of the listing, and spec's "saved" forced. Not tried: a real relay; the GUI suite (no GUI file changed). |
||
|
|
6bc0d1e203 |
claude-desktop: Claude Magpie's Code tab on a Claude Code folder of its own (#6459)
The Separate app (Claude Magpie.app, #5671) kept its own Desktop
userData, but its Code tab's bundled Claude Code still read and wrote
the user's ~/.claude: their CLAUDE.md, skills, plugins and history went
into the twin, and the twin's sessions into theirs (xMopf7RF on X).
An opt-in, macOS-only switch under the Separate app's Advanced fold
(settings.DesktopIsolatedClaude, POST /api/settings/desktop-isolated-
claude, `magpie claude-desktop launcher claude-dir on|off`) gives it
~/.claude-magpie-desktop:
- desktopiso.Script exports CLAUDE_CONFIG_DIR in the app's launch
script; turning the option on or off remakes the app, and the hint
says to quit and reopen Claude Magpie, since a running one keeps its
environment.
- desktopOn writes Desktop's model windows, caps and explore entries
into that folder's settings.json instead of ~/.claude's while it is on
(desktopCodeDir, desktopClaudeSync); off moves them back. The folder
is kept when it is turned off, and shows as the claude# row "Claude
Code · Claude Magpie".
- The fold is drawn by claudemagpie.js, imported the first time it
shows; what stays in app.js is the import (isoLazy) and the fold's
place, 216 bytes, so the core budget goes up by 180 (the 36 of room
there was taken first).
Run:
- gofmt -l clean; go vet ./internal/... on darwin, GOOS=windows and
GOOS=linux -tags nogui vet of agent, cli, desktopiso, gui, settings,
settingsapi (mote).
- go test agent, cli, desktopiso, desktopdir, settings, settingsapi,
gui, library on mote: all ok except cli's three healthcheck/update
tests, which ask the gateway mote's own magpie serves on :3425
(#6223, the same with or without this change).
- TestCoreScriptBudget and TestSettingsSaveKeepsWhatItDoesNotSend at
this commit and the next.
- GUI on mote, Chromium and WebKit: desktop-isolated-claude (five
languages, 1100 and 640px), desktop-isolated, i18n-keys,
i18n-en-no-cjk, old-webkit, and every agent*/desktop*/claude* file
(98 files, 1,595 of 1,662 pass). Every red is the same on origin/main
|
||
|
|
a65dade2e3 |
gui: an accent colour of your own and a picture behind the pages (CHENGJIAHEGOXIS on X)
CHENGJIAHEGOXIS asked for colours beyond the three themes and for a local picture. Settings › General gains two rows under Appearance: - Accent color: magpie's own, six quiet presets (Blue, Teal, Green, Orange, Pink, Graphite) and a swatch that opens the system's colour picker. Saved as settings.accent (#rrggbb only, checked in saveOwn; `magpie settings set accent "#0d9488"` works through settingsapi.Keys). The server draws it (appearance.go accentVars): darkened on the light theme and lightened on the dark one until it reads as text at 4.5:1 on the background and cards, with white or near-black text on it, whichever reads better. Never under Omarchy, whose theme is the look. - Background image: Choose… takes a PNG, JPEG, GIF or WebP of 16 MB at most, sent as base64 JSON to POST /api/appearance/wallpaper, saved as `wallpaper` in magpie's folder (edit.WriteAtomic); settings.Wallpaper is its stamp. A thumbnail, Change and Remove show; Remove deletes the file. It is drawn behind the window's pages (never the tray panel) under a veil of the theme's background at 84%, so text reads as on the plain page; the cards stay opaque, and body's colour stays the theme's, which Windows' title bar tint reads. boot.js puts the look's stylesheet in before the first paint and says which look it drew (bootPrefs.look); applyPrefs asks /api/appearance/css only when the settings' look differs. The rows, with the Colorblind, Reduce motion and Loading bird rows, are drawn by appearance.js, imported when Settings draws, so the core scripts stay under their budgets with no raise (app.js 2,393 under, the core 503 under). A save of Settings that doesn't send accent keeps it (Merge guard), and the wallpaper stamp is kept by every Settings save. fonts.test.cjs: the two new rows push the font row to the foot of its 560×620 window, where Playwright's click scrolled it in by a pixel and the test read that as the page moving; the reader now scrolls it in first with the wheel. settings_keep_test sets Wallpaper; the three /api/appearance routes are named in the CLI parity test's notYet. Run (mote, at this change on origin/main 406ad72f1; after the rebase on |
||
|
|
741d502d2a |
library: a synced MCP server can run its own command on this computer (jinpwng on X, #6426)
jinpwng runs one MCP server on a Mac and in WSL. Each needs its own program path, and the only ways around it were two servers with two names or keeping the server to one computer, which loses the sync of its agents and note (#3836). A command server now has an optional `shared` start. When it is set, command, args and env are this computer's, and every reader (the agents' files, projects, the router, the check) runs them with no change of its own. Collect carries the shared start in their place and never the field, so the other computers get exactly what they had. Put keeps this computer's start, and what comes in for the server becomes the shared start, so a note, agents or the other computer's own command change still comes in. A server that comes in as a URL, one kept to this computer, and the editor sending no shared start each end it. - GUI: a saved synced command server's editor has "Use another command on this computer" under Command. With it on, the hint names what the other computers run, and "Use the synced command" goes back. Nothing else on the page moves; a new server and a local one have no button. - CLI: `magpie library mcp here <name> <command args…>` and `… here <name> off`; the listing names a server that has one. - TUI: an edit keeps the shared start. - Docs: docs/subsystems/library.md, site docs (en, zh, ja). Run (mote, at the tree pushed but before the rebase): - go test ./internal/library/... ./internal/cli/... ./internal/tui/... ./internal/backup/... ./internal/gui/: ok - gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: clean - GUI, chromium and webkit: mcp-server-here (new: en, zh, zh-TW, ja, de at 1100 and 390, the payload, no button on a local server, no sideways scroll), library-mcp-json, library-mcp-spaced-path, library-mcp-win-line, market-address, mcp-home-health, mcp-startup-timeout, market-have, mcp-editor-cancel, mcp-local-server, i18n-en-no-cjk, i18n-keys and the other library MCP files: 235 of 238. The reds: - i18n-keys "a plugin's words are its own": the same at origin/main |
||
|
|
04776ec6cb |
providers: a plugin subscription imports accounts from a file through its own auth.import, WorkBuddy's from 0.2.32 (marchen_cc on X)
marchen_cc on X: 「从文件导入账号」 took no WorkBuddy sign-in file. The cause
was not WorkBuddy's: magpie's import reached only built-ins (Codex,
Claude, Antigravity, Factory), and a plugin had no way to say it could
read a file. This adds that for every plugin subscription:
- A plugin's auth may have import(texts, {signal}), returning sign-in
results, with importFrom (and importFroms by language) saying which
file to choose. The host's importFiles op keeps each one as a sign-in
is kept (keptAs, saved under signInKey, settled), so an account
already there comes back "updated"; it is cancellable (signInSteps)
and takes at most 100.
- /api/signin/import and `magpie accounts import <plugin> <files>` go
to provider.ImportPluginFiles when PluginImportable(id); the editor's
「从文件导入账号…」 row and the import sheet show for such a plugin, in
its own words (importSay), moved subscriptions included (subOf).
- docs/subsystems/provider-plugins.md: "Accounts from a file".
- WorkBuddy's mover min goes to 0.2.32, which reads the desktop app's
.info sign-in or a JSON credential, and sends a cloud-hosted
enterprise account (*.sso.copilot.tencent.com, *.copilot.qq.com,
*.sso.codebuddy.cn, iOA apart) to its enterprise's address (emilochen
on X), published and checked with npm view --prefer-online.
- TestCoreScriptBudget +468 for the import branch, packed to one
statement. importSay is read as the Providers rows draw, so it has
no lazy page; nothing else was moved out (#2710). The budget's
arithmetic was checked over this tree: 1,267,762, at the new cap.
Run on mote (mica's disk is full; mote over its cores) at this change
on 3f6b1b0c9;
|
||
|
|
c2a1d80fc2 |
routing: In turn says each message you send goes round, and draws it (Wing8Aqua on X)
"Each turn of a conversation goes to the next one" read as every message
of a session moving to another account, when a reader expects a new
session to be the unit, and the line was long. What the gateway does
(affinity.go affine): under In turn with Stays on Auto or Within a turn,
each message the user sends ("new-turn") goes to the next account, round
the list; the agent's tool calls for that message stay ("turn"); a new
conversation goes to the one holding fewest. Session and Strict keep a
whole conversation on one, so In turn goes round per conversation; Off
moves every request. Routing is unchanged.
The words now name the unit and the cost: each message you send goes to
the next one, round the list; its tool calls stay; a move costs some
prompt cache; Stays on Session keeps a whole conversation on one. Same
in the provider editor, a group's editor, the Routing plugin's mode
line, the CLI's groups help and the docs (en, zh, ja; llms-full.txt
rebuilt), in en, zh, zh-TW, ja and de.
Under the words, while In turn is picked, a small figure: two
conversations of three messages, a pill naming the account (A, B, C)
each message went to and dots for its tool calls in that account's
shade, drawn as Stays has it now (Auto moves each message, Session one
account a conversation, Off every request). Theme tokens only (--fg-2,
--muted, --faint, --card-2, --line), no colour. The figure lives in
rotfig.js, imported when In turn is first shown; the core keeps a
one-line hook, and its budget goes up 333 for that and the words.
Run (mote, at this tree): rotate-figure.test.cjs, new, provider editor
and group editor, en zh zh-TW ja de, 900px light and 420px dark,
chromium and webkit, 40/40; stays-strict, routing-group-strategy,
routing-save, routing-advanced, rate-limited-sink, group-template,
group-editor-fits, group-editor-align, routing-affinity-order,
routing-affinity-lead, routing-affinity-cache-write,
routing-pool-tooltip, routing-rows-fit, routing-weight-chip,
group-patience, group-defaults, builtins, search-keys, i18n-keys,
i18n-en-no-cjk, text-size, routing-editor-foot, gateway-key-own-rotate,
routing-accounts-narrow all ok; site worker.test.mjs 41/41;
TestCoreScriptBudget ok; go test ./internal/cli ok; gofmt clean; go vet
./internal/cli ./internal/gui darwin, linux -tags nogui, windows ok.
Red, the same on origin/main
|
||
|
|
e39b9d5df7 |
cli: magpie tool reads an event-stream answer and names its folder (Norethcy on X, #6049, #6392)
`magpie tool memory_search --scope project --json` exited 1 with "isn't JSON-RPC: is it magpie? (invalid character 'e' ...)", and memory_save said the same after it had saved. The CLI sent no X-Magpie-Cwd, so the memory server asked it roots/list on the call's own event stream (it accepts text/event-stream), waited 3s for an answer that never came, and sent the result as a second SSE event; rpc() then read the whole stream as one JSON body. Now magpie tool sends the folder it runs in (X-Magpie-Cwd), as `magpie mcp memory` does, so --scope project is that folder's project and no roots are asked. rpc() also reads a text/event-stream answer: it takes the data event whose id is the call's, answers a server's roots/list with its folder and refuses any other ask at once, so no server's question breaks the CLI or makes it wait. Run (mote, -tags nogui): - TestToolMemoryThroughTheGateway (real gateway, sandbox HOME, a git repo as cwd): red on the old code with the reporter's exact error; green now, both calls under 2.5s. - TestToolReadsAnEventStreamAndAnswersTheServer: red on the old code. - go test ./internal/cli: ok. Broken by hand: without the header, the event-stream test is red (no folder named); with stream reading off, it is red with the reporter's error. Not tried: the reporter's macOS app build itself; Windows. |
||
|
|
c2fd48782b |
Put back what 1f05c311d took out of main by mistake
|
||
|
|
1f05c311d9 |
library: an open memory holds still while the Memory tab polls (Nietzsche_Li on X)
"资源库-记忆中,被展开的记忆的表单会定时抖动". While search by meaning
still has memories to read (read < of, which can last up to a minute
between memembed.Keep's reads) or a learn-from-conversations run goes,
the Memory tab reads its row again every 2s, and each read drew the
whole page anew. The open editor was a new .lib-detail each time and
played its content-in entrance (opacity .5, 2px slide) every 2s.
- semWatch/distWatch draw nothing when the read changed nothing, and
redraw only their own row (redrawRow) when it did; the whole tab only
when the memories changed.
- render() marks a .lib-detail open before it (same data-detail) as kept,
so it doesn't replay its entrance. This covers every render of an
open editor in the Library: memories, instruction sets and agents'
files (the siblings; no other Library tab polls into render()).
- A new memory's text no longer takes the focus back on every render.
Run (mote): library-memory-steady.test.cjs, all 5 languages, 980/420,
chromium + webkit: green 4 of 4 whole-file runs after the last change
(webkit alone 2 of 2 before it). Broken by hand: the same test against
origin/main's client.js and library.css: 22 of 22 red ("the editor
played its entrance again"). One webkit de 420 red was the test's own
first row click intercepted by the header at 420px while the page
settled; the test now opens rows with a DOM click.
Also run, both engines, every language, 980/420: library-memory, library-memory-select, library-memory-suggest, memory-icon, library-instr-busy, library-instr-sets, library-linked-set, library-follow-server: all green. No Go code changed, so no go test or vet.
Not tried: the real app on a real memory store mid-read.
|
||
|
|
70f4593e62 |
provider: a key's typed balance can refill each day (Kelen_Yc on X)
A key's balance typed by hand refilled each month or each week. A relay
key with a daily allowance had no way to say so. Now it can refill each
day, at local midnight, like the others:
- provider: Refill{Every: "day", Day: 0} (RefillDay). Last is today's
midnight in now's location, Next tomorrow's. check takes it with day 0
only; ParseRefill reads daily/day/d (daily:1 refused); String is
"daily". A magpie before this drops such a refill on read, as one
written by hand that isn't one, and counts from when it was typed.
- CLI: `magpie provider key-balance <id> <key> --refill daily`; usage
lines updated.
- GUI: the pill's menu has "Refills each day" after "Refills each
week…", posting {every: day, day: 0} at once (no day to pick, so no
ellipsis), with its toast; en, zh, zh-TW, ja, de.
- docs/subsystems/providers-accounts.md names it.
Tests: TestRefillDays gains daily rows (midday, exactly midnight, a
month's and a year's end, Asia/Shanghai). New
TestTypedBalanceRefillsDaily holds the clock in Pacific/Kiritimati
(UTC+14), Pacific/Pago_Pago (UTC-11) and UTC: a minute before local
midnight the spend counts from when it was typed, a minute after it
counts from local midnight and the next refill is the following one.
TestOwnBalanceParsedInYuanAndRefill and TestTypedBalanceRefills cover
parsing, the bad {day, 1}, and read-back; TestKeyBalanceCmd sets
--refill daily. key-own-balance.test.cjs picks Refills each day in
every language, both engines, 900 and 400px, checks the post and that
the menu then shows it picked.
Run on mica at
|
||
|
|
382c8c0bdf |
proc: magpie serve reaps the processes it adopts (Kling__Lab on X)
254 <defunct> children of `magpie serve` after 7 days, growing ~9 an hour (magpie, uv, node, npm, magpie-bun, code-review-graph), only a restart cleared them. Every command magpie starts is waited for (the AST guard TestEveryStartedCommandIsWaited holds, and I read each Start site and Output/StartTree/StartReaped by hand: none is missed). The zombies are the grandchildren: an agent CLI's MCP servers whose parent ended are adopted by magpie where it is PID 1 (a container) or a child subreaper, and nothing waits for a process it never started. proc.KeepReaping (Linux, from serve) does nothing unless magpie adopts (PID 1 or PR_GET_CHILD_SUBREAPER), and then reaps a child of its own that was a zombie at two looks 5s apart. Not tried: the reporter's container; the cause (PID 1 / subreaper) is inferred from the report, not seen. Run: TestAdoptedOrphansAreReaped (subreaper test process, 6 orphans) and the proc package through wsl-run on magpie-desktop: ok. Broken by hand (KeepReaping returning at once): 6 adopted zombies left, red. |
||
|
|
b552740c4b |
cli: name POST /api/settings/codex-client and codex-open as not yet a command
|
||
|
|
e18aca1038 |
agents: an agent's own context window, and a routing group's own Compact at (ul3140773077392, NovaStudiosss on X)
ul3140773077392 on X: dsh compacts earlier than other harnesses at the same
window, so one global size per model fits none. An agent's sheet (Agents,
the agent's Settings line) now holds "Context window": a size for every
model, or model=size pairs (provider/model, group/<id>, provider/*, a bare
model id, *). Empty follows each model's own window. It is applied in
provider.CatalogFor, the choke point every agent's model list goes through,
so dsh's contextWindow, Codex's catalog and Claude Code's window all read
it, and a window set this way makes Codex/Claude compact at that window
(Entry.WindowSet). Stored in settings.AgentContexts, kept by a general
save (settingsapi); POST /api/settings/agent-contexts and
`magpie model window <agent> [model=size...|off]`.
NovaStudiosss on X: Routing, a group's Edit, Advanced already had "Context"
(the window agents are told). It now has "Compact at" beside it
(Group.Compact; compactSet reads it before the members' smallest), also
`magpie group ... compact=`.
GUI: agentwindow.js, loaded on demand through agentcompact.js so app.js
stays inside its budget (TestCoreScriptBudget passes; the "Context window
in {agent}" label reuses the existing "Context window" key). Every agent
with fields now has a sheet; agent-prefs' Pi expectation says so.
Run at the pushed head, on mote: go vet (darwin; linux -tags nogui;
windows) on provider, agent, cli, gui, settings, settingsapi; gofmt clean;
go test provider, cli, settings, settingsapi, gui (TestCoreScriptBudget
and cli's route table fixed here), agent -run Dsh; node --test agent-window
and group-compact (chromium and webkit, en zh zh-TW ja de, 900 and 420px),
agent-compact, agent-prefs, compact-at. Reds seen identically on a
detached origin/main
|
||
|
|
55792628ac |
cli: magpie <agent> --help names the form that gives a tier its own model (KoiLx0 on X)
KoiLx0 could not find how to give Claude Code's opus tier a group of its
own. The CLI already does: `magpie claude opus <model>` (also sonnet,
haiku, fable; Claude Desktop the same; omp's roles as `magpie omp small
<model>`), and `<tier> default` puts it back on the main model. Only the
field list hinted at it, and a bare `magpie claude opus` sets the main
model. agentHelp now prints the form with the tiers or roles it takes.
Run (mote-run, sandbox HOME): a probe wired claude on group/opus, then
opus group/fast, sonnet b/gpt-5.5, haiku a/only-a wrote the three
ANTHROPIC_DEFAULT_*_MODEL lines; `opus nope/zzz` is refused ("not a model
magpie serves"); `--haiku x` is refused as an unknown flag. New
TestAgentHelpNamesTheTierForm, red with the help line switched off.
go test ./internal/cli ./internal/agent; vet darwin, linux nogui, windows.
Not tried: a real Claude Code session on the written tiers.
|
||
|
|
f97415bc0c |
gui: Report a problem's version line compiles on first use, and its route is named
|
||
|
|
05cadcafd4 |
sync: a provider can stay only on this device (treydtw on X)
Providers sync between computers (WebDAV, S3, GitHub), so a model served
from one machine's localhost reached the others, where it can't be
reached. A provider now has "Only on this device": sync neither sends it
out nor lets a copy from another computer replace or delete it.
Provider.ThisDevice is set from the provider row's right-click menu
(Only on this device, a check when on) or `magpie provider this-device
<id> yes|no`, over POST /api/provider/thisdevice. davsync's collect drops
those providers and their order entries (provider.SyncedOnly); Mirror
skips an incoming copy of one and keeps the local ones; Restore keeps a
local mark. A normal editor save keeps the mark. File backups still carry
the provider with its mark.
Default is off for every provider, localhost included. A 127.0.0.1
provider is also what another computer runs for its own copy of the same
local server, and default-on would remove those copies on their next
sync; a LAN address is reachable from the other computers. Turning it on
at one computer removes the synced copy at the others on their next sync.
docs/subsystems/sync-backup.md says so.
The menu item gives no toast: its check mark is the answer, which also
keeps the core script budget at +151 bytes (1,263,700 to
1,263,851).
Run, on mica: new davsync TestProviderOnThisDeviceStaysOnIt (two
computers over a fake DAV) and this-device.test.cjs (chromium and
webkit, en zh zh-TW ja de, widths 1100 and 420); provider-find updated
for the new menu entry; davsync, provider, backup, cli, gui Go packages
ok except TestCoreScriptBudget, then fixed; vet on darwin, windows and
linux nogui clean. Broken by hand: SyncedOnly made a no-op turns the
davsync test red ("a sends its own model out"), and the Mirror skip
removed turns it red ("b after a's model synced"). GUI files that fail
in a loaded run (claude-quota-onboarding, provider-find, skill-fold-all,
usage-agents-hide, usage-cards-hide, usage-hidden-way-back) were run
alone on origin/main
|
||
|
|
727e236378 |
gateway: a management API for providers, accounts and gateway keys, for a key set to manage (ljayic on X)
ljayic asked for a complete, stable management API so nothing needs a hand-edited file. /v1/magpie/admin/ now serves the app's own /api handlers (providers and their keys and accounts, OAuth sign-in start/poll/cancel, gateway keys, account groups) to a gateway key set with `magpie gateway-key admin <id> local|any`. Routes and actions not in gui/admin.go's adminRoutes are 404, so a provider's saved key, a gateway key's secret, sign-in export and actions on this computer's apps are not served; "admin-key" is not served either, so the API can't raise its own caller. Sign-in returns the vendor's page and code, opens nothing, takes no password. Guard (gateway/admin.go), in order: any Origin or Sec-Fetch-Site/-Mode is 403 with or without a key (Origin null, foreign, listed, *.localhost, an app scheme); no key 401; a key without Key.Admin 403; from loopback the Host must be ownHost (a rebound page's GET has no Origin); from the network the key must be "any"; a proxied request counts as remote. Key.Admin is dropped (adminOf) for a read-only, Browser, issued, expiring or default key, and setting read-only clears it. The route is in readOnlyRefused and keySlotFree. Docs: docs/reference.md "Management API", gateway-routing.md, and the remote page in en, zh and ja. Routing Groups, sign-in export and a GUI switch for the level are left to #6307. Run (mica, the worktree before the rebase onto 9 newer commits): go vet of access, cli, gateway, gui (darwin), GOOS=windows vet of the same four, GOOS=linux -tags nogui vet of access, cli, gateway; gofmt -l empty; go test -count=1 -timeout 45m ./internal/access ./internal/cli ./internal/gateway ./internal/gui: all ok but TestKeySlotEveryRoute, which named the new route and is fixed here, then it and the read-only, admin and guard tests pass again. After the rebase the same tests ran again. Broken by hand, each red in TestAdminAPIGuards: browser check off (a browser case served), Admin check off (a key without it served), Host check off (a rebound name served), the "any" requirement off (a local-only key from the network served, and a proxied request). Tests: TestAdminAPIGuards (no key, unknown key, non-admin, read-only, local/any, x-api-key, 8 browser headers x 3 callers, rebound Host, proxy, no handler), TestAdminKey (access: levels, read-only, Browser, issued), TestGatewayKeyCLIAdmin, TestAdminAPIGatewayKeys / Providers (a canary key is never told) / SignIn, TestAdminRoutesEveryAPIRoute. Not tried: a real sign-in against a vendor through the API, a request from a second computer on the LAN, the GUI suite (no page or app.js changed), a Linux/Windows run of the new tests. |
||
|
|
04e38e6045 |
gateway: a reorder moves only its own provider's conversations, and tests forget it (#6249, #6262)
|
||
|
|
b70563ec6b |
gateway: a reorder of the pool counts at a conversation's next turn (Richyisaflower on X)
Auto affinity kept a conversation on the account that answered it by its cache, so an account moved down (or another made First) still took the next turn. SetAccountOrder, the login switch and the CLI switch now call provider.NoteReordered; affine drops a stick last answered before it, in Auto and not within a turn (Session and Strict keep it). Run on mote: TestReorderedAccountsTakeTheConversationAtItsNextTurn red with the check off (k1 k1 k1), green with it; go test internal/provider, internal/cli ok; internal/gateway -run Affinity|Ordered|Stick|Reorder|Strict|Conversation|Fallback ok; go vet darwin, windows, linux nogui ok; gofmt clean. Not tried: a real Codex account; GUI tests (no GUI file touched beyond the switch handler); the full suite (started after the tag). The image-quota half of the report is not fixed: no real refusal body was available. |
||
|
|
698ed4adb5 |
gateway: a busy port names the program holding it, and Tailscale's serve gets its fix (pluoki on X)
The Gateway page, `magpie serve` and the app log said only "port N is held by another program". pluoki's was `tailscale serve` on the same port number. proc.PortHolder reads the holder (lsof on the Mac, /proc on Linux, Get-NetTCPConnection on Windows). Tailscale's daemon is root's and often unreadable, so `tailscale serve status --json` is the fallback for the port. gateway.NoteHeld / PortHeld.Sentence say who holds it, and for Tailscale give `tailscale serve --https=<other> http://127.0.0.1:<port>`. Shown in the `magpie serve` standby line and bind error, the app log, `gatewayHeld` in /api/state (Gateway page) and Start's "taken" answer, in en, zh, zh-TW, ja, de. A holder that can't be read says nothing; the old wording stands. Nothing is killed or touched. Run: gofmt clean; go vet darwin, linux nogui, windows (mica); go test ./internal/proc ok; targeted holder/gateway tests on macOS (mica), Windows (win-run) and Linux (wsl-run); parser tests with real lsof output; GUI gateway-port-holder, gateway-takeover, gateway-older, gateway-skew, gateway-port, i18n-keys, i18n-en-no-cjk in chromium and webkit. Real run on WSL: a holder named tailscaled on the LAN address with magpie on 0.0.0.0 gives the Tailscale sentence at the bind error; a Python holder on loopback gives "held by python3.12 (pid N)". Broken by hand: each fix reverted in turn, its test went red. gateway-card.test.cjs is red on origin/main too (#6029). internal/gateway, gui and cli package runs were still going at push; the full suite follows the tag. Not tried: a real `tailscale serve` (changes live config), a real Windows holder end to end, the bind-error path on macOS (a wildcard bind coexists with a specific one there). |
||
|
|
5a36e46d67 |
cli: name POST /api/library/mcp-account as not yet a command
|
||
|
|
a5e805f574 |
Codex: Ultrafast beside Fast in a group member, and a Fast/Ultrafast setting per model (kdajenks on X)
kdajenks (magpie 0.1.3739, Codex on ChatGPT Pro) could set Fast only from a
routing group's member row and had no Ultrafast there, and no way to set the
speed in the model's own settings. Ultrafast exists: Codex's catalog lists
the `ultrafast` service tier, the code already sent it for agent picks and
Codex's service-tier row, and the live account's service_tiers hold it.
- Group member: the button steps Standard speed, Fast, Ultrafast (where an
account offers it, `ultraOK`), back to Standard. `Group.Ultra` is a subset of
`Fast`, kept through rename, fold, share, gone-filter and the CLI
(`magpie group ... ultra=`). The gateway marks the candidate `ultra`.
- Per model: `settings.ModelTiers` ("<provider>/<model>" to priority or
ultrafast), `provider.SetModelTier` (refused where CanFast/CanUltra say no),
`ModelPref.Tier` in Model settings (Standard speed / Fast / Ultrafast, in
modellimits.js), and `magpie model tier <provider/model> [fast|ultrafast|usual]`.
The gateway sends it on a direct pick for an agent with no fast pick of its
own, through fastPick, so an account without Ultrafast gets priority. A group
member goes as the group says.
- Docs: gateway-routing, providers-accounts, reference.
Run (mica, at the rebased head over
|
||
|
|
319753d892 |
gateway: a key can follow, force on or force off masking (y0ngb1n on X)
A gateway key now carries Redact: "" follows the global setting, "on" masks that key's requests even when masking is off, "off" sends them as written. Trusted devices turn it off, external ones are forced on. - access: Key.Redact, CleanRedact and the redact-key action; an issued key inherits "on" from its issuer and can't turn it off; the default key takes the same values. - gateway: maskingFor(ctx) decides per request; every route that masked (chat, native, text hits, the Masked-As header) asks it. A local request with no key keeps the global setting. masking.WithForced carries "on" into the masker; the redact plugin's InUse counts keys set on. - CLI: magpie gateway keys redact <key> follow|on|off. - GUI: key-row badge and an app menu; 7 strings in zh, zh-TW, ja, de. - docs/subsystems/gateway-routing.md: the Redact paragraph. Note: "on" with global masking off masks secrets and personal data by the defaults. An off key is still masked on a Remote magpie hop, which sends no Masked-As header. Run (mote-run): go test for access, masking, redact, cli, gui and plugins/redact packages and the new gateway key_redact tests; gofmt -l and go vet on darwin, windows and linux nogui, all clean; the new GUI test. Broken by hand: maskingFor returning the global value goes red in key_redact_test.go. Not tried: a real remote-to-remote hop with two keys; the full suite runs after the tag. |
||
|
|
1c95c87c25 |
cli: POST /api/plugin-pages/arrange is named as the window's own (#6162)
|
||
|
|
ab5824aeea |
gateway keys: a limit in total never resets by the period, only by Reset usage (Cyrus_4433 on X)
The Limit window menu gains "in total" (period "total", CLI: gateway-key limit <id> total). It counts from when it is set or last reset and ends a century off (access.Limit.Window), so only Reset usage starts it again; its 429 says it stays refused until reset or raised, the row reads "$0.00 / $300 · 总额" with no reset time, and a remote key's window is "Tokens/Spend in total" with no reset. Old settings files read the same (new period only). i18n in zh, zh-TW, ja, de; reference.md and gateway-routing.md say it.
Run: TestLimitTotal and TestTotalLimitNeverResetsByThePeriod, red on the old code (Valid refuses "total"); gateway-key-total.test.cjs red without the keys.js change (5 of 5). Not tried: a real key through a live gateway; full suite follows after the tag.
Run (before this push):
- gofmt -l clean; go vet darwin, linux (nogui), windows clean.
- go test: internal/access, internal/budget, internal/cli, internal/provider ok.
- Go tests for the total period are red on the old code (Valid refuses "total"); the GUI test is 0 of 5 languages passing without the keys.js change.
- gateway-key-total.test.cjs and i18n-keys: 9 pass in chromium and in webkit (zh, zh-TW, ja, de, en; 500px width; no native select).
- Full GUI suite on mica, chromium: 46 reds in files this change does not touch (accounts, Pi/OpenCode Go, panel sheet, check-in, Aside provider, API key theme, allowed addresses); none is a key-limit test. Webkit pass still running; reds are to be compared with origin/main and filed after.
- TestCoreScriptBudget is red on origin/main
|
||
|
|
e3e774be7a |
agents: Claude Code's Co-Authored-By commit signature on or off from its settings (9_bishi on X)
Claude Code's row in Agents > Settings gets a "Commit signature" On/Off menu. Off writes Claude Code's own key attribution.commit = "" in settings.json; On takes out only what hid it (attribution.commit "" , attribution false, includeCoAuthoredBy false), so the default comes back. A custom attribution text is the user's own: the row shows "Your own text", is disabled, and is never written over. attribution.pr is untouched. Route POST /api/settings/claude-attribution, S2 in the settings parity test. Run at the rebased head (on |
||
|
|
967fefcec6 |
gateway: a key can be set to a service tier (JackyFill on X)
A gateway key now carries ServiceTier: follow the request (unset), standard, Fast (priority) or Ultrafast. keyTiered sets the Responses and Chat request's service_tier to it, over the client's ask and Codex's own setting; standard takes the tier off and Ultrafast on a bare model no account lists it on goes as priority. What is sent upstream stays the providers' own rule (fits, takesTier, fallback), so a vendor with no service tier is sent none; Anthropic-protocol requests are untouched. Set with the tier-key action, `magpie gateway-key tier <id> ...`, or the key row's badge (zh, zh-TW, ja, de strings). Run (wsl-run, Linux): TestGatewayKeyServiceTier, TestKeyTieredChat, TestKeyServiceTier, TestGatewayKeyTierCLI green; internal/gui -run Key|Tier|Caller|Access ok; gateway-key-tier and gateway-key-concurrency GUI files 40 of 40 in chromium and webkit (serial); go vet nogui for linux, windows and darwin; gofmt clean. Broken by hand: with the keyTiered call removed TestGatewayKeyServiceTier fails on 4 rows. A parallel run of all gateway-key and i18n GUI files had 8 unrelated timeouts that pass serially (load). The whole internal/cli package hit the default 10m timeout on this box; the key tests in it pass. Not tried: a real ChatGPT account, the Windows box, the full suite. |
||
|
|
8af7c27fff |
library: mcp add takes header=, env= and timeout= as settings, mcp set and mcp show (Abandon332 on X, #6111)
`magpie library mcp add` handed env=A=B and timeout=30 to the program as arguments (exit 0, written into the agent), and refused header= on a URL, so a token-bearing remote MCP needed a hand edit of library.json. SplitServerWords takes header=K=V (or K: V), env=K=V, timeout=SECS, agents= and --local out of the line; words after -- are the program's. A setting-looking word magpie doesn't know (headers=, envs=) is refused; header= on a command or env= on a URL is an error. New: mcp set <name> header=|header-=|env=|env-=|timeout= keeps the rest of the server, and mcp show <name> prints it as JSON. Header names match without case and keep the stored spelling. Run (wsl-run, -tags nogui): TestSplitServerWords, TestSetServerKeepsTheRest, TestLibraryMCPHeadersEnvTimeout, all of internal/cli and internal/library ok; GOOS=windows and darwin go vet of both packages; gofmt clean. The new CLI test fails on the old code by construction (env/timeout in Args). Not broken by hand separately. Not tried: win-run, the GUI (its save already sends headers; a stale open editor over a hand edit isn't addressed), the TUI line (still ServerOf), the other agents' encoders for timeout. Not run: full suite. |
||
|
|
4999cef657 |
cli, gui tests: context-cap's usage line lines up, and ContextCapAll is kept (#6103, #6104)
|
||
|
|
5c02be05b8 |
agent: agy moves onto the community agent-agy plugin
The built-in agy agent (Antigravity CLI) is the first built-in agent a community agent plugin serves, as the retired subscriptions moved onto provider plugins. While @magpie-community/agent-agy is installed and on, magpie's agy is the plugin's: the built-in leaves the list (here and in WSL), its id and aliases are the plugin's, and what the built-in wired is handed over. Turned off or removed, the built-in is back. Nothing is forced yet; the forced install and the built-in's retirement come once the plugin is on npm and a real run with it is on record. The plugin (plugins ebcff866, 0.2.0) follows the built-in since |
||
|
|
150646bd0d |
cli tests: context-cap-mode and the memory review routes are named
TestEveryRouteHasACommandOrIsNamed was red on main again: |
||
|
|
7a8346099c |
cli tests: Settings › Models' Quick check route is named in notYet, as proxy/check is
|
||
|
|
f5e1b10913 |
settings: longest context can hold a model's own window too (WJaunita45604 on X)
v0.1.3681's Longest context left a window the user set for a model, or "*"
on its provider, alone even when longer. Settings > Models > Routing now has
a menu beside the field: "Models without their own" (the default, as before)
or "Every model". In both modes the shorter of the cap and the user's own
window is told; they differ only when the user's own is longer (own keeps it,
every model brings it down). Settings.ContextCapAll, Settings.CappedOwn,
POST /api/settings/context-cap-mode {all}, magpie model context-cap all|own.
Applied in provider.windowIn (so /v1/models, catalogs, compaction), Codex's
CodexNativeWindow/CodexWindow (the list's ETag tag carries the mode) and the
gateway fallback window. i18n in zh, zh-TW, ja, de.
Run (wsl-run, mote's disk was full): provider (full), settings, settingsapi,
codexcat packages; cli -run ContextCap; gateway -run ContextCap|ModelsList;
GUI context-cap, i18n-keys, model-load, settings-places, settings-general in
chromium and webkit; TestCoreScriptBudget; gofmt; go vet nogui and
GOOS=windows vet. Broken by hand: windowIn's CappedOwn removed turns
TestContextCapAllHoldsTheUsersOwnWindowsToo red.
Not tried: the whole Go and GUI suites, a real Codex reading the list, macOS
or Windows runs, GUI in zh-TW/ja/de beyond the i18n-keys check.
|
||
|
|
4a7d222dc8 |
providers: an OpenCode Go key takes the usage cap an account does (@wanggenjidev on X)
Backend only; GUI follows. Tests: provider TestKeyTakesUsageCap, gateway TestKeyUsageCapPassesTheKeyOver (red with the hold removed by hand). |
||
|
|
1315ac7d99 |
update: the first update finds a magpie without gateway.json, and a restart waits a bounded time (ljlwlcz on X)
Two edges of v0.1.3687's gateway.json:
1. The first update from a magpie older than the record found no gateway.json,
asked 3425, said "isn't running" and left a service on MAGPIE_ADDR=0.0.0.0:10100
on the old version. With no record, no MAGPIE_ADDR and no answer at the usual
address, `magpie update` now tries the installed service's MAGPIE_ADDR (read
from its unit or launch agent, daemon.Addr), the port in Settings and 3425,
and takes the first that answers as magpie. --addr and MAGPIE_ADDR stay the
user's word.
2. A restart asked by `magpie update` waited on "N requests" with no end (Windows
hands nothing over, long streams never finish). The app and magpie serve now
wait at most 10 minutes for that ask, then restart; the output says so
("or in 10 min at the latest, which cuts what is still running"). `magpie
update --force` restarts at once (gateway.SetForceRestarter), and says if the
running magpie is too old to know --force. The app's own look at the disk
(followReplaced) and autonomous serve follow still never cut a request.
Run (mote refused SSH; win-run on xiaomi-gpu): go vet cli/gui/gateway/daemon
(windows), linux nogui vet; go test -run TestUpdate|TestServeFollow|
TestTerminalUpdate|TestRestart over cli, gui, gateway, daemon: ok except
TestUpdateThatWontStart, red on origin/main on the same box too (#6059).
Broken by hand: drain bound off, record fallback off, serve bound off: the new
tests TestTerminalUpdateWaitIsBoundedAndCanBeForced, TestUpdateFindsAMagpieThatWroteNoRecord,
TestServeFollowDrainIsBounded go red.
Not tried: a real systemd service upgrade; darwin cross vet (cgo) and the full
suite (started after the tag if mote is back).
|
||
|
|
dd3c9042c5 |
tests: the saved proxies' routes and settings are named in the guards
|
||
|
|
c1a0726369 |
tests: context-cap and the catalog's model list are named in the route and settings guards
|
||
|
|
5399c33728 |
healthcheck, update and status find the running gateway by its own record (ljlwlcz on X)
The gateway now writes gateway.json (addr, pid, role, version) in magpie's config folder while it serves; healthcheck, update, status and the other CLI clients read it when MAGPIE_ADDR is unset, trusting it only if the pid on GET / matches. --addr overrides. New: magpie status [--json] for watchdogs (role, pid, listen address). Run: new gateway and cli tests on Windows via win-run (pass); broken by hand (record disabled): they go red; gofmt; vet windows and linux nogui. Not run: mote/Linux (SSH down, WSL broken), darwin vet, a real systemd service. TestEveryRouteHasACommandOrIsNamed is red on the base for two GUI routes, unrelated to this change. |
||
|
|
7476328901 |
settings: one longest context for every model (WJaunita45604 on X)
Settings > Models > Routing has a Longest context field (magpie model context-cap [<size>|off], POST /api/settings/context-cap). It lowers every model's window to it, so a user need not set each model. A window the user set on a model, or on its provider with "*", wins and is not capped; a model whose window is unknown stays unknown. It is applied where the window is derived, provider.windowIn, so /v1/models, every agent's catalog, group windows and the compaction thresholds that follow the window all agree. Codex's own models take it through CodexNativeWindow, CodexWindow and codexcat.Cap on the list the gateway serves; the list's ETag carries the cap so Codex asks again. The provider editor's Listed value stays the vendor's. Run (mote): provider, codexcat, cli, settings, settingsapi, gateway tests; GUI context-cap, model-load, settings-places, i18n-keys, settings-general in chromium and webkit (en, zh); TestCoreScriptBudget; gofmt; vet on darwin, linux nogui and windows. Broken by hand: windowIn without the cap turns TestContextCapHoldsEveryModelButTheOnesTheUserSet and TestModelsListContextCap red. Not tried: the whole GUI suite (one row added to an existing list, no new API read on page load), a real Codex reading the capped list, Windows run. Not covered: Claude Code's own [1m] choice (claudeRunName) and agent/claude.go's fallback when a ref has no window. |
||
|
|
0cc91af3db |
agy: magpie's models go in a settings file of its own, so agy's remote control works (baysonfox on X)
magpie wrote modelProvider gemini, the model and its custom models into agy's settings.json. That made every agy an API-key session: no Google account, so no remote control (needs the sign-in plus Google's server-side flag), and a plain agy asked for GEMINI_API_KEY too. Now they go in ~/.gemini/antigravity-cli/magpie-settings.json, handed to agy as --settings for the one session (the launch command, magpie agy run, and the function in a shell or a WSL distro). settings.json stays the user's. An older wiring is given back (stashed model and provider) at the next Sync or pick. agy remote-control and --remote-control run plain, on the sign-in. Run (mote): go vet, GOOS=windows and linux nogui vet, agent/cli/sessions/update packages (see push note). Real agy 1.5.3 in a sandbox HOME: plain agy with the user's untouched settings.json now asks for sign-in (no GEMINI_API_KEY error); the new launch reached a stub gateway at /v1beta/models/<m>:streamGenerateContent. Broken by hand: remote-control bypass removed, TestAgyRun red; TestAgy red on the old code (settings.json written). Not tried: real remote control (needs a Google sign-in, none in the sandbox); signed-in BYOM custom models; Windows PowerShell function run. |
||
|
|
4d9b798d50 |
web: a LazyCat box's administrators open the page with the box's sign-in (MAGPIE_WEB_SIGN_IN=lazycat) (#5987)
magpie in a LazyCat app (懒猫微服) is opened from the box's app list by someone signed in to the box already, and asks for a key they never saw: it is in the container's log. A package can only hand the key to every browser that reaches the app, or put a proxy in front that adds the key's cookie to what the box signed in. The box's ingress, lzc-ingress, sends a browser that isn't signed in to the box's login page, and puts on every request it passes the app the box account (X-HC-User-ID), its role (X-HC-User-Role, ADMIN or NORMAL) and what sent it (X-HC-Source, client for a browser), in place of what the caller sent. With MAGPIE_WEB_SIGN_IN=lazycat webGuard takes that sign-in besides the key: lazyCatSignIn lets in an ADMIN account sent by a browser, each of the three named once, and tells anyone else the box's reason. The box's sign-in is a cookie of the box's, and the box's apps are one site, so a browser sends it with another app's page's requests too: an earlier build of this change let another app's page on the box include /boot.js and read window.bootPrefs. So it is taken only for what the page itself or the user asked for (boxFetched, the Fetch Metadata: Sec-Fetch-Site same-origin or none, or a GET or HEAD navigation to a document from another page), never for another page's script, frame, fetch or form POST, nor from a browser that sends no Fetch Metadata. It sets no cookie of the page's own, so signing out of the box signs out of the page. The key's link and cookie work as before, /api still answers the page alone (webOwnPage), and the gateway's client routes on the page's port go to the gateway first (onePort), which asks for a gateway key. StartWeb refuses another value, and lazycat where LAZYCAT_APP_DOMAIN, which LazyCat sets in an app's containers, isn't set: all magpie can check, so the setting is the package's word that the box's ingress is the only way to the page's port. magpie web prints the box's address beside the link. Docs: reference.md's new LazyCat section, with a manifest and what must never reach the page's port, and gui-shell.md's Browser mode row. On a box (lzcos 1.6.2+fix.4), a probe app that echoes its request headers: a signed-in browser's request carries X-HC-User-ID, X-HC-User-Role ADMIN and X-HC-Source client, forged ones replaced; not signed in, / goes to the login page and a public path gets none of the three (forged ones taken off, repeated or in lower case too), while X-HC-User-Groups passes on as the caller wrote it, so it is never read; a TCP ingress passes every header as sent. Another app's container reaches the app through the ingress alone (straight to the app's container it times out); the box itself, and a container in its network (network_mode: host, which a manifest may set), reach the port. A test app made from the docs' manifest, running a build of this change on |