4794de398ea8337d223a91e207181c56fcf4ad76
47
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
eba7187368 |
gateway, provider, cli, gui: a group can route By weight, each member's share set beside it (#1910, DD on Discord)
DD asked for weighted round robin as a group routing, next to In turn.
A provider's keys could already route by weight (#841). Groups could not.
What changes:
- provider: Group.Weights maps a member's spelling to its weight, 1 to
1000. A member left out, or set to 0, weighs 1. SaveGroup accepts
routing "weight". It also cleans weights the way it cleans fast and
off: it strips :fast, drops weights of members that are gone and of
members weighing 1, and refuses a weight below 0 or above 1000.
Weights follow a member when it is renamed (RenameMember, Rename,
RenameGroup) and survive Share/Import.
- gateway: planLevel treats each member of a weight-routed group as one
unit: a model with its keys in its provider's order, or a nested group
routed its own way. weightedUnits orders the units by smooth WRR on a
round per group ("group/<id>"), sharing wrrPick with the keys. The
round's pick goes first and the rest stay in member order for
failover. A unit whose head is resting leaves the round. When a
conversation is kept on another member (session/turn/cache/strict),
the charge moves to that member (wrrSeat, wrrMove).
- cli: routing=weight (also weighted, wrr). weight=<model>=<n>[,...]
sets weights and keeps the rest; weight= on its own clears them. The
group view shows "· weight N" for each member.
- tui: By weight is in the group routing list.
- gui: the group editor offers By weight. Each member then shows
"Weight N · S%", its share among the members that are on. Clicking it
edits the number in place: Enter or blur keeps it, Escape cancels,
and a value outside 1 to 1000 shows a warning. The trace header uses
group wording for a weight-routed group. Strings are added in zh,
zh-TW, ja and de.
- docs: reference.md, gateway-routing.md, and site start pages in en,
zh and ja.
Run:
- go test -tags nogui ./internal/provider ./internal/cli ./internal/tui:
ok.
- ./internal/gateway: ok in 988s with -timeout 45m. The first run hit
the default 10m timeout at load average ~170. The test running at
that moment had been running for 2s; it was not a hang.
- go vet -tags nogui on those packages, for darwin, GOOS=linux and
GOOS=windows: clean. gofmt -l: clean.
- New group-member-weight.test.cjs: 8/8 in Chromium and WebKit, en and
zh at 1100, en and de at 420. The WebKit de 420 case also passed six
runs at once.
- gui-zh-tw, gui-ja, gui-de, i18n-keys, routing-*, group-*,
panel-routing*, settings-groups and agent-model-groups: all green
except two.
- routing-steady (WebKit) is #1804. It is red 2/3 alone on origin/main
|
||
|
|
e528aeb3ce |
agent: DevEco Code, Huawei's OpenCode, as an agent (#1885)
foobra asked for DevEco Code (npm @deveco/deveco-code), Huawei's
HarmonyOS coding agent. It is OpenCode underneath, so it joins through
openCodeLike as MiMo Code did (
|
||
|
|
908c910931 |
gateway, gui: Stays: Strict keeps a conversation on the account or key that answered it, even past its cap, and passes its error on rather than moving it (#1797)
miniers asked that a conversation never move to another account: a
move changes the account a vendor sees mid-conversation and loses its
prompt cache. Session affinity keeps the account while it can answer,
then moves on.
The new affinity mode "strict" (Stays: Strict) does what session does
for a new conversation. Once one has an account, strictKeep asks that
account alone (its other models too) and no other account, key or
provider:
- one resting or spent is still asked, and its error (429, 402, 5xx)
goes to the agent rather than to the next candidate;
- one over a user cap is asked past it (plan's capped candidates,
capHeldOnly);
- one held for credits answers 429 naming Stays: Strict rather than
moving;
- one removed, turned off, barred or not allowed for the key counts as
gone, and the conversation is routed as usual.
A last try that fails verification is not rested for a strict
conversation that had nowhere else to go.
Set in the provider editor and the Routing page's pool row (GUI, all
five languages), `magpie groups ... stays=strict` (strict-session,
never-move), and the TUI ("stays strictly"). Documented in
gateway-routing.md, reference.md and the site's start pages (en, zh,
ja).
Run:
- go test -tags nogui ./internal/gateway (-timeout 30m under load ~150),
./internal/provider ./internal/tui ./internal/cli: ok. The three
TestStrictAffinity* tests fail on the code before this commit (200
where 429 was expected, acct-2 answering).
- GUI: stays-strict.test.cjs, chromium and webkit, 900 and 560px, en,
zh, zh-TW, ja, de: 30 of 30. On the assets before this commit it
fails 15 of 15 in chromium. routing-*.test.cjs pass but for
routing-steady's webkit 1.69px shift, which fails on the old assets
too: filed as #1804.
- gofmt -l, go vet (darwin, linux, windows), full go test ./... before
the push.
Not tried: a real agent conversation held on a real rate-limited
account.
Known and left: planLevel doesn't merge a nested group's sub.held, as
before this commit.
|
||
|
|
bfaedf1830 |
gui, profile: the profile in use is ticked and named on the panel's Profiles button, not a count read as its name (superhtoooth on X)
superhtoooth (macOS): 保存方案设置了方案名字,但是应用方案没有用这个名字。
menu 里面变成了方案 1,方案 2。而且在应用里面没有显示当前使用的方案.
The bug: the tray panel's Profiles button showed the number of saved
profiles next to its label ("方案" + "2"), which reads as a profile
named 方案 2. Profiles were saved and applied under the typed name all
along; nothing anywhere said which profile was in use.
What changed:
- profile.InUse: a profile is in use while applying it would change
nothing on this computer - every detected agent's saved field is as
the profile has it (compared with the same renamed-ref spelling Apply
writes), its model lists are held (provider.ModelListsHeld, a dry run
of SetModelLists via the extracted putModelLists) and its library
setup is as saved (library.Holds, the mirror of Restore). A profile
that touches no agent here is not in use.
- Why not "last applied": that would stay ticked after the user changes
a model by hand, a tick that lies. With this definition a profile
saved from the current setup is in use at once, a hand change clears
the tick, and applying puts it back. Two identical profiles are both
ticked; the button names the first.
- GUI: /api/state carries inUse. The panel's button names the profile
in use (a pop-up button showing what is picked), else counts them as
before; its chip gets a check mark and aria-current, in panel and
window; the chip's tooltip and its details say "In use" (string
already in every language). CLI `magpie profiles` marks it, the TUI
notes "in use". Docs (reference, start en/zh/ja) say so.
What was run:
- go test ./internal/profile (new TestProfileInUse: save, hand change,
apply, hidden model list, library instructions, absent agents) and
./internal/gui (new TestStateProfileInUse through the HTTP handler),
scratch HOME. Broken by hand: field compare, ModelListsHeld,
library.Holds and state's InUse each turned a test red.
- go test -tags nogui ./... in a scratch HOME (the four slow packages
rerun with -timeout 40m under load ~45).
- GUI: new profile-in-use.test.cjs (reporter's steps in the panel at
360px, every language, plus the window) and panel-profiles,
profile-confirm, profile-details, old-webkit, i18n-keys, gui-zh-tw,
gui-ja, gui-de in chromium and webkit: all pass. Old app.js fails the
new test.
- Real CLI in a sandbox HOME with a codex config: save/use/profiles
show the mark, and it goes after a hand edit.
- gofmt; go vet darwin, linux (nogui), windows.
Not tried: the real tray app with real agents, and Windows/Linux at
runtime.
|
||
|
|
0fcf563e61 |
routing: a pause rule can hold by folder, in some or outside them (#1606, Ti800)
Ti800 keeps a subscription's quota for one long task in one folder and wants every other request kept off it (their option A). A pause rule held by hours, days and agents only; it now holds by folder too. What changed - provider.Rule gains ExceptFolders (json exceptFolders, CLI except-folders=, aliases except-folder/not-in/outside): the folder the agent works in is in none of them. An agent that says no folder isn't known to be in one, so except-folders holds for it; folders= still never matches an unknown folder. Both conditions are allowed on send-to and pause rules (Rule.ByFolder, inFolders); cleanRules cleans and dedupes both and lets a pause hold by time, days, agents and folders. - PausedOut takes the request's folder. The gateway reads it (workDir) only when a pause by folder is on the way (PausesByFolder); embeddings and System One's decision calls pass none. Paused carries Folder and ByFolder for the trace. ruleFor reads the folder for except-folders rules too. - Group sharing drops every rule by folder, except-folders included. - CLI usage, TUI hint, ParseRule/Line round-trip except-folders. - GUI: the rule editor has a "not in folder" condition beside "in folder", both shown on a pause and kept when a rule turns into one; a folder that isn't a whole path and a pause with no condition are refused; the group's rule and the trace say "not in …", and a paused reason says the folder read or that the agent said none. Strings in zh, zh-TW, ja, de. - Docs: gateway-routing.md, site start.html (en, zh, ja). What was run - go test -tags nogui ./internal/provider ./internal/gateway (folder, pause, share, rule tests); full go test ./... before pushing. - Broke it by hand: with the gateway's folder read replaced by nothing, TestPauseByFolder fails (in-task requests went to the other member). - GUI: routing-pause-folder.test.cjs (new), routing-pause, routing-folder, i18n-keys and 10 other rule-editor tests in Chromium and WebKit, en/zh/zh-TW/ja/de, at 1100px and 390px. - gofmt -l; GOOS=linux and GOOS=windows go vet of the touched packages. Not tried: a real Claude Code subagent's request against a live group; by the documented rule a request without a folder is paused off the kept member, which is what the reporter asked for. |
||
|
|
6f1b432759 |
provider, gui: smart routing spends WorkBuddy credits that expire soonest first (cdredfox on X)
WorkBuddy's Credits window had no reset, so in a Smart group every WorkBuddy account ranked alike. workbuddy plugin 0.1.14 (plugins f0274d6) reads WorkBuddy's own package lists (billing/meter/get-user-resource-paid- packages and -free-packages, the calls WorkBuddy's client makes) and reports on the Credits window when the soonest-ending package that still has credits ends (runsOutAt) and how many credits it holds (runsOut). The daily Free Plan slice (CapacityType 4) and code 001 aren't counted: they renew daily. magpie carries runsOutAt from the plugin's usage window into QuotaWindow and the routing Limit. Allowance.Renewal, which only Smart ranks on, treats it as the window's reset when it is sooner than the real one. Pace, the tiers, For, Full and resting are unchanged. The mover's min is raised to 0.1.14 so moved users get the plugin. The usage card and account meter say "232.4 expire in 5h" in every language. Run: - plugin: bun test, 63 pass; 2 of the 3 new tests fail on 0.1.13's index.mjs. Verified live on a workbuddy-ai account in a sandbox HOME: Bonus Pack 232.4 left ending 10-12T16:39Z ranked before Pro (10-28). - TestWorkBuddyCreditsRunOutForRouting and TestSmartSpendsWorkBuddyCreditsRunningOutFirst: both fail with the Renewal change removed by hand. - GUI: credits-run-out.test.cjs in webkit and chromium, 5 languages, at 360/440/1000px, red on the old app.js; with i18n-keys, quota-*, panel-usage, reset-each-title, usage-fold: 117 pass. - go test ./... green (agent and gateway rerun with -timeout 30m after the default 10m ran out under load from other sessions; 378s and 492s). - gofmt -l clean; GOOS=linux and windows go vet of provider, plugin, gateway clean. Not tried: the CN workbuddy site (its token was stale, 401), so the CN package list is assumed to have the same shape. The built-in WorkBuddy (not moved users) doesn't get this. The account-line tooltip has no GUI test of its own. |
||
|
|
35eea09464 |
gateway: a provider routed its own way keeps that order inside a group that routes another way (kchen0x on X)
kchen0x had a Smart routing group with Antigravity (9 accounts, set to 按顺序) and a Business account. Requests still went to the 9th account, the one renewing soonest. planLevel pooled every member's keys and accounts into one list for any group not routed in order, so the provider's own routing was never read; Smart then put the soonest renewal first. Now a member whose provider routes other than Smart, and other than the group does (ownRouting), is planned as a nested group already is: a unit weighed by the first account or key it would try (firstAwake), then tried whole in its own order. A provider left on Smart is pooled as before. leastHeld, which reorders a rotate group's first request, leaves such a group alone as it does one holding a nested group (without that, a rotate group still came back "k2 k1 k3 kb"). GUI hint (GROUP_NEST, 4 languages), start docs (en, zh, ja) and gateway-routing.md say so. Run: - TestProviderKeepsItsOwnRoutingInAGroup covers outer Smart, rotate, usage, pace and manual, plus a Smart provider still being pooled. On the old planLevel it fails with "k3 k2 k1 kb" (the reported order). - go test -tags nogui -count=1 -timeout 40m ./...: all ok. - gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/gateway. - GUI: i18n-keys, gui-ja/de/zh-tw and every *group*/*routing* test, both engines: 765 pass. A first run beside the full go test had 9 webkit timing reds (routing-group-fold, routing-keys-fold, routing-ctx-still, gateway-key-groups); each file passes alone, and the whole set passes when nothing else runs. |
||
|
|
ae70d8eac8 |
routing: a group's rule can hold by the folder the agent works in (Cario0x on X)
Cario0x on X asked to route by the project being worked on. A group's rule now has a "folders" condition: it matches when the request's working folder is one of the listed folders or inside one. It combines (AND) with the existing conditions: tokens, images, intent, time, agents and quota. - gateway/workdir.go reads the folder each agent states in its own request: - Claude Code: "Primary working directory", including "(was …)" after a move. - Codex: <environment_context><cwd>. - Pi: <cwd>. - OpenCode: <env> "Working directory". The last one stated wins. Assistant text and tool results are ignored. A request that states no folder matches no folder rule: unknown, never empty. - provider/rulefolder.go matches a folder only at a path boundary. - ~ is the home folder. - C:\x is the same folder as /mnt/c/x, and \\wsl$\Distro\x as /x. - Case is ignored on macOS and Windows, and always for a drive. - A rule's folder must be a whole path. Pause rules can't have folders. - The trace's RuleHit.Folder makes the Routing page say "The agent works in …". - GUI: an "in folder" condition in the group editor, hidden on pause rules. Strings in zh, zh-TW, ja and de. - CLI: `magpie group rule add … folders=~/oss,"~/My Project"`. The TUI shows the condition. - Docs: docs/subsystems/gateway-routing.md and site start.html (en, zh, ja). Fixtures are real requests from Claude Code 2.1.296, Codex 0.162.0 and Pi 1.1.0, run in a sandbox from a folder named "a&b <c> 中文" or "My Proj", with the sandbox path replaced. Run at this head: - go test ./... green. - gofmt -l clean. - go vet green for darwin, GOOS=linux -tags nogui and GOOS=windows. - GUI routing-folder.test.cjs: chromium and webkit, en, zh, zh-TW, ja and de, 1100px and 390px (no horizontal scroll). It fails on the old routing.js. - Related routing, group and i18n GUI tests: 85/85. - Full GUI suite: 5611/5631 under --test-concurrency=6. Rerun alone, every failure passes except: - skill-install-agents-all (chromium, 420px), which is red on origin/main too: #1554. - The menu-scroll track flake, which flakes on main as well: #1550. - e2e: a sandbox HOME, a dev build and fake upstreams, with real Claude Code 2.1.296 (`claude -p --model group/fd`). - From proj/acme/web, rule 1 matched and the request went to kb. - From proj/acme-old, no rule matched and the request went to ka. The trace and UI showed the folder. |
||
|
|
8c5b9f928d |
provider, agent, gui: subscription accounts can be turned off, and then no agent's sign-in is read (#1535, MaxHaiCom)
What changed: Settings → Privacy → Subscription accounts (On/Off), `magpie accounts discovery [on|off]` and MAGPIE_NO_ACCOUNTS=1 turn off account discovery. It stays on by default. While it is off, magpie reads none of the agents' sign-ins: ~/.claude/.credentials.json, .claude.json's account, ~/.codex/auth.json, Copilot's, Cursor's, Devin's, Kiro's, Gemini's, ZCode's, Command Code's and OpenCode's files. It runs no `security` / `secret-tool` for the Keychain or Secret Service, and asks no agent CLI who is signed in. It serves no subscription. API-key providers, middleware plugins and Pi extensions work as before. Why: the reporter runs magpie on machines where reading other tools' credentials isn't wanted. The owner delegated the call. How: settings.NoAccountDiscovery (kept per computer by KeepOwn) and settings.AccountDiscoveryOff(). The variable only ever turns discovery off. The gates sit at every reader (readAccountFile, discoveryOff) and at every route that reads or writes a sign-in, so a route that skips Accounts still reads nothing: - Accounts, All, Logins, usage, renewal, warm-up, session identities, check-ins; - switching, forgetting, SetLoginOn, StartSignIn, the imports; - moves onto plugins. The ones that write refuse with an error that names how to turn it back on. On the agent side, Agent.Source and OpenCode's auth.json are gated, and Codex wiring goes by magpie's stash instead of auth.json, so a toggle never rewires Codex. logins.json and plugin-auth.json are left untouched and serve again when discovery is turned back on. A change applies at once (ForgetAccounts). Docs: providers-accounts.md, README (en, zh-CN), and the site's CLI table (en, zh, ja). Run: - TestAccountDiscoveryOffReadsNoSignIn (provider) and TestAccountDiscoveryOffAgentsReadNoSignIn (agent). Every credential path is a FIFO that records each open, and security, secret-tool, claude, codex, cursor-agent, devin, kiro-cli, copilot and grok are fakes on PATH. Both fail with the gate removed: they show the opens and `security find-generic-password -s Claude Code-credentials`, among others. Both pass with the gate in place. - TestAccountDiscoverySetting and TestAccountsDiscoveryCmd. - account-discovery.test.cjs: chromium and webkit, 900 and 360 wide, en/zh/zh-TW/ja/de, 32/32. The neighbouring privacy, redact, settings-sections and i18n-keys GUI tests: 49/49. - The full `go test -tags nogui ./...`, gofmt -l, and go vet for darwin, linux and windows on the touched packages. Not tried: a real machine under fs_usage, and Linux and Windows at runtime. The FIFO tests are !windows. |
||
|
|
f04792f906 |
icon: remote icons are fetched through usemagpie.ai/api/icon, so their hosts never see the user's IP
A plugin's package.json icon, an import link's icon= and the library's market icons sit on hosts their authors pick. magpie fetched each straight from there, so an author could log the IP of everyone who opened Discover or the library. The owner asked for icons to keep showing without that. - site/worker.js: /api/icon?url=<https URL> fetches the picture from Cloudflare with only Accept: image/* and its own User-Agent, follows redirects, caps it at 1 MB (the app's MaxIcon), passes on only PNG, JPEG, GIF, WebP, ICO or SVG (by bytes, as StoreIcon), and counts and keeps nothing. It refuses http, userinfo, a non-443 port and usemagpie.ai itself; 404s are cached 5 minutes, 5xx not at all. - internal/iconproxy: URL(u) is the proxied address (MAGPIE_ICON_PROXY for tests); a picture already on usemagpie.ai is asked for as it is. - provider.FetchIcon (plugin, import link and partner icons) and library.fetchImage (market icons, avatars) fetch through it. The import link's checks (https, public host) still come first; there is no direct fallback. provider.FaviconFor still reads the user's own provider's site directly: they already send it their requests. - Privacy text in README en/zh, docs/reference.md and site docs start/import in en/zh/ja says so. Ran: - node --test site/*.test.mjs: 28 pass. The new test asks with Cookie, UA, X-Forwarded-For and CF-Connecting-IP and checks only accept and user-agent go upstream; 415/413/502/400 cases; its fetch stub throws instead of reaching the network. With the usemagpie.ai refusal removed by hand it goes red (27/1). - TestFetchIconGoesThroughTheProxy and TestIconGoesThroughTheProxy (author host is .invalid; an httptest server stands in for the proxy): with the proxy taken out by hand both go red (provider: lookup author.invalid; library: the proxy was never asked), green restored. - go test ./internal/iconproxy ./internal/provider ./internal/library ./internal/gui: ok. gofmt -l clean; go vet darwin (those four), linux (iconproxy, provider, library), windows (all four): clean. |
||
|
|
a98ab77fde |
gui, gateway: a context window's part, cell or item clicked opens the text the request sent there (masaka)
masaka on Discord asked to see the whole context behind the context window
card: click the agent's prompt, or any other part, and read it.
What changed:
- gateway: the trace keeps the last 10 request bodies in memory only
(promptBodies; at most 32 MiB each and 64 MiB together, oldest dropped
first), masked as the vendor got them. For a model the user let have
the request unmasked, the masked copy is kept all the same. Never
written to disk, never in telemetry. Route.Prompt and the routing
history keep names and sizes only, as before.
- gateway: Server.PromptText re-reads a part's items and their text from
that body (prompt_text.go). promptBuilder gains a keep mode that records
each item's pieces: system text, tool definitions laid out as JSON, each
turn's user/thinking/assistant/call pieces, tool results, and images
or sealed reasoning named with their size. Sizes are unchanged.
- gui: GET /api/context/text?id=&kind=[&item=] (no-store; 404 "not kept"
when the body is gone or another process serves the gateway).
- gui: in the card, a legend part, a waffle cell or a content row
(click, Enter or Space) opens a wide modal: one item alone with "All of
{part}", or the part's list 100 rows at a time, each item's text
fetched when it is opened and shown 20000 characters at a time, with
copy buttons. Strings in zh, zh-TW, ja and de.
- docs: gateway-routing and gui-shell subsystem pages; the site's start
page (en, zh, ja) says the text is kept for the last 10 requests in
memory and sent nowhere. The README Privacy is unchanged, since nothing
more is sent.
What was run:
- go test -tags nogui ./... (temp HOME). internal/gateway hit the 10m
default under the full parallel run, in TestRequestTailAfterOldLimit,
which takes 57s alone on the base commit too; the package run alone
with -timeout 30m: ok (700s, the machine shared with other runs). Every other package: ok.
- New tests TestPromptTextIsWhatWasSent, ...KeepsOnlyTheLastBodies,
...ChatPieces, TestContextTextAPI. Broken by hand: keeping the unmasked
body fails (the key shows), and dropping keepBody fails ("not kept").
- gofmt -l; go vet, GOOS=linux and GOOS=windows go vet on internal/gateway
and internal/gui.
- GUI: tests/context-text.test.cjs in Chromium and WebKit, en/zh/zh-TW/
ja/de, at 1100 and 420px: legend, row, cell and keyboard open the text,
long text grows on demand, the page never scrolls, and a gone body is
named. It fails with the click wiring removed. Under a load average of
~140 one case failed once: the test read the list while the dialog
still said "Reading…". Reproduced with a 400ms reply, fixed by waiting
for the list; the mock now always answers after 200ms. A second case
("a click doesn't move the page", 662 vs 605 on the contents row) came
from taking the page's top while a wheel scroll was still easing: the
test now wheels to the row like the other cases, and wheelTo waits for
three equal looks. Four full runs at load ~150 then passed (80 cases). context-window,
i18n-keys, held-animations and the modal tests (dialog-backdrop-drag,
editor-short-window, readable-focus, ux-safety, whats-new, add-sheet,
api-key-theme) pass in both engines.
- Real use: a sandbox magpie (own HOME, ports 3486/3487, the Codex login)
served a real `claude -p` (Claude Code) request on codex/gpt-6-luna
that read a file. In its web UI, Usage > Context: each of System
prompt, Tools, Memory, Files and Conversation, a waffle cell and a
contents row opened the request's real text (Claude Code's system
prompt, 21 tool definitions, the CLAUDE.md reminder, main.go's Read
result, the turn with its thinking and call). No page errors.
|
||
|
|
ddd4f43144 |
provider: a routing group can be duplicated, from its menu on the Routing page or with magpie group copy (lc on Discord)
provider.CopyGroup(id, name) saves a copy of the group as it is now: its
models and patterns, routing, stays, rules, classifier, effort, context,
levels, and fast and off members. The copy is deep, so its rules' time
windows aren't shared. Its name is the one given, or "<name> copy", with a
number added past a name in use. Its id comes from the name, numbered past
any id in use, removed ones included. It is listed right after the group
it copies. The copy is a group of the user's and switched on, even when
it copies a found group or a switched-off one. The original is unchanged.
Surfaces:
- GUI: a group row's menu (right-click, or a click on its logos) has
Duplicate under Move up and Move down. It posts /api/groups/copy with
the id and t("{name} copy"), so the name is in the reader's language.
It asks before discarding an editor with unsaved changes. The status
then says "Duplicated {name}". No click scrolls the page.
- CLI: magpie group copy <id> [name]; duplicate, dup and clone work too.
- zh, zh-TW, ja and de strings. docs/reference.md and the site's start
page (en, zh, ja) list the command.
Run:
- TestGroupCopy (internal/gui): the copy has the models, pattern,
routing, rule and off member, is on, and is listed after the original.
The original stays off and unchanged. A second copy is "Fast copy 2" /
fast-copy-2. An unknown id is refused.
- TestGroupCopyCLI (root): the default name, a given name, a found
group's copy as the user's, and the errors.
- group-duplicate.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de at
420px, 10/10. It fails 10/10 on the old routing.js. Siblings
group-arrange, removed-groups-menu-scroll, group-bulk-remove and
click-scroll pass 36/36.
- Sandbox CLI (sandbox HOME): group copy and duplicate made "DupTest copy"
and "DupTest copy 2", listed after DupTest.
- gofmt -l clean. go vet darwin/linux/windows on the root, provider and
gui packages: ok.
|
||
|
|
c98160c045 |
gateway: a group's rule can pause one of its models at set hours, days or agents, leaving it out of the group then, not first, not a fallback, not kept by affinity (John on Discord)
John asked for a pause in a group's Rules, e.g. a model paused in its vendor's peak hours. A time rule could only send those turns to another member first: the paused-for model stayed behind it for failover, went first when the other was unready, and was kept by affinity mid-turn. What changed: - provider: Rule.Pause (`"pause": true`, typed `pause=<model>`). It holds by time/days and agents only; cleanRules and ParseRule refuse any other condition, and refuse a pause with none. Pause rules are not send-to rules: MatchesBesidesIntent, ruledEntry and Ruled() leave them out. PausedOut(g, ms, agent, at) drops members a pause holds for, from the group's own rules and each nested group's (a group named = all its models; a model named = wherever a nested group has it, #625). - gateway: serve and embeddings run PausedOut on ruleClock before planning, on every request. Every member paused -> 503 naming each rule (pausedError). The trace's GroupRef carries Paused. - GUI: the rule editor's "send to" is now an app-menu action button (send to / pause); a pause hides the request conditions (clearing them), keeps hours, days and agents, and isn't saved without one. The group card's rule reads "→ pause <model>", and the Routing trace says which model was paused by which rule. Strings in zh, zh-TW, ja, de. - CLI/TUI: `magpie group rule add <g> pause=<model> time=… days=…`. - docs: gateway-routing.md step 2; start.html en/zh/ja "Hours and days". Run: - gofmt -l clean; go vet -tags nogui ./...; GOOS=linux and GOOS=windows go vet -tags nogui on gateway, provider, tui, root; go build ./... - go test -tags nogui ./... under a temp HOME with pinned caches: all ok. - rules_pause_test.go (3 tests) fails with the PausedOut call in serve removed (the paused model answers mid-turn, as a fallback, and the all-paused case returns 200). grouprule_pause_test.go covers clean, parse/Line, Ruled, Pauses and nested PausedOut. - GUI: routing-pause.test.cjs in Chromium and WebKit, en/zh at 1100px and en/zh/zh-TW/ja/de at 420px: 14/14; all 7 Chromium cases fail on the old routing.js. routing-*, group-*, i18n-keys, gui-ja, gui-de, click-scroll: 618 pass, 4 fail under --test-concurrency=4 (routing-blocked, -idle-frame, -side-calls, -wb-refused), all of which pass run alone; routing-side-calls failed 1 of 6 alone and passes with the old routing.js too, so it is a load flake not touched here. |
||
|
|
34f2078db8 |
site: a partner's website and key links go through usemagpie.ai/go, which counts the click; fetches of the partner list are counted too
The app's own partner counts only come from users who leave the stats on, so a sponsor's reach and clicks are now also counted where the server sees them. /api/partners hands out each partner's website and keysUrl (and a region's) as usemagpie.ai/go/<id>/site|keys[/<region>]; /go sends a "magpie partner go" event to PostHog (partner, link, region, country) and 302s to partners.js's own URL. One in ten list fetches sends "magpie partners fetch" with weight 10 while someone is listed. Events carry a random id each, no install id or address. Ended entries leave the list but /go still resolves them, since added providers keep the links. Privacy text updated in README (en, zh), docs/reference.md and the site docs (en, zh, ja). Run: node --test site/*.test.mjs (27 pass); a scratch copy with a fake partner served rewritten links, 302'd /go to the real URLs and posted both events; PostHog's /i/v0/e/ answered 200 to the payload shape. |
||
|
|
9bb2a467e4 |
agent: Snow CLI is an agent magpie sets up: a magpie profile in ~/.snow, made the active one, that Snow App takes in with "Sync Snow CLI API config" (#1457)
Snow CLI (npm snow-ai, MIT, MayDay-wpf/snow-cli) keeps one profile per file under ~/.snow/profiles (or $SNOW_CONFIG_DIR), names the active one in active-profile.json, and copies it over config.json at every start, headless `snow --ask` included. Each profile is the whole snowcfg: base URL, key, request method and models. Snow App (MayDay-wpf/snow-app) reads ~/.snow/profiles/*.json when "Sync Snow CLI API config" is pressed. magpie writes profiles/magpie.json from the profile the user was on (their settings kept, Snow's OAuth sign-in left out): baseUrlMode base at the gateway's /v1, requestMethod chat, the agent's key, the model as advancedModel and basicModel, and the catalog's window and output (200000 and 64000 when not known, the output cut to the window). It makes that profile active and copies it to config.json. The profile the user was on, whether there was an active-profile.json at all, and a magpie.json of their own are stashed; Disconnect, `magpie snow default`, or picking a model of one of the user's profiles puts those back. A Snow from before profiles (config.json alone) gets the default.json Snow itself would make, so its next start doesn't take magpie's config for the user's. Check reports a base URL, key or request method moved off magpie's; Sync rewrites the profile on a port move. A WSL distro's ~/.snow is found and written the same way. Registered: agents.go, the WSL kinds, SNOW_CONFIG_DIR in agentenv, the npm update spec (snow-ai), the icon (Snow App's own, trimmed to 96px), README, docs/reference.md, docs/subsystems/agent-wiring.md, the site's agent list and start.html (en, zh, ja). Run: - go test -tags nogui ./... in a scratch HOME: 44 packages ok. New: TestSnow, TestSnowOwnProfile, TestSnowNoProfiles, TestSnowUsersMagpieProfile, TestSnowCheckSync, TestAgentSnowDefault; snow added to TestOwnProviderNamedAsMagpies, the WSL more-agents tests and TestMaxTokensWithinContextWindow. All fail before this commit (no agent "snow"). - go vet -tags nogui for darwin, linux and windows; gofmt -l clean. - Real Snow CLI 0.9.2 in a sandbox HOME against a sandbox magpie (`magpie serve` on 127.0.0.1:3571, a fake OpenAI upstream on 3561): `magpie snow fake/pro` made the magpie profile active, `snow --ask` answered through the gateway (POST /v1/chat/completions, model pro, logged as agent snow), and `magpie snow default` left profiles, active-profile.json and config.json byte-identical to before. - GUI: agent-layout, agent-connect, agent-models-picker, agent-field-names and models-add-and-icons in Chromium and WebKit; a Snow CLI row checked at 520-960px in en, zh, zh-TW, ja and de in both engines. No new GUI strings. |
||
|
|
d86a4e0568 |
site: the docs have Docker and Remote magpie pages in English, Chinese and Japanese, listed in every docs page's contents and footer and linked from the READMEs (HuanCheng Bai on Discord)
Until now, both were only in docs/reference.md. The new pages are at
/docs/docker, /docs/remote and their zh/ and ja/ versions.
- docker: the image, its tags, ports, the /config volume and the nonroot
user. How to run it with the browser UI (`web --addr 0.0.0.0:3430
--no-open`, MAGPIE_WEB_KEY, the ?k= cookie). Signing in through the
Callback URL paste or `docker exec ... magpie accounts add`. What
/config keeps, the env vars, sharing with gateway keys, and a Compose
file for a NAS. Healthcheck and updates.
- remote: sharing the main magpie, then adding it as a Remote magpie
from the app, the TUI (a/w/m) or `magpie provider add remote-magpie
<key> url=... id=office`. What comes over (models, groups, APIs,
images, System One, embeddings, prices, quotas) and the errors magpie
shows, quoted from remote_quotas.go and lan.go.
The facts were checked against the code, not reference.md:
- the Dockerfile ENV, VOLUME, HEALTHCHECK and EXPOSE;
- docker.yml's tags;
- web_cli.go;
- the lanGuard in internal/gateway/lan.go;
- the remote-magpie preset.
The Docker page's warning says a Docker gateway answers anyone until
sharing is on, because MAGPIE_ADDR is 0.0.0.0 there.
The new links in the top nav bar carry a toc-only class:
- docs.js still lists them in the contents;
- the bar keeps today's width, since nine links overflowed it at
1024-1280px.
`.steps li` gets min-width: 0, so a long inline code no longer widens
the grid past a phone's width, where `overflow: hidden` clipped the
text.
Run:
- Real containers from ghcr.io/yetone/magpie:latest (v0.1.1150):
- the documented `docker run ... web` came up healthy, and its log
output is what the page shows;
- with "lan": true, `Bearer magpie` got 401 and a gateway key got 200;
- a second container ran `provider add remote-magpie <key>
url=http://<a>:3425 id=office` and listed office/test-relay/... models.
- `node --test site/*.test.mjs`: 23 pass.
- Playwright, in Chromium and WebKit, at 1280, 1024 and 390, light and
dark:
- no horizontal scroll and no nav overflow on all 20 docs pages;
- every internal link and #anchor resolves. /zh/ and /ja/ are routed
by the worker and return 200 live.
|
||
|
|
b4aa62af96 |
docs: the READMEs' Privacy and the site's "What does magpie send about me?" (en, zh, ja) say a partner's daily counts are sent too
|
||
|
|
f9a1ca0355 | docs: a Privacy section in the READMEs and a "What does magpie send about me?" FAQ on the site's Get started (en, zh, ja): the daily event's id, version and system, and the agents, providers and models by magpie's own ids (a provider of the user's own only "custom"), what is never sent, and the Settings → Privacy switches; node --test site/*.test.mjs passes | ||
|
|
f0a431651e | site: the Agents screenshots show today's page: eight agents on magpie (Claude Code, Codex, Gemini CLI, Antigravity CLI, OpenCode, Zed, Hermes Agent, Kimi Code), Show 21 more, the Sessions and Plugins tabs; en, zh and ja, light and dark; the docs give their new heights | ||
|
|
586f2bce8f |
context: magpie inspects the context window of every request, session and agent
The gateway reads each request's prompt into its parts (system prompt, tools and MCP servers, memory, files, tool results, chat), measured against the model's window and calibrated to the tokens the vendor counted. Routing shows a request's window as a card: a 400-cell grid by part, a hover naming what is largest in a cell, and the contents by part. The Usage page's Context tab scores each agent out of 100 (cache reuse, how lean it starts, how fast it grows, how reliably it answers), tags it (lean, cache-friendly, mcp-heavy, compacts, near-full…), and draws each session's growth with its latest request's card. Older Safari (15) gets media-query and solid-colour fallbacks for the card's container queries and color-mix. |
||
|
|
780b3fa3da | docs: the FAQ says how to let an agent reach magpie through Surge, Clash or mihomo: rules that send 127.0.0.0/8 and ::1 direct (amor90s, baksili_ on X: Codex got 502 from the proxy and magpie saw nothing) | ||
|
|
df95ac6bc2 |
docs, site: Integrating your app or agent with magpie, at docs/integrating.md and usemagpie.ai/docs/integrate (#918, Magixyne)
A developer of an AI app asked how to work with magpie and whether an app can register itself after one confirmation. The page says what exists: the gateway (find it via /api/hello and settings.json's port, the OpenAI, Anthropic, Responses and Gemini endpoints, /v1/models' fields), how a key magpie-<id> or the User-Agent's first word names the app in Usage, a row on the Agents page by an adapter PR in internal/agent (config-edit, Cindy-style own import link confirmed in the app, or a local API) with what the PR needs, what plugins can and can't do, and what isn't there: no link or API registers an app or installs a plugin, and magpie://import adds providers only. English and Chinese pages, linked from every docs page's nav and footer. TestThirdPartyAppIsCountedAsItself pins the attribution the page promises. go vet and the gateway tests pass; site node tests pass; pages checked in headless Chromium (no errors, TOC, no horizontal scroll at 390px). |
||
|
|
8031edc78b |
agent: AtomCode support — one provider account, one model table per catalog model, as its own sign-in writes (#736)
* agent: AtomCode is wired like its own CodingPlan sign-in — one provider account, one model table per catalog model
AtomCode (atomgit.com/atomgit_atomcode/atomcode, AtomGit's open Rust terminal agent) keeps its settings in ~/.atomcode/config.toml ($ATOMCODE_HOME). Its account schema, what its own CodingPlan sign-in writes, is one [provider_accounts."magpie"] table at the gateway's /v1 (protocol openai, gateway.TokenFor("atomcode") as the key, so a request is its agent's even when the UA is overridden) and one [models."magpie/<provider>/<model>"] table per catalog model: the model string goes to the gateway as it is to resolve, with the model's context window (AtomCode compacts as it nears it; a 128000 one is told when the model's isn't known, and an output above the told window is cut to it), its output limit, vision and reasoning_effort_levels; reasoning_effort rides on the table once the user picks one. Picking a model points default_provider and default_model at it — default_model wins when both are set, as atomcode reads it — and stashes the defaults the user had; stepping out puts them back. The picker offers the user's own model tables and the catalog via magpie; the Library gives AtomCode its ATOMCODE.md, its mcp.json (omp's shape) and skills/; its UA is atomcode/<version>.
Found against a real atomcode 5.2.1: the documented legacy [providers.*] tables work, but its own sign-in writes the account schema, so magpie writes that; reasoning_effort, max_tokens and supports_vision were verified to reach the request from the model table, and default_model to win over default_provider. Verified end to end on a real install: atomcode --provider "magpie/…" answered through the gateway, and the Agents page shows the tile, its picker and the Usage attribution. TestAtomcodeWiring, TestAtomcodeRestoresOwnDefaults and TestAtomcodeSync fail on the old code; TestDriftUnwiredEveryAgent and TestUnsetAgentsReadEmpty cover it from All(). go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./internal/agent ./internal/library ./internal/agentenv pass; the plugin-host and timing failures of the full ./... run fail on main without this change too.
* tweak
* agent: AtomCode's config is matched by its own spellings, and Sync keeps the effort — AtomCode rewrites its config through serde on every /model and /cd, and that writes the account header bare ([provider_accounts.magpie]) where magpie wrote it quoted, so after the first rewrite Check read the wiring as gone, Sync and every pick appended a second account table (edited TOML is invalid: table magpie already exists) and clearing left the unquoted table and its api_key behind. The account is now matched by exact name in its three spellings (quoted, bare, literal — magpie-2 stays out) and the model tables by their decoded keys (kimiModelKey, replacing atomcodeModelName), through a new SetTOMLTablesMatching that takes exact names beside prefixes; SetTOMLTables delegates with none, unchanged. Sync carries each magpie model table's reasoning_effort over when rewriting — it ran at every gateway start and catalog change and dropped both an effort picked in magpie and one picked with AtomCode's /effort, and picking another model cleared every table's. The effort Set validates against the levels AtomCode knows (low, medium, high, xhigh, max — its clamp_effort_to_levels drops none, minimal and ultra), a model without levels offers none now, and the low/medium/high fallback is gone with it. supports_vision is written explicitly false, where AtomCode otherwise guesses from the model name. The user's legacy [providers.*] entries join the picker, a stashed default_model naming one comes back on Disconnect, and picking one sets default_provider and takes default_model out, as the legacy shape reads. site docs (en, zh, ja) list AtomCode. TestAtomcodeSync rewrites the config into the bare and single-quoted spellings before Sync and again before clearing and fails on the old code (drift reported, effort dropped, unquoted table left behind); TestAtomcodeLegacyProvidersArePickableAndRestored and TestAtomcodeEffortLevelsMatchAgentSupport are new. Reported by yetone on #736. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./internal/agent ./internal/edit pass.
* agent: TestAtomcodeWiring picks an effort through the field too — the write side of the validation the last commit added (a level AtomCode knows lands as reasoning_effort on the model table, one it does not know is refused) had no coverage left: the test only read back what AtomCode's own /effort had written. provider.SetModelEfforts gives fake/m1 levels to offer.
* agent: Disconnect puts AtomCode's default_provider back only where AtomCode still has it — the restore checked the stash's value was not magpie's but not that the table it names was still there, so a table the user had deleted in between came back as a dangling default (the account schema's default_provider names a model table, the legacy shape a [providers.*] one; own answers for both). The default_model branch checked already. TestAtomcodeRestoresOwnDefaults deletes the stashed provider's model table before clearing and fails on the old code.
* agent: AtomCode joins the CLI updates — npm @atomgit.com/atomcode, the brew cask atomcode, and the curl script's ~/.local/bin/atomcode updating itself with atomcode upgrade, so the Agents page shows its version and a newer one as the other agents' do (#736). TestHowInstalled covers the npm prefix, the cask and the self-updating installer.
* agent: AtomCode's self-updater waits for its install paths to be confirmed — the branch recognized a binary under ~/.local/bin as `atomcode upgrade`, on a docs page, while the README shows another path and the command has not been driven outside the help text; the reviewer asked for it removed until the standalone command and the script's real default are settled. npm and the brew cask stay, with their tests; a comment marks what is pending.
---------
Co-authored-by: googya <118465+googya@users.noreply.github.com>
|
||
|
|
bc141ad834 | update: install.sh and magpie update take --proxy and --mirror, and magpie update mirror keeps one for the app's updates too (akic404 on Discord: 安装和update如果没有梯子也是麻烦事,能否在install.sh和magpie update后加子选项?--proxy等可自定义或默认ghproxy) — install.sh had no options and fetched with curl alone, and magpie update took none; without a way out to GitHub both failed. Now both take --proxy <url> (http, https, socks5, socks5h; install.sh also MAGPIE_PROXY=) for the feed and the download, and --mirror <prefix> (or MAGPIE_MIRROR=), a GitHub download mirror the release file is fetched from as <prefix>https://github.com/…; only github.com / githubusercontent.com URLs are put through it. No mirror is used unless one is given: magpie names none and has none by default. The feed with each file's SHA-256 is always fetched from usemagpie.ai, never through the mirror, so a file the mirror changed is refused and deleted ("… from the mirror X does not match its checksum from https://usemagpie.ai; not installed"); macOS still checks the app's signing team. magpie update mirror <prefix>|off saves Settings' updateMirror (http(s) only), which the app's own background update follows too; magpie update --mirror off skips it once; the Settings page's save keeps it. The app's update already followed Settings → Proxy (#294); magpie update --proxy overrides it for one run. The environment's ALL_PROXY / all_proxy is now honoured when HTTPS_PROXY / HTTP_PROXY are unset (Go's ProxyFromEnvironment ignores it), with NO_PROXY as curl reads it. magpie update takes --flag value or --flag=value, and an unknown word is an error instead of an update. The help, README and the docs' FAQ (en/zh/ja) say how. install.test.mjs's proxy, mirror and tampered-mirror tests, TestAllProxyFromTheEnvironment, TestUpdateThroughAMirror, TestUpdateThroughAProxyGiven and TestUpdateFlags fail on the old code and pass; TestSettingsSaveKeepsWhatItDoesNotSend covers updateMirror. A dry run of install.sh as Linux amd64 into a temp HOME installed the real 0.1.773 with its SHA-256 checked, refused a local mirror serving a wrong file, and with --proxy to a closed port failed reaching the site through it. go vet, builds (darwin, GOOS=linux, GOOS=windows), sh -n, node --test site/install.test.mjs and go test -tags nogui -count=1 ./... under a temp HOME pass but TestClaudeIdentityServedWhileAsked, a timing test that passes alone. Not tried through a real proxy server or a real public mirror; no install.ps1 exists for Windows, and the app has no field for the mirror. | ||
|
|
8f385e113b | site: usemagpie.ai draws itself in Omarchy's look on Omarchy, in the theme Omarchy has on (owner: 整个官网和文档页面能否智能识别是不是 Omarchy 在访问,如果是 Omarchy 在访问,那么整个页面风格能否变成 Omarchy 风格?而且能够适配当前 Omarchy 就更牛逼了) — every page (home, /import, the docs in en/zh/ja) loads omarchy.js in a Linux desktop browser only; it tells Omarchy by its font (a page may load local("omarchy"), which Omarchy installs system-wide and nothing else has), remembers it, and from then on paints before the page shows: the theme's palette, the system monospace (Omarchy's font), square corners, no shadows or glass, a solid bar, buttons and what's chosen in the accent, images framed in it. Until magpie tells the theme it takes Omarchy's default (tokyo-night, or catppuccin-latte on a light desktop). magpie's gateway answers GET /v1/magpie/omarchy (name, mode, stamp and the CSS variables magpie's own windows use) to this machine only, readable only by usemagpie.ai (CORS + Private Network Access; MAGPIE_SITE_ORIGIN adds an origin to try the site locally), 404 off Omarchy. The page asks it by itself only once the browser allows it to reach this computer; a chip in the corner (Omarchy's logo and the theme) asks once on a click, lists the 22 built-in themes to pick one, and turns the look off; ?omarchy=1|0|<theme> sets it anywhere. Followed while the page shows: a theme set in Omarchy's menu comes through in about 3 s. Tried in the omarchy VM's Chromium 152 with this magpie (nogui serve): detection, the home page and zh docs in tokyo-night, the chip's menu, following the computer, and omarchy-theme-set catppuccin-latte repainting the open page light. TestOmarchyThemeForTheSite covers 404 off Omarchy, the theme and its CORS for usemagpie.ai only, LAN refused and the preflight. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. The permission prompt from the public site wasn't clicked through in a real browser. | ||
|
|
3c79152eb4 | site: docs in Japanese (/docs/ja), and contents that work on a phone (owner: 文档也要支持日语,另外,文档要有友好的目录,在手机端也要有友好的目录) — /docs/ja/{start,intent,plugins,import} translate the English pages; every docs page gets the home page's language menu (English / 中文 / 日本語, the lang cookie) and a ja hreflang, /docs/ja opens the guide, and /ja/'s docs links go to the Japanese pages. docs.js (shared, replacing each page's inline scrollspy) builds the contents: every docs page, the current one's sections under it, the section being read marked with a pill (no left border); the list is sticky and scrolls on its own. Under 900px, where the contents were simply hidden (and under 600px the nav links too, so a phone had no way around the docs), a bar under the nav names the section being read and opens the contents as a menu that closes on a pick, a tap outside or Escape. The nav links give way to the contents under 1000px, long inline code wraps under 1100px, and .doc keeps .wrap's side padding (601-1168px ran the text to the screen's edge). node --test worker.test.mjs passes (/docs/ja redirect added); WebKit at 320-1280, light and dark, en/zh/ja: nothing scrolls sideways, the menu opens, jumps and closes, the bar follows the reading position. | ||
|
|
a8309d5ca4 | site: a plugin developer guide at /docs/plugins and /docs/zh/plugins — how magpie runs OpenCode plugins, the hooks it calls (config, auth methods and prompts, loader and fetch, provider.models, chat.headers, magpie's auth.usage), the API each AI SDK package maps to, accounts and their scope, X-Magpie-Sign-In, provider ids, testing in a sandbox, publishing and the registry, and the host protocol. The Acme example on it was run against v0.1.676 with a stand-in API (plugin add, login, provider test, quota). Every docs page links it; inline code wraps on phones so no page scrolls sideways. | ||
|
|
a802d98bfc | routing: a group in a group is routed by its own routing whatever the outer group's, and an account with five hours and no week is ranked by its five hours (#576: 只有五小时额度的账号在智能/重置前用完下是否合理;嵌套路由组时上层路由是否会干预下层) — a group routed other than In order (Smart, In turn, Least used, Weekly pace, Manual) put every account and key of every group in it into one pool and weighed them together, so A (Smart) holding A-1 and A-2 (each In order) ranked all five of their accounts and keys by Smart and A-1's and A-2's own In order did nothing; only an outer In order let each inner group route itself. planLevel now plans each group in the group by its own routing, whatever the outer's, and weighs it as one beside the outer group's own models' keys, by the first of its own order that isn't resting; where that lands, the inner group is tried whole in its own order, the trace in the same order. As for the five hours: Smart already ranked such an account (Claude Enterprise) by its five hours, the biggest window it has, so ahead of every week renewing later, but a five hours not started (no reset told) counted as a reset not known and went after every week; Allowance.Renewal now has a window not started that says its span renew that long from now, which Smart sorts by (the trace's renews unchanged). Weekly pace took an account with no week as a fresh week with the share used (100/168 per hour), so a week with 80% left and five days to go went ahead of an Enterprise account whose five hours were being lost; it now goes by what its five hours have left per hour until they renew, the whole span when not started, except where the reading may leave a week out — a Claude account only heard of from Claude Code's rate_limit_event, never read whole by /usage (QuotaWindow.partial, claudeUsageEntry.whole) — which keeps the fresh week. The group editor's Smart and Weekly pace hints and the trace's say how an account with five hours and no week is ranked, a hint under Routing says a group among the models keeps its own routing, and the docs (en, zh) say both. TestGroupInGroupKeepsItsOwnRouting (Outer rotating over two In order groups: b c d a without the change, c d a b with it), TestSmartFiveHoursAlone (a five hours not started went after a week in two days), TestFiveHoursAlone, TestClaudeHeardOnlyIsPartial; TestWeeklyPace and TestAllowancePace now pin the five hours alone. settings-groups, group-member-fast, group-found-off, routing-idle-frame pass in WebKit. go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui -count=1 ./... under a temp HOME pass (TestFXInState, TestProvidersAnswerWhileListsComeIn, TestUserPath, TestClaudeSignedOut flaked; the last passes 3/3 alone). | ||
|
|
ba0b2d54bf |
routing: 新增路由选项「重置前用完」(pace)——按周额度剩余比例 ÷ 距重置小时数排序 (#517)
* routing: Least used puts first the account with the most of its week left per hour until it renews — it ranked by the share used alone, so with two subscriptions, one 80% through its week and renewing in an hour, the other fresh and renewing in five days, every new conversation went to the fresh one and the first's remaining 20% was lost at its reset. Allowance.Pace: over the windows that count the model and run a day or longer (the five hours are a rate cap, not a budget; Kiro's month counts), (100 − used) / hours to reset — a week not started or not known runs its whole span from now, one whose reset has passed is full again, of several (Opus's own beside the general) the tightest; an account whose vendor tells the five hours alone (Claude's own usage command) counts as a week not started with their share used, so those go by what they have used, as they did. weigh's LeastUsed case: one at 98% or more last whatever its week, by how far; then pace, highest first, in bands alike within a tenth drawn from the top before sorting (a pairwise tenth isn't an order: three paces a twelfth apart go round in a circle); within a band the tokens sent lately, then their order, for the cache; an account not known counts as a fresh week (before, "used 0" put it first), a key follows the subscriptions. Renewing the same hour, pace is most-left-first, as before. Smart untouched. The trace carries pace; the Routing tab's story, the provider and group editors' hints and the docs' routing table (en, zh) say what the option goes by now. TestAllowancePace, TestLeastUsedPace (fails on the old weigh: "imminent renewal first: ab"). go vet ./internal/..., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./internal/provider/ ./internal/gui/ pass; ./internal/gateway/ passes but TestPluginModelListThroughAccountProxy, which fails on main too (a concurrent Body.Read panic in its fixture). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * routing: weekly pace is its own option, "pace"; Least used keeps its meaning (yetone, #517 review) — a user who had picked Least used was being switched to another strategy under the same name. Weekly pace: the account with the most of its week left per hour until it renews goes first, the one with the most to lose at its reset; Least used is most-left-first again, Smart untouched; the CLI takes routing=pace (weekly-pace), the TUI cycles to it, the group and provider editors, the Routing tab, README and the docs' routing tables (en, zh) list it. Review points: the tiers are Smart's — one at 90% or more of any window that counts the model, the five hours too, waits behind the healthy ones, by share, one all but used up behind those (an account 95% through its five hours with a healthy week ranked ahead of a fresh one until 98%, and the allowance is read about once a minute, so it was sent into 429s); among the healthy, one not known that tells what it has left as it answers (a Claude account) goes first while it isn't known, as in Smart, else it would never answer and never be known; a window that says no span (a plugin may not) is a budget for as long as its reset says, else a week, where it fell among the five hours and made the week not started; the hours until a reset are never fewer than one, or a window thirty seconds from renewing paced at 6000; the trace carries due, the reset of the window the pace went by, and the Routing tab's story says the week's share left over the hours until that, not the first reset it finds; Routing's comment in provider.go and README's routing= line name the option. The bands of pace alike are drawn among the healthy known accounts alone: one running low would otherwise set a band's top and part two alike behind it. TestWeeklyPace (the tiers and their 90% edge, the probe and its end, the bands drawn without the low, keys by tokens and after subscriptions, the trace's pace and due, Least used unchanged), TestAllowancePace (due, the span-less budget at 48 h and at 90 min, a day the shortest budget, the hour floor, normalize keeps pace). go vet ./internal/... ., go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./internal/provider/ ./internal/gui/ ./internal/tui/ . pass, the two new tests 25 times over; ./internal/gateway/ passes but TestPluginModelListThroughAccountProxy, which fails on main too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> |
||
|
|
04805abf39 | agent: MiniMax Code (#362) — MiniMax's mcode CLI (and its desktop app, same runtime) reads $MINIMAX_DATA_DIR/config.yaml, else ~/.minimax/config.yaml. Choosing a magpie model adds custom_provider.magpie there (the gateway, spoken to as Anthropic messages, with the catalog's models, efforts, limits and image support) and sets defaultModel to custom_provider:magpie/<model>; the user's own default and variant are kept and put back on reset, their comments, providers and keys on magpie's entry stay, and an emptied custom_provider goes. The Library installs skills into its skills folder; it reads no user-wide MCP file, so it gets no MCP target. Checked against @minimax-ai/code 0.5.10 in a sandbox HOME: mcode provider list shows magpie's entry and mcode exec reaches a fake upstream through it with magpie's key, model and effort; after a reset it loads the restored file. TestMiniMaxCode, TestMiniMaxCodeSync, TestMiniMaxCodeLeavesNoEmptyProviders, TestMiniMaxCodeDataDir and TestMiniMaxCodeSkills fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestUserPath and the Claude account tests pass alone). | ||
|
|
04f374fa8c |
agent: OmO (oh-my-openagent, omo-ai), a fork of Pi that keeps its own ~/.omo/agent, gets its own row: a magpie model sets settings.json's defaultProvider/defaultModel and magpie's provider in models.json there as Pi's does, $OMO_CODING_AGENT_DIR / $SENPI_CODING_AGENT_DIR are honoured, the Library writes its AGENTS.md, mcp.json and skills, and omo update updates it (#264 rhyme227). Pi's own ~/.pi is left alone. piIn becomes piLike(at, id, name, dir) so both share one wiring. Tested with omo_test.go in agent and library (fail without the change); go vet, go build -tags nogui (darwin, GOOS=linux, GOOS=windows), go test -tags nogui ./... pass.
|
||
|
|
3fe2ff9958 |
rules: a routing group's rule can be for the agent compacting its conversation, so a cheaper, faster model writes the summary while the conversation stays on its own (X, MR.Guo: 希望 Magpie 能像 OpenCode 一样支持单独指定 context compression model:当 Agent 需要做上下文压缩时…指定一个更便宜、更快的小模型专门负责总结和压缩历史上下文) — a compaction went to whatever model the conversation was on, the priciest in the group as often as not, and a long session paid for each summary at that price. A rule's new condition, compact (provider.Rule.Compact, "compacting"; magpie group rule add <group> use=<model> compact, compact=yes|no; the GUI editor's 压缩上下文时 / compacting toggle; the TUI hint), matches a request that is an agent compacting, told from the agent's own prompt (internal/gateway/compacting.go, read from each one's release): the system prompt of Claude Code 2.1's /compact and auto-compact, OpenCode's compaction agent, Pi, Gemini CLI's state_snapshot and Qwen Code, or the last user message of Claude Code's, Codex's (and magpie's own for a Codex compaction_trigger) and Kimi Code's; a prompt only quoted earlier in a conversation doesn't count. Only in a group with such a rule is a request looked at this way, so nothing else changes. A compaction is decided on its own, never held by the turn's rule, its classifier never asked; it isn't remembered for the turn, and neither the conversation's affinity nor the turn's size is taken from its answer, so the requests after it go on on the model the turn was on and its cache (without that, the next request of a Claude Code turn followed the summary to the cheap model). A member whose context is less than the compaction is passed over for the next rule that matches, or the group's order (RuleHit.Small). The trace tells it ("The agent is compacting the conversation, so rule 1 sends the summary to …", the models passed over named), and the editor notes a compact rule's model taking less than another member. Docs: start#rules (en, zh). Tested: internal/gateway/compacting_test.go — each agent's prompt taken, a plain and a quoted one not; in a group with rules compact→a/small and tokens≥2000→b/big, a long Claude Code turn on b, its /compact to a (Compact, N=1), the turn's next request back on b held, Codex's compaction to a too; a 70k-token compaction skipping a (64k) for rule 2 with Small [a/small]; a group with no compact rule routing a compaction as before; ParseRule/Line/Conditions/Matches for compact. TestRuleCompact failed with the affinity kept from the summary. internal/gui/tests/routing-compact.test.cjs, Chromium and WebKit, en and zh: the compaction in the trace, the rule's words, the toggle on and off with nothing moved, the room note, a compacting-only rule saved as compact:true and not refused. routing-kind/served/signin/steady, click-scroll and old-webkit pass. go vet, go build -tags nogui (and GOOS=linux, GOOS=windows) and go test -tags nogui ./... pass. Not tried against real agents' compactions through the gateway (the prompts are matched as read from their releases) nor in the real Wails window.
|
||
|
|
5910bdada5 | docs: Get started says agents, not coding agents (把文案里的Coding agents统一改成agents) — magpie chooses the model for any agent, not only coding ones; the English lede said "each of your coding agents" and the Chinese one "编程 Agent"; both now just agents, as the home page already does | ||
|
|
6c9a0aa4d7 | agents: OpenHanako — magpie is a provider there, chat completions at the gateway's /v1 under the key magpie-hanako with every model it serves, their windows, output, images and reasoning said; picking one makes it the primary agent's chat model, and default puts back the one it had and removes the provider, marked deleted as OpenHanako marks one it removes. While OpenHanako runs it goes through its local API (server-info.json's port and token), which reloads at once; otherwise into provider-catalog.json and agents/<id>/config.yaml for its next start. Asked on Discord; checked with OpenHanako's own provider registry and model manager, which list magpie's models and resolve the chat model to the gateway | ||
|
|
03a01a548d |
agent: MiMo Code — Xiaomi's fork of OpenCode, sharing its config shape (#98)
* agent: MiMo Code — a terminal coding assistant that is Xiaomi's fork of OpenCode, whose config keeps OpenCode's shape: its own mimocode.json(c) under ~/.config/mimocode, its auth beside it, and a magpie provider block with npm/@ai-sdk/openai-compatible, model and small_model fields. opencode() becomes openCodeLike() for the two to share it, and magpieProviderJSON splits shape from the catalog id (magpieProviderJSONFor), so a visibility narrowed on mimocode (magpie visible mimocode …) narrows its list and leaves OpenCode's alone. The library gives it the same instructions, MCP servers (its mcp key) and skills as OpenCode, except the shared skills go into its own skills/ folder: it reads Claude Code's skills only behind a flag, though it reads its CLAUDE.md like OpenCode, and the page says so. Its requests are told by the mimocode/ User-Agent. Checked against XiaomiMiMo/MiMo-Code * icon: MiMo Code's own favicon, from packages/ui/src/assets/favicon — its frame with the bottom bar, in the monochrome the app masks to the text colour |
||
|
|
7a3c434610 | agents: Alma — magpie wires it through Alma's local API (localhost:23001, while Alma runs): choosing one of magpie's models for Alma adds a provider named magpie there (OpenAI type, the gateway's /v1, key magpie), offers magpie's models in it and makes the model Alma's default chat model, the rest of Alma's settings and its other providers left as they are; the list is kept current as magpie's catalog changes, and going back to Alma's own takes magpie's provider out. Asked on Discord | ||
|
|
d4135b55e1 | group: a routing group's models can be another group — group/<id> as a member, routed in its place by its own routing and rules, so Coder can be deepseek-v4-pro then Fast, a Coder rule can send a turn to group/fast and Fast's own rules pick within it; a group can't be in itself directly or through another (refused on save, left out of the picker), groups go at most 8 deep, and one can't be removed while another has it. The Routing tab shows a group in a group as a heading with its models under it, the packet going through it, and the log says what each group's rules and classifier decided | ||
|
|
d9ff79ae44 | docs: Intent routing, in English and Chinese — when the classifier is asked and when not, the exact prompt and what of the message it sees, how its answer is read, what happens when it fails or is slow, the rest of the turn (held, failover, outgrown, waits, subagents), reading the trace, latency/cost/privacy, writing intents, the numbers, and a FAQ; with screenshots of the rules and the trace | ||
|
|
bc720c8d87 | group: a rule can be for a kind of message — intent="writing or fixing tests": as a user's turn begins, the group's classifier (any model magpie has, best a small fast one) is asked once which of the intents that may match the message is, and the turn stays with the answer through its tool rounds; it isn't asked when no intent rule could decide, the same message isn't asked about twice, and when it fails or is slow (8s) no intent matches and it rests 30s. The trace says what it was asked and said; Routing's rule editor has "asks for" and the classifier picker, and magpie group rule add … intent=… classifier=… / magpie group rule classifier from the terminal. A sub-millisecond reply no longer shows as NaN s in the trace | ||
|
|
696c8e70e7 | group: rules send a kind of turn to a chosen model — a group's Rules (Routing view, or magpie group rule add|rm|mv) put one of its models first for a turn that is long (tokens ≥ N), carries an image, asks for reasoning (on or at least a level) or comes from certain agents; the first that matches decides as the turn begins and the turn stays there through its tool rounds, moving only if it outgrows its model's context, the others staying behind it for failover; a subagent keeps a place of its own so a rule can send it elsewhere while its agent stays; the trace says which rule sent a turn where. Turn affinity also now sees past the system message Claude Code puts after tool results, which made each of its tool rounds look like a new turn | ||
|
|
c0cbf90eeb | agent(zcode): ZCode is an agent — its provider field puts every magpie model in ZCode's own model picker, as a provider named magpie in ~/.zcode/v2/config.json (kind anthropic, asked at the gateway's /v1/messages), kept in step with the catalog like OpenCode's list, and taken out again when cleared; its requests are known by the ZCode/ User-Agent (#72) | ||
|
|
032bcfc8b0 | provider: the Grok subscription is called Grok (SuperGrok) — the plan xAI sells, so it reads as the account it signs into; Grok Build stays the name of the agent, the grok CLI the subscription runs through | ||
|
|
f7112a9e9d | agents: Grok Build — xAI's grok CLI — is an agent: its model is set in ~/.grok/config.toml ($GROK_HOME), and a model through magpie adds the catalog there as [model."magpie/…"] tables pointed at the gateway with magpie's own key, so a request never carries the user's xAI sign-in and the catalog joins Grok's own models in /model; its effort is [models] default_reasoning_effort, its requests are known by grok-shell; the Grok subscription is called Grok Build too | ||
|
|
bea2cec91f | site: the Routing shot shows four agents — Claude Code, Codex, OpenCode, Crush — sending at once through three routing groups, with Kimi rate-limited and sitting out; in every shot the magpie icon lines up with what's under it, where it had kept the room the Mac window leaves for traffic lights a screenshot doesn't have; and the homepage's Providers shot ends where its list does | ||
|
|
7d0069ab93 | site: the import docs come in Chinese too (/docs/zh/import, with its own screenshot of the dialog and the link builder's messages in Chinese), and each page links to its other language; the start docs show what each step looks like — the Add provider sheet, the Agents window, routing groups and Usage — in light and dark, English and Chinese | ||
|
|
ea09310872 | site: the getting-started guide says outright that a model two providers serve becomes a group by itself — group/auto-<model>, over every provider serving it, the name matched however each vendor spells it, hidden with magpie group rm — which it said in passing, and someone trying magpie found it out by testing and asked for it to be written down | ||
|
|
6882ceac7d | site: a getting-started guide, in English at /docs/start and in Chinese at /docs/zh/start (/docs and /docs/zh open it) — someone who runs Claude Code, Codex and Paseo every day found magpie confusing at first and the site had only the Add to magpie page for vendors; the guide says what magpie is for and how the setup goes: add the providers you have (subscriptions signed in to in magpie, a vendor's preset and its key, any compatible URL, or Import… from Claude Code and Codex), pick a model for each agent and what that writes into its config, a new session to pick it up, then routing groups when there are several accounts (the Routing view and magpie group), Usage, profiles, the commands and a short FAQ, the Chinese one in the app's own Chinese labels. The home page's Docs link and every docs page's nav and footer lead to it, and on a phone the docs nav keeps the brand, the language, the theme and Download |