Commit Graph
49 Commits
Author SHA1 Message Date
yetone 88b541a25c images: every pointer names Settings › Models › Images, where the page is
The image models moved under Settings › Models, but the Library's Magpie
Image sheet, the MCP server's instructions to agents, the gateway's
"no image model" errors, the video tool's text and the docs still sent
users to "Settings › Images", a tab that no longer exists (the scattered
settings audit after netube99 on X). Every user-facing string now names
Settings › Models › Images in en, zh, zh-TW, ja and de, as do the site's
Qwen docs (en, zh, ja), llms-full.txt, the subsystem pages and comments.

Run in the tree with this change and the rest of the audit's fixes
(mote, base cd0ba05c2):
- go vet ./internal/gui ./internal/gateway ./internal/agent
  ./internal/provider ./internal/settingsapi: ok
- go test -run 'Image|Draw|Video|Hidden|Group|Settings' ./internal/gui
  ./internal/gateway ./internal/settingsapi: ok; ./internal/imagemcp,
  ./internal/library, ./internal/catalog: ok
- GUI: i18n-keys, i18n-en-no-cjk, image-models-hide,
  library-browser-setup: pass in Chromium and WebKit
- gofmt -l: nothing
Not tried: a real agent reading the new MCP instructions (text only).
2026-11-09 21:51:53 +08:00
yetone 6b7ee4a984 routing: every group follows a default for rate limits, slow starts and busy members unless it sets its own
jiezhengj on Discord asked to set the per-group policies once instead of
in each group. The Routing groups page's Settings card, under the list,
now has three rows: Rate limited (keeps its place / goes to the back),
Slow to start (wait / 30 s ... 4 min) and Every member busy (off / 1 min
... 4 min). They are saved in settings.json as groupSink, groupFirstToken
and groupPatience (settings.SetGroupDefaults, POST /api/groups/defaults).

A group follows the default for each value it leaves unset, and its own
value always wins:
- Sinks() is the group's Sink, or else the default unless NoSink, a new
  field for an explicit "Keeps its place".
- FirstTokenOr() is the group's own FirstToken (-1, FirstTokenWait, is an
  explicit Wait), or else the default. The gateway reads it where it
  reads a group's first-token time.
- Waits() reads the default when Patience is 0. 60 is an explicit 1 min.
Groups saved before have 0 and no NoSink, so they follow the default,
which starts at magpie's own (keep its place, wait, 60s). Nothing a user
set changes. The group editor's three rows gain a Default option, on for
a group that sets none, and its hint names the value it follows. Segments
only, with no native select.

Run on mote, at 06b2daeff rebased on origin/main 2dac9b84e:
- go test on the new tests TestGroupDefaultsUnlessItsOwn,
  TestGroupFirstTokenFollowsTheDefault, TestGroupSinkFollowsTheDefault
  and TestGroupDefaultsSaved, plus TestKeysAreWhatTheSaveWrites and the
  existing first-token and sink tests: ok.
- Broken by hand (Waits, FirstTokenOr and Sinks ignoring settings): the
  three provider/gateway tests went red.
- GUI: group-defaults (new), group-patience, group-first-token,
  group-found-off and rate-limited-sink, in Chromium and WebKit, in en,
  zh, zh-TW, ja and de, at 1100 and 420: 56/56 pass. With the old
  client.js and routing.css, group-defaults, group-patience and
  group-first-token fail 44 of 44.
- GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./...:
  clean. gofmt -l: clean.

Still running when this was pushed (owner: never hold a verified commit
behind the suite): go test -timeout 45m on internal/provider,
internal/gateway, internal/gui, internal/settings and
internal/settingsapi, then the whole GUI suite under suite.lock. Any red
they show gets its own issue.

Not tried: the real app with real groups under real rate limits. Only
the gateway tests' fakes exercise the default sink and first-token paths.

Reported-by: jiezhengj on Discord
2026-11-08 02:08:30 +08:00
yetone 47b7ba3030 models: a model its provider lists at $0 says free in the pickers and Routing (jiangguochao666 on X)
jiangguochao666 asked for each provider's free models to show in Routing
and the model settings, to route to them. The green free tag was shown
only for a plan's free model or a model with "free" in its name.

provider.PricedFree says a model is free only when its price for that
provider is known to be $0:
- A price the user set comes first (provider/model, provider/*, then
  the model's own key). A $0 one makes it free, and any other price, a
  paid tier included, makes it paid.
- Otherwise the provider's own catalogs decide. A $0 from a plan's
  catalog (-plan, membership catalogs) is the plan's per-token price,
  not free. A $0 from only the model's maker is not free either: a
  relay serving Zhipu's free glm-4.7-flash may charge for it.
- No known price means not free.
FreeModel (Free first, Cheapest first routing) is unchanged.

From the local models.dev cache this tags:
- every model of NVIDIA NIM and ModelScope;
- the :free / -free models of OpenRouter, OpenCode Zen and Go, Kilo,
  AIHubMix, ZenMux, Vercel, Requesty and other relays;
- Zhipu's and Z.ai's glm-4.x-flash.
No coding or token plan is tagged.

Where it shows, with the hover "free: listed at $0 on this provider":
- an agent's model picker (agent.Option.Zero);
- the provider editor's model chips, and its Free only button
  (modelJSON.Zero);
- Routing's Add a model and classifier pickers (modelRef.Zero).
The word is new in en, zh, zh-TW, ja and de.

Tests, each red on the old code:
- TestPricedFreeIsTheProvidersOwnZero: own, plan, maker-only, unpriced
  and user prices.
- TestPickerSaysAZeroPricedModelIsFree: Option.Zero, cleared at once by
  a price the user saves.
- TestZeroPricedModelsSayFree: the editor's and Routing's JSON.
- zero-priced-free.test.cjs: the three surfaces, in Chromium and WebKit,
  at 1100 and 420px, in all 5 languages. It checks the tag's text,
  hover and fit, that the paid model has no tag, that a plan's free
  model keeps its own hover, no sideways scroll and no page errors.

Broken by hand (each restored, diff checked):
- The source check ignored (maker and plan $0 count): the provider test
  goes red on the plan model and the relay's glm-4.7-flash.
- PricedFree always false: the provider, agent and gui tests go red.
- The user's price ignored: the provider and agent tests go red.
- The badge's o.zero / m.zero and Routing's zero dropped in app.js and
  routing/client.js: zero-priced-free goes red, "the $0 model has no
  free tag in the agent's picker".

Run at this commit's tree (base 3f1f1882a):
- mote, go test -timeout 45m ./...: 84 ok, 19 with no tests, 3 FAIL.
  Each red is filed and fails the same way at origin/main 7d022bdb6:
  - TestEveryRouteHasACommandOrIsNamed: /api/context/reply, #5026.
  - TestMainWindowCorners/macOS_26_SDK: macOS 27, #3949.
  - TestCompactionOverByteCapEveryTime: red only in the full gateway
    run, ok alone here and at main, #4862.
  TestCoreScriptBudget passed; no budget was raised.
- gofmt -l: clean. GOOS=windows go vet (mote): ok. go vet -tags gtk3 on
  Linux (wsl, magpie-desktop): ok. A cross GOOS=linux vet from macOS
  fails inside wails' cgo files on main too.
- wsl: zero-priced-free + i18n-keys, 24 of 24 pass.
- wsl: the whole GUI suite, concurrency 4: 19062 of 19585 pass,
  523 fail in 127 files, at load ~86 on a shared box. Those 127 files
  run again at concurrency 2: 465 red here and 417 at the base
  3f1f1882a, the same files on both. 11 files with a red only on this
  tree, the routing, model and search ones near this change, run again
  alone at load ~3: the same 7 fail on both trees
  (33 here, 27 at the base), and which cases fail changes from run to
  run with the same errors. None is in a test that reads the free tag.
  Filed already: #3096 and #5035/#5088 (routing-rule-*, rest-try-now),
  #4388 (model-chip-steady alone on WSL), #4585 and #4932 (under load).
  The other files red only on this tree (usage wheels, tray, archive
  rows) were not run again alone; nothing in them reads the free tag.

Not tried: a real provider's list in the live app (the tests use
fixture catalogs); Free first routing choosing a $0-priced model it
didn't choose before (FreeModel is unchanged on purpose).
2026-11-04 05:00:18 +08:00
yetone b045362a92 routing: importing a shared group whose id is one of yours replaces that group (issennknight)
Import on the Routing page always added a new group. When the pasted text
carries the id of a group of the user's own (not one magpie found), the
box now says so before it is pressed: the button reads "Replace <name>"
and a line under the box says its models, routing and rules are replaced
and its accounts and folder rules stay. Pressing it posts groups/import
with replace, and provider.ImportGroupOver saves the text's group over
that one, in its place in the list. Matching is by id only; no other group
changes. Kept as the user has them, since the text can't carry them: the
group's accounts, its folder rules (that still fit the new members) and
its on/off switch. A name another group has gets a number. A text whose
id nobody has, a found group's id, or any import that doesn't ask to
replace adds a group as before. ImportGroup is unchanged.

Run on mote at the pushed tree before rebase:
- go test ./internal/provider (Share|ImportGroup): ok; the new
  TestImportGroupOverReplacesSameID is red with the match switched off by
  hand (replaced=false, id three-2).
- go test ./internal/gui -skip TestMainWindowCorners: ok. TestMainWindowCorners
  fails on mote's macOS 27 box and on an untouched origin/main checkout
  alike (c360d9d30), so it is not this change; not filed here.
- GOOS=windows go vet ./internal/provider ./internal/gui, gofmt -l: clean.
  GOOS=linux go vet of internal/gui can't cross-compile wails (cgo), not run.
- group-import-replace.test.cjs (new, 10 tests: chromium and webkit x en,
  zh, zh-TW, ja, de, at 420px): green; red 10 of 10 with the id match
  broken by hand. Its checks: Import for an unknown id or a found group's
  id, Replace One + the line for an own id, the label survives a redraw,
  replace is posted only then, the list keeps its groups.
- group-*.test.cjs, i18n-keys, gui-de/ja/zh-tw, routing-accounts-narrow,
  routing-save (407 tests, chromium and webkit): all pass. A wider run of
  group/routing/i18n/gui-* files at concurrency 3 was cut at 444 tests with
  one red, routing-accounts-narrow, chromium en, which passes alone (load
  from other sessions on mote); the rest of that wide run was not finished.

Not tried: a real account's group pasted into a real magpie; the TUI/CLI
have no import, so nothing there changed.
2026-11-04 03:56:38 +08:00
yetone 1d8658abca routing: a group's model picker offers the providers' image models, and a group of them draws (jzw690 on X)
jzw690 on X: the Routing page's group editor ("Add a model") listed no
image models, so a group of image models, to draw at
/v1/images/generations and to pick in Settings > Images, couldn't be
made.

What changed:
- /api/groups gains `drawers`: each provider's image models
  (gateway.Drawers, less ones unticked in its editor unless a group
  names them), apart from the chat `models`. The picker offers them
  after the chat models, noted "<provider> · Image model" (an existing,
  translated key); a member row says so and offers no reasoning level.
  Decision-model groups don't offer them. Image models stay out of the
  chat catalog, so agents are not offered them.
- An image member drew only when its provider had no picks: picks are
  of chat models, so membersFound dropped it as unpicked, and GroupDraws,
  resolveDrawing, the group's turns and DrawerMissing all failed.
  provider.FindDrawingGroup keeps such a member when drawsModel holds;
  the image path uses it (drawingMembers), video keeps FindGroup.
  DrawerMissing for a group ref asks GroupDraws.
- Routing card: such a member reads ready (groupsState), and Settings >
  Images lists every group that draws, not only those reached through
  Served.
- docs/subsystems/gateway-routing.md says so.

Tests:
- TestImageGroupOfUnpickedImageModelsDraws (gateway), from the
  reporter's case: two key providers whose live lists hold gpt-5.5 and
  gpt-image-2, one with gpt-5.5 picked. group/<id> draws at
  /v1/images/generations (the first member's 502 moves on to the next),
  as the Settings pick a request naming no model draws, and the model
  gone from the list makes it missing.
- TestGroupEditorOffersImageModels (gui): drawers listed, an unticked
  one not offered unless a group names it, none among chat models, the
  group's members ready, Settings offers the group.
- group-pick-drawers.test.cjs: the picker offers it with its note, adds
  it, no reasoning button, Save posts it; en and zh, Chromium and
  WebKit.

Broken by hand: drawingMembers passing nil instead of drawsModel made
the gateway test red ("group/pix-images doesn't draw"); turning off the
groups.go drawer branch made the gui test red ("group not ready").

Run at b295d1196 plus this change (mote unless said):
- gofmt -l: clean. go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./...: ok.
- go test -count=1 -timeout 45m ./internal/provider ./internal/gateway
  ./internal/gui: provider ok. Two reds, neither on this path:
  TestCodexPoolSaysTheClientsVersion (full run only, passes alone 3/3;
  #4807) and TestMainWindowCorners (red on origin/main f49f6ba68 too,
  macOS 27; #3949). Both commented.
- GUI on the Linux VM (Playwright 1.62.0, both engines), 62 files:
  group-*, routing-group*, settings-groups, fallback-group,
  agent-model-groups, image*/images*, panel-routing*, routing-manual,
  routing-levels, i18n-keys. 698/710. i18n-keys was red on a comment of
  this change saying ", with an image" (reworded; 4/4 after). The
  WebKit reds under concurrency 4 passed on a serial run except
  group-member-info webkit zh, red 2/2 on origin/main f49f6ba68 too
  (#1745, commented).

Rebased on origin/main 809801f1f (its 8 commits change client.js and
gateway-routing.md), then again on mote: gofmt clean, go test -run
of the budgets, TestImageGroup*, TestDrawing*, TestGroupMember* and
TestGroupEditorOffersImageModels in gateway, gui and provider: ok; on
the Linux VM, both engines, group-pick-drawers, group-pick-filter,
group-decide-members, group-editor-fits, group-member-off,
routing-levels, settings-groups, image-models-hide, i18n-keys: 96/96.
Rebased last onto 03d7927a8 (search strings, i18n.js values only;
none of this change's files), not run again.

Not tried: a real provider's image model drawn through a group in the
running app; Windows and the real Linux app (WebKitGTK).
2026-11-03 11:57:11 +08:00
yetone ce2e81da11 routing: a group's member its provider counts free says free on its card and in its editor (jiabubu)
jiabubu on Discord: v0.1.2274's Free for me and a group's Free first,
but a routing group never showed which of its members are free.

groupsState's memberInfo now carries free (provider.FreeModel: the
provider is Free for me, or its vendor serves the model free). The
Routing page says a muted "free" for such a member, whatever the
group's routing, so it shows before Free first is picked (and Cheapest
first reads the same word): on the group's card line, beside the
provider in the group editor (a small like "by pattern", with a hover
saying what Free first and Cheapest first do with it), and in a manual
group's pick row and menu. A paid member says nothing. Routing plugin
files only; the core's scripts are unchanged. No new colours.

Run at 67dedea38 (rebased on origin/main a4916aec1), on mote:
- group-member-free.test.cjs: 20/20 (Chromium, WebKit; 1100, 420px;
  en, zh, zh-TW, ja, de); i18n-keys 4/4
- go test ./internal/gui -run TestGroupMemberSaysFree|
  TestGroupModelsCarryWhatTheyTake|TestCoreScriptBudget: ok
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui: ok; gofmt clean
- earlier at fb23a3279 (pre-rebase): go test ./internal/gui all but
  TestMainWindowCorners/macOS_26_SDK (#3949, macOS 27 on mote);
  the whole GUI suite (make test-ui) still running at push, reds named
  so far are filed: balance-fix (#4683), agent-panel-name-width (#4600),
  codex-auto-reset (#4790, #2360); none in a Routing or group file.

Broken by hand: freeIn always false and the editor tag off: the card
and editor assertions go red; the editor tag alone: "the free member
has no free tag"; memberJSON.Free always false: TestGroupMemberSaysFree
red.

Not tried: a real ModelScope provider in the real app; the whole GUI
suite to its end at the pushed head.
2026-11-02 14:13:52 +08:00
yetone 85e37162e9 routing: a route group can be held to chosen accounts (duanckham on X)
duanckham has a personal and a company GPT account, one tool and one
gateway, and wants a group's GPT models to spend only the company
account (or only his own). A second gateway key doesn't fit: his tool
talks to one gateway, and a local agent needs no key at all.

Group.Accounts holds a group to some accounts or keys of the providers
it names, in a gateway key's form and by the key's rule (#905,
Identity.AllowsAccount). The asked group narrows the request's
identity (access.Identity.HeldToGroup: the strict intersection with
the key's own list; "<provider>/\x00" when they share none), so every
gate a key's accounts go through holds the group's too: chat,
responses, messages, count_tokens, embeddings, images and video,
streamed or not. A group reached inside another, as a member or a
fallback, is held in planLevel (hold, Member.Via): its candidates on
an excluded account are Held rows with Weighed.HeldBy, which the
Routing trace tells. Fallback stays within the group's entries; with
every allowed account resting or out the group's usual error comes
back, and a key and a group that share no account get a 403 naming
the group, nothing asked upstream. SaveGroup resolves each entry
(ResolveAccount, shared with the key's CleanAccounts); share and
import drop them. A group without accounts is as before.

GUI: the group editor's Accounts section, a row per member provider
with two or more accounts, "Any of its accounts" until some are ticked
in the app menu (openPicker multi). Every save sends accounts, since a
save replaces the group. Strings in all five languages.

Gateway keys stay as they are: Gateway › "Gateway keys are for other
computers … added here once Share on local network is on" already says
where, and this case needs none.

Run (mote, through mote-run), at cafed0067 on origin/main 9d08993c8:
- gofmt -l internal/: clean. go vet of access, gateway, provider,
  gui; GOOS=linux -tags nogui and GOOS=windows go vet ./internal/...:
  ok.
- go test -count=1 ./internal/access ./internal/provider
  ./internal/gateway ./internal/gui: access, provider, gateway ok; gui
  red only on TestMainWindowCorners/macOS_26_SDK, red on main too
  (#3949, mote's macOS 27).
- node --test group-*.test.cjs routing-group-*.test.cjs
  routing-save*.test.cjs i18n-keys.test.cjs: 433/434. The one red is
  group-found-skip "webkit de 390px: a provider left out of found
  groups" (the clicks moved the page), filed as #4617 from main; the
  file alone passes 20/20 here and on main 94f6f6092.
  group-accounts.test.cjs is 30/30 (Chromium and WebKit; en, zh,
  zh-TW, ja, de; 1100 and 420px; no scroll on the clicks, no sideways
  scroll, the save carries accounts).
- Earlier, at base 5a0c79ed9: go test -timeout 45m ./... all ok but
  TestVisionBridgePassesLines and TestSettingsSaveKeepsWhatItDoesNot-
  Send (fixed on main by 0b783b1dd and b646a9127; both pass after the
  rebase) and TestMainWindowCorners (#3949).
- The whole GUI suite was cut short twice (a wiped scratchpad, then a
  mote reboot). Its runs at load ~140-220 had about 35 reds, none in a
  file this change touches (account-mask, balance-fix, lan-*, the
  #4617 test among them); not chased here.
- Sandbox HOME on mote, the built binary (`magpie serve`, MAGPIE_ADDR
  on a free port) with a fake upstream answering with the key it got:
  group/work and Work -> sk-work (3 of 3), group/mine and relay/m ->
  sk-mine.

- Rebased again onto 8826a15ea (no file in common): go vet of gui,
  provider, gateway; go test -run 'TestGroupAccounts|TestHeldToGroup|
  TestCleanAccounts|Budget|TestGroup' of gateway, access, provider,
  gui: ok; group-accounts and i18n-keys GUI files: 34/34.

- Rebased onto ec104b862 (trace.go and gateway-routing.md in common,
  merged clean): gofmt clean; go vet of gateway for darwin, windows,
  linux nogui; go test -count=1 ./internal/gateway: ok (640s).

- Rebased onto 2b52302dc, then da275848b (no file in common): go vet ./internal/...,
  the TestGroupAccounts/TestHeldToGroup/Budget tests, group-accounts
  and i18n-keys GUI files: ok, 34/34.

Broken by hand, each red, then restored:
- serve's heldByGroup: three TestGroupAccounts* tests red (sk-mine spent).
- count_tokens' heldByGroupAt: the count_tokens route red.
- planLevel's hold: the nested "outer" group red.
- the editor save without accounts: group-accounts.test.cjs red.

Not tried: a real Codex or OpenAI account (the fake upstream stands
in); a CLI `magpie group set accounts=` (no CLI for it yet); a
provider's own fallback naming a held group has no test of its own
(planFallbackGroup passes the group as hold, the same path as nested).
2026-11-01 21:36:32 +08:00
yetone 0621e70fb9 routing: leave a provider out of the groups magpie finds
chenxiang0010 on Discord asked to keep a provider or a model out of the
auto-created routing groups. A model could already be kept out (remove
its found group; magpie keeps it removed), but a provider could only be
turned off per group or everywhere. Now Routing -> Groups, under "Find
groups on their own", has "Leave out a provider..." (app menu, saved
when it closes) and `magpie group auto skip <provider>...|none`. The
providers chosen (providers.json autoGroupSkip) join no found group; a
group the user made or changed keeps them, a found group left with one
provider goes away, and a request for it is served by AutoStandIn from
a provider still in, and agents on it are reseated (agent.Reseat). A
rename carries the id along. en, zh, zh-TW, ja, de.

Run at 383947fce (this change on origin/main 2ff75161d):
- go test -timeout 45m ./... on mote: 80 packages ok; internal/gui red
  only in its real-window AppKit tests (TestDockJoinLeadsCommandTab,
  TestPanelCloseHidesIt, TestMainWindowCorners, ...), which fail the same
  on fresh origin/main 2f65a33aa on mote (#4125, #2645).
- gofmt -l clean; go vet ./... on Windows (win-run) clean; on Linux
  (wsl-run) clean with -tags nogui (the WSL distro has no gtk4).
- GUI: group-found-skip (new) and group-found-off, all five languages,
  1100px and 390px, Chromium and WebKit on Linux (wsl-run): 24/24. On
  mote every WebKit launch times out (#4125), Chromium 12/12 there.
- The routing files the full run flagged (concurrency 6) rerun alone on
  wsl-run, here and at fresh origin/main 380032cda: click-scroll's
  WebKit case and group-morph's WebKit 420px cases fail the same on
  origin/main. group-duplicate's de case was mine: the found groups'
  new "Anbieter ausnehmen..." line made German taller than the test's
  420x1200 window, which it assumes needs no scroll; it now uses 1400
  and passes 10/10 in both engines.
- Whole GUI suite on wsl-run, concurrency 6: still running at push time
  (5092 ok, 170 not ok so far, mostly in files this change doesn't load:
  account-*, agent-*, connect-*, gui-de/gui-ja's "{agent}" placeholder
  string). They are compared against origin/main after the push.

Broken by hand: foundGroups without unskipped -> TestAutoGroupSkip and
TestGroupsSkip red. Test calls before the fix to groupCmd's args ->
TestGroupAutoSkip red.

Not tried: the real app with real providers; a model-level skip (a
model is kept out by removing its found group, as before).
2026-10-31 00:57:21 +08:00
yetone c46829e0b4 routing: a group's card says its classifier's failure only when that group asked it
jjt on Discord: the Routing card of "claude难易" (group/claude-ny), which
no turn of theirs was sent to, said "分类器3分钟前失败:claude/claude-haiku-5-5:
Claude Code: You've hit your weekly limit", read as magpie asking its
classifier at every turn. The card read the failure by classifier model
(ClassifierFailure), so every group sharing a classifier showed the
failure of whichever group had last asked it.

What runs the classifier was not changed: ruleFor asks it only for a
request whose model is the group (group/<id>, its name, or a stand-in an
agent's config names it by: Claude Code's tiers, Codex's bare name), or
for a group in it its rules or order put first (nestedRules). A request
for another model or group asks nothing. Out of quota, the classifier's
account rests until the reset (restAfter), so later classifier calls get
magpie's held refusal back, at most once each classifyRest (30s), and
do not reach the vendor.

Now ruleFor notes the outcome per group (classifiedFor) and the card
reads GroupClassifierFailure(group, classifier): the classifier's own
words and time (resting or not) from that group's last ask, cleared when
it answers that group, and nothing once the group's classifier changed.

Run (mote, macOS 27, Go 1.26.8), at base 4586307de:
- gofmt -l internal: clean; go vet darwin, GOOS=linux -tags nogui,
  GOOS=windows for ./internal/gateway ./internal/gui: ok
- go test -count=1 -timeout 45m ./internal/gateway ./internal/gui:
  two reds, neither in this change. TestUnroutedHeldReportSaved passed
  5 of 5 alone after; filed #4300. TestMainWindowCorners/macOS_26_SDK
  is #3949.
- -run 'TestClassifierFailure|TestGroupsSayAClassifier': ok
- node --test internal/gui/tests/group-classifier-failed.test.cjs: 20 of
  20 (Chromium and WebKit, both widths, every language)
- Broken by hand: GroupClassifierFailure read by model as before, and
  TestClassifierFailureIsTheGroupsOwn went red ("idle, which nothing
  asked: c/cls: C: classifier down").
Not tried: a real Claude Code account at its weekly limit.
2026-10-29 23:36:58 +08:00
yetoneandtimonwong f561cc5d9b groups: a model unchecked in its provider's list is not a member to route to (#3911)
timonwong (#3911, also on Discord #feedback): with a group of a/x and
b/x, unchecking x in provider a's model list struck a/x on the Routing
page, but group/<id> still sent requests to a. membersOff resolved each
member through resolveIn, whose provider/model step takes any model of
a provider that is on, so that a request can name a model its list
lacks.

membersOff now skips a member whose provider has picks and whose served
models lack it (unpicked), as timonwong's fork did (38615ca9). A
provider with no picks still routes a model its list lacks (#2642), a
decision model (never in the catalog) is still a decision group's, and
a request naming a/x itself still reaches a. Every route mode goes
through membersOff (ordered, weighted, rotate, manual, nested groups,
found groups, count_tokens' group lookup), so all of them get it. The
entries map is built only when a member's provider has picks.

The Routing card's memberInfo (gui/groups.go) used Resolve too, so a
manual group's pick row showed an unchecked member as ready; it now
asks provider.ResolveRoute, the same check, and the group is not ready
when its picked member was unchecked.

Tests: group_model_pick_test.go (ordered, weight, rotate; nested; a/x
named directly still served; checked again comes back; a decision
group keeps a picked decider) and gui's
TestGroupMemberUncheckedInItsProvider.

Run (mote, at this tree plus the next commit):
- Red on c30e2a645 with only the tests: the three route modes, the
  nested case and the GUI test fail ("from ka"); direct and checked
  again pass, as they should.
- Broken by hand: without len(p.Models) > 0, seven gateway tests go
  red (TestNativeCompactionWriterThroughAGroupWhoseListLacksTheModel,
  TestCodexSpentMovesToNextGroupMember, TestWeightedGroupGivesALowGroupItsShare,
  TestVideoGroupMovesOnToTheNextMember, TestPolicyRefusalMovesToNextGroupMember,
  TestCodexSealedAgentHandoffGoesToGroupsChatGPTAccount,
  TestClaudeClientCacheGroupKeyKeepsMarks); without !DecidesModel,
  TestDecisionGroupKeepsAPickedDecider goes red.
- go vet (darwin, GOOS=linux, GOOS=windows) on provider, gateway, gui:
  clean; gofmt -l clean.
- go test -tags nogui -timeout 45m ./...: 76 packages ok; one red,
  internal/plugin TestGatewayHookMixedPiPackage "starting plugins:
  context deadline exceeded" at load ~134 (#2865, filed); it passes
  alone on the same tree (26s).

Not tried: the real GUI app with a real provider; no GUI JS changed,
so the Playwright suite was not run.

Co-authored-by: timonwong <timon86.wang@gmail.com>
2026-10-28 17:34:16 +08:00
yetone ca8a6f346a agent: a renamed routing group moves its agents, and the Codex app reloads a changed catalog
lucis0116 on X: renaming a provider or a group in magpie didn't reach
every agent.

Display names already reached the agents' files: store and SaveGroup
drop the catalog, and SyncCatalog writes the new "<model> · <name>" and
"<group> · routing group" labels into Codex's model_catalog_json, Claude
Code's picker, OpenCode and Pi (checked in a sandbox HOME). Two gaps
were left:

- A routing group given another id (Routing page, `magpie groups
  rename`, TUI) left every agent on group/<old>, which magpie no longer
  has. The CLI even said "agents set to group/from need group/to now".
  agent.RenameGroup now moves each agent field on group/<old> to
  group/<new>, spelled as the agent spells it. It goes through
  renameRefs, the move RenameProvider already made, now shared by both,
  then SyncCatalog. The GUI, CLI and TUI call it in place of
  provider.RenameGroup.
- The Codex app's own app-server reads model_catalog_json only as it
  starts, and KeepCodexAppOnItsProvider restarts it only when
  codexAppRoute changes. The route named the catalog's path, not what
  the file holds, so a renamed provider or group, or a model added,
  stayed on the old list until the user quit the app. The route now
  carries a hash of the catalog's bytes (codexCatalogTag, read again
  only when the file's size or time changes). The restart goes through
  the existing idle gate: no Codex request in flight, 10s idle, no turn
  open. A write of the same bytes is no change.

Run, in a sandbox HOME only:
- TestRenameGroupMovesTheAgentsOnIt (new): Codex, Claude Code, OpenCode
  and Pi on group/smart, renamed to clever: each said moved and each
  file on group/clever, none naming group/smart.
- TestCodexAppRouteFollowsTheCatalog (new): the route changes when a
  renamed provider rewrites the catalog, and stays put when the same
  bytes are written again.
- Broken by hand: RenameGroup's match turned off makes the first test
  red (no agent moved, every file on group/smart). The catalog line
  dropped from codexAppRoute makes the second red ("a provider renamed
  left the Codex app's route as it was").
- At aded9beea (base ad3833512): go test -tags nogui -timeout 45m
  ./internal/agent ./internal/cli ./internal/gui ./internal/tui
  ./internal/provider -count=1: cli, gui and tui ok. agent red on
  TestFolderVarsAreListed (#3884, red on main since e4552cca9) and
  TestCodexDisconnectStaysWithAccountsOn/login=api, which passed 3 of 3
  alone and isn't on this path (filed #3891). provider crashed in
  TestUnreadLoginsWriteErrorsKeepCredentials with "close of synctest
  channel from outside bubble" in filememo.Forget (#3632, open on main).
- Rebased on 56de2d192 (a312bf3e3 adds a switched account's app-server
  to the same stale set; no overlap): go test -tags nogui -count=1
  ./internal/agent -run 'Rename|CodexApp|Sync|Group|Codex|Hermes' ok
  at this head; ./internal/provider -run
  'CodexApp|Group' ok at a312bf3e3 + this change. The disk was full (other sessions' suites), so the
  whole of each package wasn't run again at this head.
- GUI: group-id-dots, group-morph, agent-model-groups and i18n-keys,
  32 of 32. No GUI script changed, and the GUI tests answer the API in
  memory.
- gofmt -l clean. go vet -tags nogui on agent, cli, gui and tui for
  darwin, linux and windows: ok.

Not covered:
- Claude Desktop reads the gateway's model list only as it starts. It
  still needs its Restart button (AppBehind) after a rename, as after
  any other catalog change.
- Pi, omp and StepCode enabledModels: RenameRefs renames magpie/<old>/
  provider entries only. A group's magpie/group/<old> entry goes as
  scope-gone, and the pick of group/<new> is added again. Not checked
  entry by entry.
- Codex signed in beside magpie (models_cache.json aged by the catalog
  tag) was not run again here.
- No real Codex app restart was watched. The reporter's agent isn't
  named.
2026-10-27 18:22:29 +08:00
yetone c888ef2725 routing: a rule's hours are kept in the zone they were set in (gaubeebangeel on X)
magpie on a cloud server in UTC read a routing group's rule hours on the
server's clock, so a Beijing user's 09:00-18:00 held at 17:00-02:00
Beijing time, with nothing saying so.

- provider.TimeWindow carries the IANA zone its hours were set in
  ("zone": "Asia/Shanghai", omitempty). Holds reads From, To and Days in
  that zone (time.LoadLocation, cached; Go's embedded tzdata, so Windows
  knows them too). A window with no zone, every one saved before this,
  stays on magpie's own clock (time.Local) as before. A zone magpie
  doesn't know is refused on save (clean); one in a file edited by hand
  makes the window never hold, so the rule is as if absent, never always
  on and never hours off. Text() adds " (Zone)"; Line() writes tz=.
- GUI: changing a rule's hours or days in the editor saves the browser's
  zone (Intl resolvedOptions().timeZone); hours left alone keep theirs.
  /api/groups gives magpie's clock (clock: zone, offset in seconds), and
  when its offset differs from the hours' zone the Routing page tells the
  zone beside them, on the group's rules and in the editor: "Asia/Shanghai
  time" (zh "Asia/Shanghai 时间"), or "server time, UTC+0" (zh "服务器时间
  UTC+0") for hours with no zone. Nothing is added when the clocks agree.
  zh, zh-TW, ja, de.
- CLI and TUI: time=09:00-18:00@Asia/Shanghai or tz=Asia/Shanghai; with
  none, this computer's zone ($TZ, time.Local, the /etc/localtime link)
  when it has an IANA name, otherwise none (magpie's clock). An unknown
  zone is refused with what one looks like; tz= alone needs time= or
  days=. Usage text updated.
- docs/subsystems/gateway-routing.md: the zone rules.

Older magpie reading a shared or synced group ignores zone and reads the
hours on its own clock, as before.

Run in a sandbox HOME with pinned Go caches, first at base 9277c2567,
then again after the rebase onto origin/main d58053720 (vet, builds, the five packages,
routing-time-zone and i18n-keys all ok again there; then rebased onto
11907448e, which changes migrate_side.go and sessions only, and
internal/provider ok again, 139s):
- gofmt -l on the changed files: nothing. go vet ./..., GOOS=linux go vet
  -tags nogui ./..., GOOS=windows go vet ./...: clean. go build, GOOS=linux
  go build -tags nogui, GOOS=windows go build: ok.
- go test -timeout 45m -count=1 ./internal/provider ./internal/cli
  ./internal/tui ./internal/gui ./internal/gateway: all ok (provider 170s,
  cli 64s, tui 30s, gui 192s, gateway 513s; after the rebase 180s, 62s,
  25s, 181s, 568s); logs kept whole and grepped, no FAIL.
- New tests: TestRuleTimeWindowInItsZone (window, past midnight and days
  in a zone, instants in UTC), TestRuleTimeWindowWithoutZoneIsLocal,
  TestRuleTimeWindowUnknownZone, TestParseRuleTimeZone, TestRuleInZoneHere,
  TestGroupRuleTimeZoneCmd, TestRuleTimeWindowInItsZoneAtTurnStart
  (gateway, ruleClock in UTC). Run under TZ=UTC, TZ=Asia/Shanghai and
  TZ=America/Los_Angeles: ok. The zone used is Asia/Shanghai, or
  America/New_York on a computer on Beijing's clock, so they are red on
  any machine.
- GUI (playwright 1.62.0, chromium and webkit): routing-time-zone (new:
  en, zh, zh-TW, ja, de, 420px wide, browser in Asia/Shanghai, server in
  UTC and in Asia/Shanghai) 14 of 14; routing-time with the browser in
  Asia/Shanghai, the typed rule saved with its zone; routing-time-went,
  routing-day-window, routing-save, routing-rules-line, i18n-keys: ok;
  TestCoreScriptBudget ok.

Broken by hand: Holds reading at.Local() instead of the zone made
TestRuleTimeWindowInItsZone red under TZ=UTC (Shanghai's 10:00 not held,
18:00 held) and under TZ=Asia/Shanghai (with New York), and
TestRuleTimeWindowInItsZoneAtTurnStart red (10:00 Beijing went to the
group's order). routing-time-zone.test.cjs run against origin/main's
client is red (no zone told beside the hours).

Reds not from this change, the same on an untouched origin/main 99de8e1ad
worktree: routing-pause chromium 7 of 7 (#3410); routing-time webkit "Add
a rule" outside the viewport, 1 of 3 runs on main too (#3465);
routing-rules-line webkit zh 1100 once under load, passes alone on both
(#3593, filed now).

Not tried: a real cloud server in UTC with a browser in Beijing (the GUI
test sets the browser's zone and the server's clock instead); the Windows
box; the whole GUI suite.
2026-10-25 18:18:02 +08:00
yetone 4f6498f822 routing, usage: an account renamed in magpie reads by its new name (magpie-community/plugins#310, molvqingtai)
molvqingtai renamed a Kiro (plugin) account from "example@gmail.com (foo)"
to "example@gmail.com (bar)", and the Routing page kept saying "(foo)" on
every request made after. Cause: the Routing page never looked up the
user's name at all. A trace's `who` is the vendor's account name
(Weighed.Who), and plugins/routing/client.js showed it as it was. Usage
records (ProviderAccount) keep the vendor's name the same way, and the
Usage page's Accounts, the request log's Account filter, `magpie usage`,
a gateway key's accounts (AccountNames, /api/caller-keys) and Routing's
"Several accounts" pools (onOf) all showed it raw too. This affected
built-in and plugin providers alike.

Records still keep the vendor's name. It is the key the user's name is
stored under (providers.json AccountNames, in lower case), so it stays
the identity: Routing still groups and ranks by `who`. The name is looked
up when it is shown: provider.AccountShown / AccountShownOf /
AccountRef.Shown in Go, and userShown (accountNameOf over /api/providers'
accountNames) on the Routing page. So requests from before the rename
read by the current name too, and a cleared name goes back to the
vendor's. A key's name and an unnamed account read as before.
Already right before this change: quota cards and the menu bar (Alias),
`magpie accounts`, and the editor's account row.

Record for this push: 13 commits on origin/main ca4a1cde0, head tree
539c84e92. Go 1.26.8, sandbox HOME, GOMODCACHE/GOCACHE pinned. The full Go
run and vet were at tree d6393dfc8, the same Go code as this head: only
app.js comments (cut under the core script budget) and one ja string
changed after it.
- gofmt -l: nothing. go build ./...; go vet ./... (darwin), GOOS=linux
  go vet -tags nogui ./..., GOOS=windows go vet ./...: clean.
- go test -timeout 45m ./..., through tee, one suite on the machine:
  68 packages ok. The one red was internal/gui's
  TestCoreScriptBudget: app.js 1,335,314 > 1,335,000, since main grew
  app.js under the stack. The autoscroll commit's own comments were cut
  (to 1,334,629) rather than the budget raised, and go test -count=1
  ./internal/gui is ok at this head (113s). Packages the run took from
  Go's test cache had the same inputs.
- GUI: the 18 files this stack touches or names, both engines,
  202 of 204 pass (tree 068acf128, this push less the last commit). The
  two reds: gui-ja, red on main since c2636b7b5 and fixed by this push's
  last commit (gui-ja and i18n-keys 6 of 6 there), and usage-fold's
  chromium "several accounts" (#2163, red on main the same way).
- Red on the old code: TestAccountNameOfAPluginAccount, with
  AccountNames put back to a.User, fails with "a gateway key's accounts
  read [fakeco/31****36@qq.com]". The new GUI test
  routing-account-name.test.cjs, with the old client.js, fails with
  "renamed, the account reads by its new name: Kiro example@gmail.com
  (foo) Pro".
- routing-account-name passes, en and zh, both engines. internal/provider,
  internal/usageapi, internal/cli and internal/gateway ok.
- The five usage files this change's first run found red: usage-agents-hide
  (#2276), usage-checkin (#3091), usage-fold (#2163) and usage-ledger
  (#3104) are red alone at the stack and on main the same way.
  usage-overview-fold now passes alone at both.
  The whole GUI suite ran at 1c1fc7183 (this stack's first 12 commits on
  0ddcf28a1): 11713 of 11769 pass. Each of the 21 red files was then run
  alone at the stack and at origin/main 8278fd9b0. Eight are red the same
  way on main: plugin-card-update (#3079), quota-count-wrap and
  quota-name-translated (#2228), s3-sync (#2448), usage-agents-hide
  (#2276), usage-checkin (#3091), usage-fold's chromium "several
  accounts" (#2163), usage-ledger (#3104). The other 13 pass alone on both
  and were red only under that run's load (50 to 335): currency #3101,
  plugin-github #3218, provider-fetch-again #3292, rest-try-now #2564,
  routing-auto-reset #3293, routing-keys-fold #1612, routing-steady #1804,
  routing-wb-restricted #1905, sessions-folder-delete #2218,
  sessions-manage #3294, switch-only #3295, text-size #1866, usage-pack
  #3296.

Not tried: a real Kiro account. The fixture is the reporter's case, with
their names.
2026-10-23 01:58:01 +08:00
yetone 81a24cf8fe groups: a found group is listed as auto/<model id as the vendor spells it>
ZeroClover asked on X: Auto Group ids group/auto-<slug> can't be looked
up on models.dev. A found group is now listed and written as
auto/<model>, e.g. auto/claude-opus-5.5: /v1/models, the catalog, agent
configs, the GUI's Routing page and the CLI. Context and output limits
come from the model's metadata as before.

What stays the same:
- The internal id is still group/auto-<slug> (Group.Ref() gives the
  public one). Every old form is still accepted as input forever:
  provider.CanonicalRef turns auto/<model>[:level][[1m]] into it at the
  gateway (validateModel), keys, stats, affinity and usage, so both ids
  route to the same group and count as one.
- A key's model list allows a model by either id, group/* included
  (allows() in key_models.go).
- Hand-made groups stay group/<id>.
- A provider whose stored id is "auto" keeps its models: while one
  exists, found groups are listed by their old id (AutoRefsOn) and
  auto/<x> means that provider's model. Documented in
  docs/subsystems/gateway-routing.md.

Agent configs: SyncCatalog rewrites a field that holds a found group's
old id (renameFoundGroups), but only while the value is still what
applied.json says magpie wrote; a value the user set stays. A pick by
the old id written now is written as auto/<model> (Apply). Hidden,
picked and ordered model lists saved by the old id hold for the new one
(visible.go), and a bare model id still reaches its found group (bare.go).

Claude Code is given a dotted Claude version dashed (ClaudeSpelled), so
auto/claude-sonnet-4.5 sits in its settings as auto/claude-sonnet-4-5.
That routes to the same group, but with found groups off nothing reads
it back dotted, and Reseat took the field for changed and left the agent
on a group that was gone. Reseat now compares a group pick by its
canonical id (samePick). The old ids had no dots, so this is new with
auto/<model>.

Run at this tree (sandbox HOME, caches pinned):
- gofmt -l: clean. go vet ./...: clean on darwin, GOOS=linux -tags
  nogui, GOOS=windows.
- go test -p 4 -timeout 45m ./...: every package ok except agent and
  gateway, whose failures were the tests' expected ids (updated here)
  and two regressions now fixed (bare ids; desktop models hiding groups
  by prefix). Every failing test passes on rerun. Load average was
  ~210-290 from other sessions throughout.
- Reruns: provider, cli, codexcat ok. internal/gui: only
  TestSetAnswersWhileDevinAndProvidersHang fails (set slow/slow-1 took
  10.19s), and it fails the same in a git-archive export of 33dbdcc52.
- agent and gateway in full, -p 2 -timeout 120m: gateway ok (2996s).
  agent failed four tests that still expected the old ids
  (TestOmp/PiModelsAskedOnTheirNativeAPI, TestReseatFoundGroupsOff,
  TestReseatKeepsAFoundGroupWithAProviderOff); updating them showed the
  Reseat bug above. After the fix, go test -count=1 -timeout 120m
  ./internal/agent/: ok (1000s, load ~160-220).
- GUI files the change reaches, chromium and webkit: group-found-off and
  the routing files pass, except routing-bodies, routing-model-rest,
  routing-keys-fold and routing-request-metrics, which fail the same with
  33dbdcc52's JS.

Broken by hand and watched red, then restored: CanonicalRef in
validateModel (both-ids routing test), allows() (key tests both ways),
the Save refusal and AutoRefsOn checks in Ref/CanonicalRef (provider
named auto), catalog.Lists' preference (models.dev lookup of the part
after auto/), renameFoundGroups' applied.json check and its SyncCatalog
call (user values kept), PublicRef in visible.go, the codexcat prefix,
samePick in Reseat (TestReseatFoundGroupsOff: opus left on the gone
group).
TestBareModelIDsShared was red before the bare.go fix.

Not verified: no real agent, vendor or models.dev client run; no run on
the Windows box. Settings pickers (vision, title model) holding a saved
group/auto-... value may show it as saved. codexcat can't tell a stored
"auto" provider apart, so its models lose the "text only" hint. The
pre-existing reds above are not filed.
2026-10-20 00:18:51 +08:00
yetone fa5295d011 panel: a Manual routing group's model is switched from the tray panel (#2489)
Jerell.OvO asked on Discord (#general) to change a Manual group's model
from the tray's dropdown. Until now that worked only on the group's card
on the Routing page or with `magpie group pick <id> <model>`.

- provider.PickGroup(id, pick) sets a Manual group's Pick and nothing
  else. It refuses a group that doesn't route by hand, a model not in
  the group, and an unknown or hidden group.
- POST /api/groups/pick {id, pick} calls it and answers with the groups'
  state. The panel doesn't send the whole group back the way the card's
  save does, so a stale panel copy can't overwrite an edit made on the
  Routing page in the meantime.
- Tray panel, Routing tab: under today's totals, one row per Manual group
  of two or more members that is on. The row has the group's name and its
  picked member as a sess-pick button. The button opens the app's menu
  (openProtoMenu, no native select), headed "Model every request goes
  to". It lists the members with the card's notes ("fast", the provider,
  and "no provider serves it now" for one not ready), and the picked
  member is ticked. Picking the ticked one posts nothing. No new layout,
  no left border.
- The tab reads the groups again when it is shown, and loadGroups redraws
  the panel. A pick made on the Routing page or from the CLI shows here.
- New string in zh, zh-TW, ja, de.

Tests:
- TestPickGroup (provider): switches and routes to the new member, keeps
  the rest of the group, refuses the three cases and changes nothing
  then. Red with the `g.Pick = pick` line removed.
- TestGroupsPick (gui): /api/groups/pick answers with picked = the new
  member and refuses a non-member.
- panel-routing-pick.test.cjs: a 440px panel in Chromium and WebKit, in
  en, zh, zh-TW, ja and de. 10/10 pass. Red with the row left out of
  renderPanel. Screenshots were checked in de (web) and zh-TW and en
  (app).
- gofmt -l clean; go vet -tags nogui for darwin, linux and windows: clean.
- GUI subset (panel-*, routing-*, i18n-*, header-relang,
  agent-notice-lang; 1199 cases) on 63be47717+this: 1175 pass. Each red
  was rerun file by file on this head and on a clean 63be47717 worktree.
  routing-bodies (10, also red alone on main): #2559. routing-keys-fold:
  #1612. routing-model-rest: #2115. routing-request-metrics (webkit):
  #2571. Those three are red the same on 63be47717. routing-effort-change,
  routing-flood and routing-wb-restricted pass alone on both. None of
  these open the tray panel, and the new code runs only there.

Full suite: `go test -timeout 45m ./...` under set -o pipefail with a
sandbox HOME, on 63be47717+this, load 250-300: 63 packages ok. Red:
internal/agent past 45m (#2544), internal/gateway past 45m (#2108),
TestAgentGoneInTheRetryPause/group_replan (#2543), TestIntentClassifierGroup
(#1813), TestMainWindowCorners (#1936). Each named test passes alone on
this head. A rerun of agent, gateway and gui timed out again in agent and
gateway, with TestMainWindowCorners again the only gui red. The earlier
TestPanelJoinsFullScreenSpaces red is gone after 63be47717. Rebased onto
b2764f7f9, which has six later commits that touch none of these files.
The targeted tests above were rerun there.

Rebased again onto ba132d68b (seven later commits, none touching these
files; one changes app.js). Rerun there: TestPickGroup, TestGroupsPick,
panel-routing-pick.test.cjs 10/10, gofmt -l clean.
2026-10-16 20:03:29 +08:00
yetone 8e8316ed2f provider, gui: a routing group's pickers offer OpenRouter's decision models only as the provider's picks say (coeo91 on Discord)
coeo91 picked two free OpenRouter models, and a new routing group's member
picker showed those two and then a run of others. Those were OpenRouter's
decision models (liquid/d1, pplx-decider, jev-latest and the rest of its
output_modalities=decisions list): Deciders() took decideModels() for a
provider that lists its decisions (OpenRouter, oMLX, MLX-Serve), Bailian,
a remote magpie or a plugin, whatever its picks, while the provider editor
draws the same models as unpicked chips.

OfferedDeciders is what a group's pickers offer: with picks saved, only
the picked decision models plus any a group already names as a member or
classifier (so a group made before reads the same); with no picks, every
one, as before. /api/groups' deciders (member and classifier pickers),
the templates and the TUI's member picker use it. Deciders() is
unchanged, so the gateway still lists every decision model to a remote
magpie (X-Magpie-Deciders) and RouteDecider still answers an unpicked one.
docs/subsystems/providers-accounts.md says which is which.

Run in a private GOCACHE and sandbox HOME:
- the new TestOpenRouterDecidersOfferedAsPicked passes; with the pick
  filter turned off by hand it fails ("chat models picked, offered:
  [pplx-decider-v1-27b liquid/d1 jev-latest]").
- go test ./internal/provider -run 'Decide|Decider|OpenRouter|Template|
  RemoteMagpie|Bailian|OMLX|Omlx|MLX': ok.
- go test -tags nogui ./...: every package ok except internal/library,
  which hit the 10m timeout with the machine at load ~150 (stacks in
  mcpauth flow.end sleeps; nothing here touches library). Rerun alone
  at the same load with -timeout 25m: ok in 252s, 285 tests passed, the
  slowest TestAgentMCPFiles at 33s, so the 10m was the whole suite's
  load on this box, not a hang.
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows;
  GOOS=linux -tags nogui and GOOS=windows builds.

After rebasing on origin/main 924f62e90: provider, gui, tui ok; gateway
ok alone with -timeout 28m in 1129s at load ~100 (it hit the 10m default
beside the other three packages; it passed in the full run before).

Not run: the Playwright GUI suite. internal/gui/assets is unchanged and
those tests mock /api/groups, so they can't see this server-side list.
Not tried against the real OpenRouter API or in a running GUI; the fake
OpenRouter serves its real decision-list shape.
2026-10-15 02:00:44 +08:00
yetone 08b1a60c03 gateway, gui: a routing group whose classifier fails says so on its card, and the log says why (#1929, versun)
What changed: the gateway keeps, per classifier model, why it couldn't
say the last time it was asked (an error from the request, or an answer
that was no number of the list) and when, until it answers again
(gateway.ClassifierFailure). The first failure, and each one that says
something new, is written to the log once ("routing: the classifier X
couldn't say: ..."). /api/groups sends it as a group's classifierFailed,
and the group's card on Routing shows a line "Classifier failed 3 min
ago: <why>" with an amber dot (no stripe); its title says that until the
classifier answers, no rule with an intent matches and turns reason as
the agent asked. Strings in en, zh, zh-TW, ja and de.

Why: versun's MLX-Serve answered its Clef decision model, asked as a
chat model, with a 400. The only place that said so was each request's
own details; the group's rules with an intent quietly never matched,
which read as the routing working. The preset itself is fixed in the
commit before this one (versun's, cherry-picked).

Run:
- go test: TestClassifierFailureIsKept (gateway: a 400, kept while
  resting, "not a number", cleared by an answer) and
  TestGroupsSayAClassifierThatFailed (gui: only the failing group's JSON
  has classifierFailed). Each went red with its line removed by hand
  (the record in classify(), the fill in groupsState).
- group-classifier-failed.test.cjs: chromium and webkit, en zh zh-TW ja
  de, at 1100 and 420: 20/20; with classifierFailed dropped from the
  fixture's reading in groupRow, 10/10 of one engine red. i18n-keys
  passes.
- go test -tags nogui ./internal/provider ./internal/usage ./internal/cli:
  ok. ./internal/gateway hit the 10m default timeout at load ~150-190
  (other sessions); rerun with a longer timeout before the push, below.
- go test ./internal/gui: TestDockJoinLeadsCommandTab (Command-Tab order
  had kitty in front) and TestMainWindowCorners (measuring killed under
  load) failed; both are desktop-window tests this change doesn't touch.

Not verified: a real MLX-Serve; versun ran his own.
2026-10-13 16:34:59 +08:00
yetone 3cd55f6547 images: a ChatGPT account lists one GPT Image, said to be ChatGPT's pick (#1865)
Settings › Models › Image generation offered "GPT Image 2 · Codex" and
"GPT Image 2.5 · Codex". chatgpt.com/backend-api/codex/images/generations
ignores the model (and size): tested with the owner's Pro account, it
answers gpt-image-2, gpt-image-2.5, gpt-image-2.5-sunburst and a made-up
"x" with 200 and the same image (#1865 comment 6131731318), as 3a18ec8e
already suspected. The picker implied a choice that doesn't exist.

What changed:
- gateway: codexDrawers is one entry, gpt-image-2 named "GPT Image" (what
  Codex CLI asks for). VendorPicksDrawer(p) marks a ChatGPT account.
  ListedDrawer(ref) maps any gpt-image-* picked on a ChatGPT account
  (a saved codex/gpt-image-2.5) to that entry, for display only.
  drawsFamily still lets a named or saved gpt-image-2.5 draw there.
- gui: /api/settings sends imageGenShown when the saved ImageGen stands
  for another listed entry, and vendorPicks on the ChatGPT entry. The row
  shows and ticks the entry, picking it again saves nothing (the saved
  value is never rewritten), its option note and a line under the row say
  ChatGPT's image backend picks the model itself. en/zh/zh-TW/ja/de.
- Aside: magpie/codex/gpt-image-2.5, picked when it was offered, is still
  taken as an image model (asideImageOffered maps it via ListedDrawer).
- An API key's gpt-image-2.5 (OpenAI, relays) is listed and drawn as
  before: there the model field matters.

Checked: no doc, site page, MCP tool description or CLI lists these ids.
The remote-magpie list (drawerObjects) follows Drawers and now lists one.

Run, at this head:
- New tests failing on the old code: TestCodexListsOneGPTImage ("codex
  lists [gpt-image-2 gpt-image-2.5], want only gpt-image-2") and
  TestCodexAccountDraws with the old codexDrawers;
  TestAsideCodexOneGPTImage ("magpie/codex/gpt-image-2.5 not offered")
  without the aside mapping; TestImageGenCodexOneEntry ("shown \"\"")
  without the api.go wiring; images-codex-one.test.cjs with the old
  app.js (button "codex/gpt-image-2.5", not "GPT Image · Codex").
- go test -tags nogui ./internal/gateway ./internal/gui ./internal/agent
  ./internal/catalog ./internal/provider under a sandbox HOME: ok.
- gofmt -l (empty), go vet ./..., GOOS=linux go vet -tags nogui ./...,
  GOOS=windows go vet ./..., go build, GOOS=linux go build -tags nogui,
  GOOS=windows go build: clean.
- Playwright (1.62.0), chromium and webkit: images-codex-one (en, zh,
  zh-TW, ja, de at 1000px; en, zh at 360px), images-missing, vision-mcp,
  searcher-pick, routing-vision-why, i18n-keys: all pass.
Not run: the full go test ./... and the whole GUI suite; no new request
was made to chatgpt.com (the backend's behaviour is the #1865 test).
2026-10-13 04:27:40 +08:00
yetone 60808fd9cf usage, gateway, gui: magpie's own requests are told apart from the agent's, and a classifier on a subscription says it asks it every turn (#1839)
kensenzhao saw a subscription's allowance spent by requests the agent
didn't make: a routing group's classifier, set to a subscription's model,
asks it as every turn begins, and those calls looked like the agent's own.

What changed
- usage.Group has an own share (calls, tokens, cost) of the calls magpie
  made by itself, filled for models, keys and accounts. Record.ByMagpie
  is the test: agent "magpie", or one of its own User-Agents
  (magpie-router/1, magpie-search/1, magpie-vision/1) where the agents
  aren't loaded. The calls still count in the group's totals, as they
  went to the same key or account. A group with none sends no "own".
- The classifier's calls are Kind "routing": callKind marks RouterAgent's
  requests, and the decision model's record (Jev / System One) is written
  with it. A "Routing classifier" purpose names them in the ledger.
- Usage page: magpie's row among the agents and its ledger rows carry a
  "magpie's own" mark; an account's, key's or model's row adds "{n} by
  magpie itself"; an account's card says how many of the period's
  requests were magpie's own, drawn again once the summary arrives after
  the allowances.
- Routing page: /api/groups marks a model a subscription account serves
  (modelRef.Sub, servedRef). Beside a classifier on such a model, or a
  group whose first member is one, the editor says every turn starts
  with a request to that subscription, two when it picks both intent and
  effort in words. A classifier on a key or a free model says nothing.
- New strings in zh, zh-TW, ja and de. The mark is a muted chip with an
  even border all round (no left stripe).

Tests
- TestSummaryCountsMagpiesOwnCallsApart, TestByMagpie (usage).
- TestIntentRoutesATurn and TestJevPicksTheIntent (gateway) now check
  the classifier's records are Kind routing and magpie's own, and the
  agent's records are not.
- TestServedRefSaysASubscription (gui).
- own-requests.test.cjs: Chromium and WebKit, 1100 and 390 wide,
  en/zh/zh-TW/ja/de, the API faked; no click scroll, no sideways page.
- Broken by hand, each turned its test red: addOwn counting nothing;
  callKind's routing case removed; decide.go's Kind blanked; the ledger
  mark, the agents' mark, the "{n} by magpie itself" line, the card's
  line, its redraw after the summary, the Routing hint, its group case
  and modelRef.Sub each removed.

Run: gofmt -l; go vet on darwin, linux -tags nogui and windows; go test
for usage, access, catalog, gui (-tags nogui) and gateway in full; the
GUI tests above, the ledger, routing-intent and translation tests.
Not done: the warmups (warmClaude/askClaude) write no usage record at
all, so they can't be marked; that is left as it was. Not tried with a
real subscription classifier against a live account.
2026-10-13 01:41:50 +08:00
yetone 5e7efce3bc gateway: a key held to some models gets its model list as fast as one held to none, its groups read once a list, not once a group (#1762, LumenXY on X)
LumenXY's /v1/models over Tailscale took 12.4s with a gateway key held to
some models and 1.5s with an unheld one, so apps that list models timed
out and showed an empty list.

Cause (pprof, 1,000 models, 500 found groups): keyAllowed checked each
catalog entry on its own. Each group entry called provider.FindGroup,
which builds a new GroupFinder, so every provider's models were read again
(providerEntries, its files stat'ed and settings loaded) once a group.
That was 96% of the request. Each glob in the key's models was also
compiled to a regexp on every check, and a key held to accounts listed
each provider's accounts (Logins, from disk) once a model.

What changed:
- gateway/key_models.go: keyAllowed weighs a list through a keyList made
  for that request alone. It has one GroupFinder and each provider's
  AccountIDs read once. entryAllowed and accountServes are the same
  checks over them. accountServes(who, p, model) stays for decide.go's
  single check.
- access/models.go: globRe keeps each pattern's compiled expression. A
  pattern compiles to the same expression whatever key holds it, so
  nothing kept goes stale. The map is let go of whole past 4096 patterns.
- gui/groups.go: groupsState (the Routing page) called FindGroup once a
  group too, the same class. It now uses one GroupFinder.
Every route that lists models goes through keyAllowed: /v1/models,
/v1/models/{id}, /v1beta/models, /v1/codex/models, Muse's list and the
deciders. The single-model checks (serve, count_tokens, embeddings,
System One, draw, video) ask one group and are unchanged. Nothing is kept
past a request, so a change to a key's models or accounts, a group's
members or an account's own models shows on the next request. No key
limit is loosened. The documented behaviour is unchanged, so no subsystem
page changes.

Tests:
- TestKeyListShowsWhatItDid compares keyAllowed with the old per-entry
  check, kept in the test, for 14 keys over a catalog with found groups,
  named and nested groups, a no-key provider and an account's own models.
  The keys cover exact ids in any case, globs, group/<id>, group/*, a
  group inside one named, accounts, and models with accounts.
- TestKeyListSeesChangesNextRequest goes through /v1/models and
  /v1beta/models on one server while the key's models, the group's members,
  the key's accounts and an account's models change.
- TestModelPatternsKeptCompiled checks each pattern keeps its own
  expression and that past the cap works.
- Broken by hand, each went red: the accounts memo shared across providers
  (ShowsWhatItDid), the GroupFinder kept across requests
  (SeesChangesNextRequest), and the glob cache keyed by the pattern's first
  letter (KeptCompiled).

Numbers, BenchmarkHeldKeyListsModels (2 providers x 500 models, 500 found
groups, M4 Pro):
- held to models: 2.36s before, 55ms after
- held to accounts: 2.35s before, 60ms after
- held to none: 43ms either way

Real use: sandbox magpie on 127.0.0.1:3486 with its own HOME, the same
1,500-entry catalog, a key held to 5 patterns, and curl 3x each:
- held key, /v1/models and /v1beta/models: 27.8-28.7s before, 0.18s after
- unheld key: 0.12s either way
- The held list (212 entries) and the unheld one (1500) were
  byte-identical between the old and new builds.
- Changing the key's models while the server ran showed on the next
  request (10 entries, then 212 again).

Run at origin/main 8f2a314cf:
- go test ./...: every package ok (49), no FAIL
- go test -race -count=3 on the access tests and -count=2 on TestKeyList*,
  TestGatewayKeyModels* and TestGatewayKeyAccounts*
- gofmt -l and go vet ./... (darwin, GOOS=windows); GOOS=linux go vet
  -tags nogui on access, gateway and gui
2026-10-12 16:53:15 +08:00
yetone eed5a6a829 provider, gateway, gui: a GPT model on a provider you added can be switched fast in Routing and the picker (#1615, iomect)
iomect: "目前只有官key可以开启快速模式, 希望在路由设置中 支持给供应商也开启快速模式".
Fast mode (OpenAI's service_tier "priority") was offered only on a
ChatGPT account, an OpenAI key, Cursor and an Anthropic key's Opus. A
relay or sub2api the user added themselves had no toggle, though Codex's
own Fast already reaches such a provider as asked (OwnTier, #1234).

What changed
- provider.OwnFast: a GPT/o-series model (by its slug, openai/GPT-x
  too) on a provider the user added by its address (no preset, no
  account, no plugin, not a cloud), served on an OpenAI API (Chat or
  Responses), not OpenAI's own host. CanFast now includes it, so the
  Routing group member toggle and the agent picker's bolt offer it.
  Nothing is on by default: it is sent fast only when the user switches
  it.
- gateway: such a member or pick is asked for service_tier "priority"
  on the provider's Chat/Responses API whatever API the agent spoke. An
  Anthropic-speaking agent gets it through the translated request
  (forwardTranslated, via a ctx mark), and Claude's speed "fast" or its
  beta is never sent to the user's provider (a relay may turn it away).
  A provider that turns service_tier away is asked again without it and
  not sent it again (the existing optional-field refusal path, keyed per
  provider and protocol).
- gui: canFast members/models carry ownFast; the toggle's and the bolt's
  titles say fast is asked of the provider, "where your provider serves
  it", in en/zh/zh-TW/ja/de.

Not done: a provider's Claude model is not sent Claude's fast mode (no
way to know a relay serves speed "fast"), and no relay is special-cased.

What was run
- go test -tags nogui ./internal/provider ./internal/agent ./internal/gui
  ./internal/gateway (gateway -timeout 40m): ok.
- New: TestOwnFast, TestFastMemberOwnProvider (chat/responses/anthropic
  asks, plus a relay with an Anthropic URL too: no speed),
  TestFastMemberOwnProviderRefusing (refused once in 3 calls per API),
  TestFastPickOwnProvider; TestCanFast checks OwnFast is false for every
  vendor-official case.
- Broken by hand: without the forwardTranslated tier line the anthropic
  cases go red (no tier sent, refused 0 in 2); with withFast ungated the
  both-APIs relay case goes red (speed:fast sent to /v1/messages); with
  the ownFast titles off, fast-pick and group-member-fast go red in every
  language.
- GUI: group-member-fast, fast-pick in Chromium and WebKit; gui-ja,
  gui-de, i18n-keys in Chromium.
- gofmt -l clean; go vet -tags nogui GOOS=linux and GOOS=windows clean.
- Not tried against a real relay's priority tier.
2026-10-11 22:04:46 +08:00
yetone 85089a2400 gui: a routing group whose plugin lists none of its models no longer blanks the Routing page; it shows as matching nothing, the rest as ever (#1585, dbydd)
The reporter's Routing page showed only "null is not an object
(evaluating 'g.members.map')" and no group, while every group still
routed. A group made of patterns only whose models a provider stops
listing (a plugin behind on updates) has no members, and Go's nil slice
went out of /api/groups as "members": null. groupRow, pickedRow, the
filter and the group editor (inGroups reads every group) all call
members.map/some/flatMap, so one such group threw out the whole list.

- groups.go: groupsState says a group's members as [] when it has none,
  and an unmakeable template's too.
- providers.go: the Gateway's group entries say icons and providers as
  [], never null (app.js gatewayModels joined g.providers).
- routing.js: every /api/groups response goes through groupsFrom, which
  makes each list a list and leaves out an entry that isn't a group;
  drawGroups draws a group that still throws as one flagged row
  ("This group can't be shown: …", zh/zh-TW/ja/de), never the whole list;
  the filter shows such a group rather than throwing.
- app.js: gatewayModels reads null icons/providers as none.

Verified: a probe through provider.SaveGroup({Match: a/m*}) then the
provider listing other models gave "members":null on main; the Go test
TestGroupsNeverNullMembers goes red with groups.go reverted (group and
3 templates null) and green with it. GUI test group-null-members.test.cjs
uses that response's literal bytes: 12/12 red on the old assets, 12/12
green now (Chromium + WebKit, en + zh, 1100 and 420 wide, plus the
Gateway list). gui-de, gui-ja, i18n-keys, group-*, panel-routing,
gateway-model-info and the routing-manual/save/provider-off tests pass
(221/221). Which plugin the reporter has was not asked; the fix covers
any provider whose models a pattern group stops matching.
2026-10-11 18:57:48 +08:00
yetone 3f57024211 provider, gui: a routing group is shared as text and imported into another magpie (laincatx on X)
A group row's menu has Copy to share: the group as JSON marked
"magpie": "routing-group" with a format version (provider.ShareGroup),
holding its members as it names them, patterns, routing, rules,
classifier and settings. A group holds provider/model ids only, so no
key, account or address goes with it; derived matches and the
found/hidden/off flags stay behind.

The Routing page's Import (by New group) opens a box the text is pasted
into, words or a code fence around it allowed. POST /api/groups/import
(provider.ImportGroup) adds it under a free name, never over a group.
A member whose provider the importer has is kept; else the same model
under one of their providers (listed as used instead); else it is left
out and listed, with the rules that send to it and its off/fast place;
a classifier gone takes the intent rules and auto effort. Nothing is
added when no member is left. Other text, a newer format or none is
refused in the reader's language (provider.ShareError, code "share").

Run:
- go test -tags nogui ./... (gateway failed once on a full disk, then
  passed alone); new TestSharedGroupRoundTrip/MissingMembers/BadText and
  TestGroupShareAndImport; the version check broken by hand turns them red
- gofmt -l; go vet ./...; GOOS=linux go vet -tags nogui ./...;
  GOOS=windows go vet ./...; go build
- group-share.test.cjs in chromium and webkit, en/zh/zh-TW/ja/de, 420px;
  every group-*, settings-groups, filter-ime, panel-routing GUI test
  (210 pass); routing-* (550/557: webkit fold tests timed out only under
  --test-concurrency=6 and pass alone; a webkit routing-* run under the
  same load fails one test on origin/main too, a different one each run)
- real use: the owner's 12 groups from a sandbox copy of providers.json
  each shared (no key in the text) and imported back whole
2026-10-11 10:33:45 +08:00
yetone b1396d2360 gateway, provider, gui: a routing group of decision models answers /v1/systemone, failing over between them (ARNO on Discord)
ARNO asked for decision models to get the group feature too: /v1/systemone
took only "<provider>/<model>" (xxx/jev-latest), so one refusing key or
vendor failed the call with nothing to fall back on.

A routing group may now be of decision models alone (provider.Group.Decides,
provider/decide_group.go). SaveGroup refuses one mixed with models that hold
a conversation, a decision group inside a chat group, and patterns, rules,
classifier, effort, levels, fast mode or a member effort on it. It is kept
out of the agents' catalog (groupEntries), and a chat request to it gets a
400 pointing at /v1/systemone.

POST /v1/systemone with "model":"group/<id>" (or the group's id or name, as
GroupFor reads them) goes to serveDecisionGroup (gateway/decide_group.go):
- the members' keys and accounts are planned with planGroup in the group's
  routing order, resting ones last; perKeyBarred no longer drops a
  decision-only provider's keys (it speaks no chat protocol), so each key
  is a try of its own;
- a gateway key's model and account limits and pause rules hold as for chat;
- a retryable failure that isn't the request's own (shape/prompt/protection)
  rests the candidate via restAfter and the next is asked; a transport error
  rests it as a 502; the last one's answer and Retry-After are passed on;
- every try is a Try of one route in the routing log; one usage row for the
  answer.
A group classifier naming a decision group fails over the same way
(askDecisionGroup; systemOne now returns decideRefused with the vendor's
status, headers and body, and postDecide returns the headers).

The GUI group editor offers a group of decision models only decision models
(groups.deciders), a chat group no decision model or decision group, a new
one both, and a decision model's row has no reasoning picker (groupJSON
.decides). The TUI member picker and `magpie group add` follow the same rule.
#1514's plugin_decide_test and TestMixedDecisionProvider now assert a mixed group is refused and a group
of decision models saves. Docs: reference.md (routing groups),
gateway-routing.md, provider-plugins.md.

Run:
- go test -tags nogui -timeout 40m . ./internal/provider ./internal/gateway
  ./internal/gui ./internal/tui: ok
- new: TestSystemOneDecisionGroupFailsOver (httptest System One fakes: a
  provider with two keys answering 429 and 503, then a second provider
  answering 200: tries ka1,ka2,kb, both failures rested and ask by name
  goes to kb first; all failing passes the last answer on; chat to the
  group is 400), TestDecisionGroupClassifierFailsOver, TestDecisionGroup,
  TestGroupAddDecisionModels, TestMemberOptionsDecisionGroup,
  group-decide-members.test.cjs (Chromium and WebKit, en and zh; no new
  strings)
- each broken by hand and seen red: no dispatch (404), no perKeyBarred
  change (ka2 skipped), no classifier failover, no rest, decision group in
  the catalog, CLI resolver, TUI and GUI picker filters
- GUI: group-*, routing-effort*, routing-levels, routing-save*,
  routing-intent-entry, routing-manual, i18n-keys in both engines: 169 pass
- gofmt -l clean; GOOS=linux and GOOS=windows go vet -tags nogui on the
  touched packages
- after rebasing on bc2496dca, the five packages again: ok. The first run
  had TestMaxRPMWaitsForRoomInTheMinute red once under load; it passed
  -count=3 alone and in the rerun, and nothing here touches rpm.go.
Not tried against a real TypeSafe or Bailian account.
2026-10-11 01:37:18 +08:00
yetone e70e7ed46a routing: a routing group is made from a template in one click, of the user's own models: hard turns to the strongest and easy ones to a cheap one, cheap first, or never stuck
Making a group took the whole editor (owner, 10-10). Three templates are
made from the models the user has (provider.Templates, grouptemplate.go):

- smart (smart-split): an ordered group of the strongest model and a cheap
  one; a classifier sends a hard turn to the strong one and an easy turn or
  a compaction to the cheap one, images to a model that sees them. The
  classifier is the decision API when there is one, else the cheapest
  priced model that doesn't reason.
- thrifty (cheap-first): two cheap models of different providers, then the
  strongest, which also takes high reasoning.
- steady (never-stuck): the strongest model of up to three providers, each
  failing over to the next.

A model weighs by its maker's list price, else its provider's, else by its
id's size words; one over $100 a million output tokens is never picked. A
template that can't be made says what is missing. AddTemplate saves it
under a name and id no group has (freeGroupName, now shared with
CopyGroup), never over one.

GUI: before the user has a group of their own, the Routing page shows the
templates as cards (models, Add, Edit first); after, a Templates menu by
New group. CLI: `magpie group template [kind] [name]`, no args to list.
Pricing goes through priceOf with the served entry's provider, so
/api/groups pays ~75ms for templates on 203 models, not ~600ms.

Run, at this head rebased on origin/main 4e584faa: go test ./... green;
gofmt -l clean; go vet on darwin, GOOS=linux -tags nogui and GOOS=windows.
GUI: group-template.test.cjs and group-duplicate.test.cjs (Chromium and
WebKit, 5 languages, 420px) 30/30, the template test 3 runs in a row; it
skips WebKit's "ResizeObserver loop" notice as two other tests do. The
group-*/routing-* GUI tests ran before the rebase: 628/635, the 7 being
WebKit flights in routing-group-fold and routing-keys-fold, one Chromium
routing-proxy, and the ResizeObserver notice above; run alone at this head,
routing-proxy passes and the two fold files pass twice on WebKit, as on
origin/main. Real data in a sandbox HOME: `magpie web` on 3561, the
Templates menu added smart-split as GPT-6.1 Sol → GPT-6 Luna with 3 rules.
No real request was routed through the new group.
2026-10-10 19:46:58 +08:00
yetone 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.
2026-10-10 15:08:14 +08:00
yetone e4a90aa62f groups, routing: a found group the user changed drops a removed provider's members, and a switched-off provider's members are said as switched off (Discord)
A user on Discord: in magpie's found (auto-…) routing groups, a provider
removed or switched off stayed in the group and had to be taken out by
hand; one switched on again should be back by itself.

A found group magpie derives already followed its providers (built from
the providers that are on). The gap was a found group the user had changed
(any edit on its card stores it under its auto-… id with its members):
its members stayed as they were.

Now:
- provider: groupsIn reads a stored auto-… group without the members of
  providers magpie no longer has (withoutRemoved). This is read-time only,
  never written back, so a provider back under its id (an account shown
  again) is back in the group. A manual group's pick and a model a rule
  sends to are kept, since taking them out would change where requests go
  without asking, or stop the group from saving. If no member would be
  left, all of them stay. The user's own groups (other ids) keep their
  members as they were.
- A switched-off provider's members stay in any group. The gateway
  already skips them (membersIn), and they are routed to again once the
  provider is on.
- gui: groupsState marks such a member providerOff, with its provider's
  name, icon and model. The Routing page says it as "<provider> · <model>
  (switched off)" on the card. A manual group's pick and the editor's row
  say why: "{name} is switched off: the group skips it until it is on
  again" (new string in zh, zh-TW, ja, de). Before, it was a bare id.

Run:
- go test ./internal/provider TestFoundGroupFollowsItsProviders. It fails
  on the old group.go: "c removed, auto-x's members: [a/x b/x c/x]".
- go test ./internal/gui TestGroupMemberOfASwitchedOffProvider.
- New internal/gui/tests/routing-provider-off.test.cjs in Chromium and
  WebKit, en/zh/zh-TW/ja/de, at 1100 and 420: 10/10 each. On the previous
  assets it fails: the card said "B Cloud · sol" with no "(switched off)".
- The full ./internal/provider and ./internal/gui go test suites, in a
  sandbox HOME: ok.
- ./internal/gateway -run 'TestGroup|TestAuto|TestRouting': ok.
- gofmt -l clean. go vet -tags nogui on darwin, linux and windows: ok.
- All routing-*, panel-routing, click-scroll, gui-ja, gui-de, gui-zh-tw
  and i18n-keys GUI tests: 265/265 in Chromium and 265/265 in WebKit.

Not tried with real providers in the live app.
2026-10-09 11:10:12 +08:00
yetone 62f9612ba6 groups: a routing group's own id keeps a model's dots (#968) — a group named GPT 6.1 Sol was group/gpt-6-1-sol, so a harness pricing or tuning by the model's name didn't know it (dbydd). provider.GroupSlug is Slug with the dots kept (a run of them one, none at the ends); SaveGroup, RenameGroup, the backup's import and export, the GUI's save and rename, the CLI's group add and edit, and the Routing editor (groupSlug) derive and check a group's id by it. The ids magpie finds stay Slug's (auto-gpt-6-1-sol), so no id saved before changes, and an agent sending the bare name gpt-6.1-sol reaches a group of that id first (GroupFor). groupid_test (ids, save, rename, bad ids, found ids unchanged) and gateway's TestDottedGroupID (group/gpt-6.1-sol and the bare name served, falling through as the group's order says; -race -count=5) pass and fail without the fix; group-id-dots (hint and Add's body, groupSlug cases) passes in Chromium and WebKit, en and zh, and fails without it. The other group-* GUI tests, agent-model-groups and i18n-keys pass, except group-arrange, whose Chromium cases fail the same on origin/main (mouse.move: Invalid parameters at line 165). go test . provider/gui/gateway/agent/tui, vet, linux/windows builds pass. 2026-10-06 12:32:16 +08:00
wizzy-yangandwizzy-yang b358a5ca83 gui: a routing group in a routing group says what agents are told of it, and where its reasoning is set (#915)
A member that is itself a routing group read as a blank row in the group
editor. provider.groupsState leaves groups out of groups.models, so the
page's modelOf found nothing for "group/<id>" and the row drew no chips at
all: no reasoning levels, no image badge, no window. Which nested group
takes images, how long a conversation it holds and what it reasons at could
only be found out by sending one.

Its own memberInfo already carried what agents are told of it — the window
the largest of its models has, whether any of them sees images, and
imagesUnknown when nothing said either way. The levels every model in it
has (provider.groupEntries' Efforts) were the one thing missing, so
memberJSON carries them (efforts) and the editor reads the whole row from
memberInfo when the member is a group, as it reads a model's from
groups.models. modelInfo already said a group's images are one of its
models' and its window the largest of its models'; the levels now say the
same.

Such a member takes no reasoning of its own, on purpose: its models reason
as the group says (provider.SaveGroup refuses "group/<id>:<level>" — "its
models reason as it says, so it takes no effort of its own" — and the
gateway has nowhere to put one). So where a model's row has its own
reasoning picker, a group's row now names the group it follows and opens
that group's card, rather than leaving the slot empty with nothing to say
where the levels are set. The chip takes the room it needs and gives it
back when the row is tight, since the desktop app's member row doesn't
wrap (only body.web's does). en/zh/ja/de.

TestGroupMemberThatIsAGroupCarriesWhatAgentsSee is new — a group in a
group carries the largest window of its models, images because one of them
sees, and the levels every one of them has; a group whose models share no
level offers none and is not called unknown; a plain member is unchanged;
groups.models holds no group — and fails without the change.
group-member-info.test.cjs gains the nested case (Chromium and WebKit, en
and zh: the chips, the wording that they are its models', the follows chip
and its title, the click that opens the inner group's editor, and the plain
member beside it keeping its own picker), which fails without it too.

go build, go vet and go test ./internal/gui (the three group tests) pass
under a temp HOME, as do the routing, group and click-scroll browser tests
in Chromium: 176 of 178. The two failures are routing-try-fixed's "a try
sent at an effort its member isn't fixed at flies to the member's row" in
en and zh, which fails 2 of 4 runs on main without this change. gui-ja and
gui-de's completeness checks fail on this base before this change:
43a65950's "{agent} is signed in to {user} now: sign it in to another of
its accounts first…" has {agent} twice in ja and once in the key. Neither
is touched here.

Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>
2026-10-05 22:49:23 +08:00
wizzy-yangandwizzy-yang afc6623ce5 gui: a routing group's members say whether they see images (#885)
* gui: a group's members say what each can do, images included

A routing group's editor said of a member its name, its provider and the
reasoning it is sent at, and nothing of whether it sees images — a group
mixing members that see with ones that don't gave no way to tell one from
another, and which member a picture would reach was found out by sending one.

Each member now carries the same chips the Gateway page's model list sums a
model up in (modelInfo): its reasoning levels, whether it sees images and the
window it holds. The group's own models API carries Images and ImageSet for
them (internal/gui/groups.go), and the chips' look is shared with the Gateway
list's.

A member whose list says nothing of images is said to be unknown, not "text
only": magpie counts it text-only for a describer (gateway.blindTo), which is
not its list saying it takes none. For the same reason the group's own line —
"Accepts images (every model in it does)" — said something a group no longer
is: since #756 one member that sees is enough, so it reads "one of its models
does" now, in English, Chinese, Japanese and German.

group-member-info.test.cjs (new) checks three members — one that sees, one its
list says takes none, one nothing was read of — for their chips, their
tooltip's words in both languages, and that the row still switches off and
removes. Routing view regressions pass as on the baseline.

Validation:
- node --test --test-concurrency=1 internal/gui/tests/group-member-info.test.cjs
- group-arrange, routing-manual, group-member-off, group-context, group-fold,
  group-patterns, group-bulk-remove, group-member-fast, group-found-off,
  agent-model-groups, member-model-setting, group-from-model-add, click-scroll:
  32 pass, 2 fail — both the 600x420 group-from-model-add cases, which fail
  identically on the unmodified 9e77092.

# Conflicts:
#	internal/gui/assets/routing.js

* gui: test that a group's models carry what they take

The chips the Routing editor draws a member with read the served catalog
entry: whether agents are told it takes images, whether anything said so
either way, its reasoning levels and the window it holds. The first is the
same expression the gateway decides by when it describes an image for a
model that can't see one (blindTo reads Entry.Images), so the editor cannot
say a member sees images that the gateway would describe them for. A model
whose list says nothing is carried as unknown, not as text only.

Covers: one that sees, one its list says takes none, one nothing was read
of, and one the user answered for themselves (settings.ModelImages).

* gui: carry a member's unknown images as a flag, not an absent key

Review of the chips: `imageSet` was omitempty on both structs, so a model
magpie knows nothing about went out without the key, not with `false` —
`m.imageSet === false` never held, and such a model still read "Text only",
which is what the chips set out to avoid. The browser test passed only
because its fixture wrote `imageSet: false`, which groupsState() never
produces.

`imagesUnknown` is the flag now, sent only when true: a model magpie has an
answer for carries no such key at all, and the page reads `=== true`. The
name is apart from the Gateway page's `imageSet` on purpose — there it means
the user answered for the model themselves (provider.ImageOverride), and
modelInfo is shared by both pages.

The fixture now writes what groupsState() emits: `images` and
`imagesUnknown` left out where they are false. A Go test holds the wire
shape (`TestGroupModelImagesOnTheWire`), and with the fixture as it now is
the browser test fails 2/2 on the old check ("a member nothing was read of
says unknown, not text only: Reasoning levels: none known").

Validation: go vet ./... and go build ./... pass; go test ./internal/gui/
fails only TestSetPortMovesTheGateway and TestPurposeAssetMatchesUsage,
which fail identically on the unmodified 9e77092; the routing and group
browser regressions are 34 pass, 2 fail — both the 600x420
group-from-model-add cases, which fail identically on the baseline.

---------

Co-authored-by: wizzy-yang <wizzy-yang@users.noreply.github.com>
2026-10-05 17:42:25 +08:00
yetone 4dab45e3ff gui, provider, gateway: a group's models are dragged into order, a group can be switched off, several models are added at once, and a page shows a scrollbar on the Mac (PAMI on Discord) — in a group's editor a model went up one step a click and only up; its number is now a handle (grip on hover) that drags it, Alt+↑/↓ moves it from the keyboard, and Up and Down stay beside it; a pattern's members follow the named ones. A group of the user's has a switch on its card: off, agents aren't offered it, a request to it is turned away with 404 "the routing group … is switched off", a group that has it in it goes on to its next member, a save from the editor leaves it off, and one that classifies for another can't be switched off (a found group is removed instead, as before). Each member already had its own switch. The editor's Add a model picker stays open: each model clicked is added and ticked, clicked again taken out, and each says the other groups it is in. Pages, dialogs and framed editors had their scrollbar hidden everywhere (width 0); on the Mac they now have a thin 8px thumb, elsewhere the 10px one other lists have. TestSwitchGroup, TestSwitchedOffGroup, group-member-drag, group-switch-add-many and view-scrollbar (WebKit, en and zh) fail without the change. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass (TestProvidersAnswerWhileListsComeIn is flaky on origin/main as well). 2026-10-05 16:46:59 +08:00
yetone a84f1052e0 groups: several routing groups are removed at once, and the found ones removed are one folded line rather than listed (lc on Discord: 路由组可否关闭自动发现,并且可编辑批量移除,已经移除的不要显示,或者用移除组来替代,这样干净整洁,并且可以彻删) — groups could only be removed one at a time from each editor, and every found group removed stayed under the list as a chip of its own. Select, by New group, puts a box on each group's card: a click on a card picks it, the bar's box picks all or none, and Remove (a second click to confirm, Remove 2? Click again) posts groups/delete {ids}, which provider.DeleteGroups removes all or none: refused before any goes when one isn't there or a group left holds one as a member or classifier, and a group held only by another being removed goes after it. A found group removed stays removed (magpie doesn't make it again), now one line under the list, 3 found groups removed, whose app menu brings one back; with found groups off it isn't shown. magpie group rm takes several ids. Turning found groups off altogether was there already (Find groups on their own, v0.1.603). zh, ja, de strings. TestDeleteGroups, TestGroupsDeleteSeveral; group-bulk-remove.test.cjs (WebKit, en and zh: picking, the two clicks, the post, the folded line and its menu, no click moves the page), failing on the old code (the chips). group-found-off, group-arrange, group-fold, settings-groups and click-scroll pass on WebKit. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-05 03:37:03 +08:00
yetone 855e7985f2 routing: the groups are put in an order of the user's, as the Agents page's rows are, and /v1/models lists them so (#779)
The Routing page's group list followed the order the groups were made in, found ones after, so a group used every day couldn't be put first, though /v1/models lists the groups in that order and agents' pickers (Claude Desktop's 3P list among them) show it and some clients probe its first model. A group row's logos are now its handle, as an agent row's logo is (#57): dragged (dragRows, the Agents page's sorter) it moves the row, clicked, or the row right-clicked, it opens Move up and Move down (openRowMenu, with the Agents menu's arrows, now MOVE_UP/MOVE_DOWN), and Alt+↑/↓ moves it from the keyboard, which stays on it. The grip in the row's margin is drawn only while the row is under the pointer, dragged, or its handle is focused or its menu open, as on the Agents page. The list is drawn in its new order at once and put back if the save fails; a later move wins over an earlier one still saving.

The order is kept in providers.json as groupOrder (provider.SetGroupOrder, POST /api/groups/arrange), beside the providers' own order (#499), and applied in groupsIn, which every list of the groups is made from: the Routing page, Catalog and so /v1/models, magpie group ls and the TUI's routing page. A found group, which isn't stored until changed, can be put among the user's this way, which reordering the groups array couldn't do. A group not named (one made or found after) goes last; a renamed one keeps its place. Backup and sync carry the order as they do the providers' (MirrorGroupOrder).

TestGroupOrder (Groups and the catalog follow SetGroupOrder, providers.json has it, a new group last, a rename in place, bad orders refused, a synced order first) fails on the old code. group-arrange.test.cjs (WebKit, en and zh): the grip hidden with the pointer away and shown on the hovered row only, in its margin; right-click Move down with Move up off on the first; Alt+↓ and Alt+↑ with focus kept; the handle's click opens the menu, not the editor; a drag by the grip to the top; each posting every group's id with the removed one last; no click moving the page. It fails on the old code. agent-grip, click-scroll, account-arrange, usage-arrange, provider-order and the group-*/routing-* GUI tests pass in WebKit, but for group-from-model-add's 600x420 cases, which fail on main as well. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass.
2026-10-04 19:27:51 +08:00
yetone 5569275465 group: a routing group's members can be patterns, so a group follows a provider's catalog (#766: magpie group add my-free-pool models='openrouter/*:free,opencode-zen/*-free') — a group names its models one by one, so a pool of a vendor's free models went stale as the vendor added and dropped them. A group now keeps patterns apart from the models it names (Group.Match): a glob, * any run of characters (/ too) over the provider/model id in any case, or re:<regexp> over the whole id. groupsIn, which every reader goes through (Groups, FindGroup, /v1/models, MemberGroups, GroupsWith, RenameGroup, rules, Off, Pick, the GUI, TUI and CLI), puts after the named models every enabled provider's model a pattern matches, in catalog order, deduplicated, the named one keeping its place; a pattern never matches a group. What was matched is derived (Group.Matched) and never stored: store() and SaveGroup keep only the named members, so a save never freezes matches. Off and rules may name a matched model. A group with only patterns is allowed; one matching nothing routes nowhere and says so: magpie group <id> lists each pattern with how many models it matches now ("matches nothing now" in amber), the group list and the TUI too, and the GUI card shows a line per pattern with its count. CLI: models= takes patterns among the ids, models+= adds them (naming a matched model moves it to where it is named), models-=<pattern> drops one, models-= of a matched model is refused naming its pattern; the help documents patterns. GUI: the editor has a Patterns box (Add pattern / Remove, validated as the server does), matched models follow those named marked "by pattern" with their off switch and no Remove, and saves send members without the matched ones plus match; zh strings added. Tests: TestGroupPatterns, TestGroupPatternMembersOffAndRules, TestGroupPatternMatchingNothing, TestPatternSyntax (provider), TestPatternGroupRoutes (gateway: a request reaches a matched model, a model a provider adds joins, Off on a matched one, /v1/models lists the group), TestGroupPatternsCLI, and group-patterns.test.cjs (WebKit, en+zh); they fail on the old code (the Go ones don't build, the GUI one finds no pattern lines). GUI: group-patterns, group-found-off, group-member-fast, group-member-off, settings-groups, agent-model-groups, remote-group-served, routing-manual pass on WebKit; group-from-model-add has the same 2 failures (600x420) as origin/main. A request to a group whose patterns match nothing now is a 404 naming the group and its patterns (emptyGroupError), not 'magpie knows no model' and every model; TestEmptyPatternGroupSaysSo. With the owner's real config under a sandbox HOME: group/ds-pool of models='deepseek/*' listed deepseek-flash and deepseek-v4-pro by pattern, stored only the pattern, was in /v1/models and answered from deepseek-flash; none-pool of 'nobody/*' said its pattern matches nothing. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-04 16:52:15 +08:00
yetone af046769fb routing: an account rate limited with quota left can go to the back of the order, so several accounts take turns (01huadalang on Discord: with several WorkBuddy accounts, one rate limited rests and then goes back to the front, so it takes everything until it is limited again) — a new opt-in setting, "Rate limited" (zh 被限流时), sits next to Routing for a provider (sink in its JSON) and for a routing group (sink on the group). It has two options: "Keeps its place" (the default, unchanged) or "Goes to the back". With "Goes to the back", an account or key that answers 429 while its subscription still has quota (failRate, not a quota or credit failure, and not a used-up allowance) rests as before. Once the rest ends it stays behind every one not rate limited since; those sunk are ordered by when they sank, so the load goes a,b,c → b,c,a → c,a,b. In a group it covers the members' accounts and keys together. The sink is kept in memory until magpie restarts or the account sinks again. It applies to every routing but In turn (which goes round already) and Manual, and is hidden there.
Where it is set:
- the provider editor's "Rate limited" row, saved with its Save (sink in /api/provider/save, kept by a Save that leaves it out);
- the Routing page's row of providers with several accounts or keys, which saves at once (/api/provider/sink);
- the group editor (/api/groups/save), with the group card tagged "Rate limited to the back".

The Routing page's trace gives a sunk account "rate limited at {time} · at the back" and a line saying why. Weighed carries `sunk` and GroupRef carries `sink`.

Tests:
- TestRateLimitedSinksToTheBack: three accounts rotate over five rate limits. Off or in turn they keep their order. A quota 429 or a full allowance doesn't sink one, and one still resting stays behind.
- TestGroupRateLimitedSinks: ordered and smart groups.
- TestProviderSaveSink.
- rate-limited-sink.test.cjs covers the editor, pool row, group editor, card tag, trace and zh, in en and zh. It fails on the old code and on the old assets.

routing-compact.test.cjs now wheels down to "Add a rule" and Save as the reader would, since the editor's new row puts them past the window.

go vet, builds (nogui, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. In webkit, the routing-*, group-*, quota-pools, panel-routing, click-scroll and settings-groups GUI tests pass, except routing-manual, routing-time and group-from-model-add, which fail the same way on origin/main. Not tried with real accounts against a vendor's 429.
2026-10-04 01:20:51 +08:00
yetone a409e1552a groups: the groups magpie finds on its own can be switched off, in the Routing view and with magpie group auto off (蓝猫 on Discord: 路由分组会自动创建,可以关闭掉吗) — a model two or more providers serve always became an auto-<model> group, and one could only be removed at a time. A switch right under the routing groups' head, with what it does in words, and magpie group auto [on|off] now keep noAutoGroups in providers.json: off, no found group is listed, catalogued or served, and the groups the user made or changed stay; on, they are back, along with any the user had removed still removed. An agent set to a found group is moved to its model from one provider (the status line and the CLI say which), and a request that still names group/auto-<model> goes to that provider's model rather than failing. Switching off is refused while a group of the user's holds a found group as a member or classifier, so none is left pointing at nothing. TestAutoGroupsOff, TestAutoStandIn, TestAutoGroupsOffHeld, TestFoundGroupOff, TestReseatFoundGroupsOff and TestGroupsFoundSwitch fail without the change; group-found-off.test.cjs (Chromium, WebKit, en, zh), click-scroll and old-webkit pass. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestUserPath a load flake, passes alone; TestClaudeSignedOut fails alone on main as well). 2026-10-02 02:24:49 +08:00
yetone 10b940233c routing: a group's member can be sent in its vendor's fast mode, beside its own reasoning (vs on Discord: a member "gpt-6.1 sol · high · fast") — a member's effort was already its own (#189, "provider/model:effort") but there was no way to ask for speed, so a group could not hold "gpt-6.1-sol at high, priority" next to slower members. A group now lists in fast the members it sends fast, as Members spells them, kept beside Members rather than in their ids so an older version still routes to them, only not fast (checked: HEAD's build on the same providers.json sends the same members at their effort, no tier, and leaves the file as it was). When the gateway sends to such a member it asks in the upstream's own words, only where the model has a fast mode magpie can ask for (provider.CanFast): service_tier "priority" for a ChatGPT account's GPT models and an OpenAI key's GPT/o-series models on its Responses API, Cursor's -fast variant, and speed "fast" with the fast-mode-2026-02-01 beta for Claude Opus 4.8/5/5.5 on an Anthropic key (api.anthropic.com); a relay, Bedrock, a Claude subscription, a model without one, or a provider since moved off those hosts is sent untouched. It is applied in the agent's own API and carried through translation (parseAnthropic now reads speed), so Chat, Responses and Anthropic agents all get it. A translated request for OpenAI's Chat API is still told no tier (TestCursorPluginFast), hence the Responses requirement. The trace marks the try, the order and the group (fast), shown as "fast" beside the reasoning in Requests and the order. Typed, a member is provider/model[:effort]:fast: magpie group add/set models=… takes it, fast=<m1>,… sets them, models-= takes either spelling, and the group lists and shows members as typed with "· fast"; a model with no fast mode, or a group in the group, is refused. The GUI group editor shows a "Standard speed"/"Fast" toggle (标准速度/快速) beside a member's reasoning only for a model that has one, the card reads "· fast" after the reasoning, and fast follows a member's reasoning change and leaves with a removed member; the TUI's group view takes E to step a member's effort and F to toggle fast. Provider renames carry it. TestFastMemberOpenAI, TestFastMemberAnthropic, TestWithFastWire (gateway, per wire format, a fake vendor recording body and anthropic-beta), TestCanFast, TestSaveGroupFast, TestGroupMembersFast, TestGroupMemberEffortAndFast, TestGroupSaveFast and group-member-fast.test.cjs fail without the change. A sandbox magpie (own HOME, gateway on 3966) with providers at http://api.openai.com and http://api.anthropic.com through a local recording proxy sent priority+high to OpenAI and speed fast + the beta to Anthropic from Chat, Responses and Anthropic clients, and nothing extra for Sonnet or a non-fast member. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; group-member-fast, click-scroll, old-webkit, routing-levels, routing-manual, routing-effort, settings-groups pass (Chromium, WebKit, en/zh). 2026-10-01 17:13:34 +08:00
yetone 52a0d799d6 routing: a group can be routed by hand, its model picked on its card (#317, @azir12345: pick the channel as CC Switch does) — a group's routing may now be Manual: every request goes to the one member picked (pick in the group's JSON; the first when none or one no longer in it), over that member's own accounts or keys, and the others and the rules wait (kept, not dropped) until another routing is chosen; none takes over when it fails. On Routing, a manual group's card lists its models as pills, the picked one marked by a dot (role radio), and clicking another saves the group with that pick without opening its editor or moving the page; its rules tag says they wait. The editor offers Manual beside the other routings. magpie group pick <id> <model> (or group set <id> pick=<model>, a bare model id when it names one member) picks from the CLI; magpie groups and group show mark the pick, the TUI shows "manual → model". A renamed provider or model renames the pick. TestManualGroup, TestGroupPick and routing-manual.test.cjs (Chromium, WebKit, en/zh) fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass; click-scroll, old-webkit, routing-levels, routing-steady, panel-routing, settings-groups pass. 2026-09-30 19:42:44 +08:00
yetone 7c0b5441a8 routing: a group can name the reasoning levels agents are offered, so one member with few doesn't take the rest from the others (#295) — a group offered only the levels every member has, so deepseek-flash (low/high/max) beside models with medium and xhigh left the group without them. Group.Levels (CLI magpie group set <id> levels=low,medium,high,xhigh, levels= clears; TUI l; GUI group editor's Levels: its models' shared / named) is offered instead in /v1/models, Codex's catalog, Pi and the rest; only levels magpie knows are taken, stored lowest first; a group in a group that names its own offers them for its models; unset is as before. A member without the level asked is sent its nearest, as it already was. The GUI's group save also keeps a family set from the CLI. TestGroupLevelsOverride, TestGroupLevelsReachAgents, TestGroupLevelsNamed (passthrough and translated: medium→high, xhigh→max on the low/high/max member, as asked on the one with all), TestGroupSetLevels and routing-levels.test.cjs (Chromium, WebKit, en/zh) fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass (TestUserPath, a known flake under load, passes alone); click-scroll, old-webkit, routing-effort(-row), routing-levels, settings-groups GUI tests pass. 2026-09-30 16:26:37 +08:00
yetone ba9f0c610d routing: a group's member may be a model at an effort of its own, provider/model:low (#189, @luw2007: model + effort 才是完整的组合项) — a member was only a model, reasoning as the agent asked or as the group's classifier picked, so "the same model, cheap and quick" and "the same model, thinking hard" could not both be in a group, nor could a rule send to one of them. A member now may carry an effort (none … max): a request routed to it is asked for that much reasoning whatever the agent asked or effort=auto picked, at the level the model has nearest, while the vendor is asked for the model's own id. The same model at two efforts is two members that rules (use=m:high), stickiness and the trace tell apart; an id whose own last part is a colon (a :free, :7b, :0) stays the model's. The group's reasoning levels are those of its members that follow the agent, and the editor has a reasoning button on each member. Tested with a fake provider through a sandbox magpie: the upstream bodies carry the fixed effort in Chat, Responses and Anthropic shapes, and the routing view shows m1:low / m1:high as two seats, light and dark 2026-09-29 13:45:29 +08:00
yetone a3d59eee01 cursor: a model's name no longer says its context, a grey 1M beside it does (Leo on Discord: Cursor 模型的展示名仍保留上游文本中的 1M) — Cursor names its large models "Claude Opus 5.5 1M", and magpie showed that as the name while it already kept the 1M as the model's context. The name now leaves it out ("(1M)" too); a name that would then be another model's ("GPT-5.5 Mini (1M)" beside "GPT-5.5 Mini") keeps it, as that is what tells them apart. Ids, efforts and the Cursor id each request goes to are unchanged, and a name the user gave still wins. So the context still shows, a model holding a million tokens or more has a small grey 1M by its name in the provider's models, the gateway's list and the model picker. Tested with a fake Cursor list in a sandbox magpie web, dark and light 2026-09-29 13:26:16 +08:00
yetone efed707066 providers: a provider can be switched off, kept with its keys but out of every agent's list (希望服务商可以有一个开关按钮,关闭后不再写入模型) — a provider whose quota ran out could only be removed, losing its key and settings, or left in, its models still written into the agents and requests still sent to it. Now each provider (a signed-in account too) has a switch on its row in Providers and in its editor's header; off, the row is dimmed and says Switched off (已关闭), its models leave the catalog, so the model lists magpie writes into agents' files are rewritten without them as after any provider edit, and it is left out of routing groups, fallbacks, the Automatic image, vision and search picks, the routing pools and balance and usage polling. A request naming one of its models is answered 404 saying the provider is switched off in Magpie, not that the model is unknown. Switched on, all of it comes back. Saving the provider from its editor keeps it off; magpie provider off|on <id> and the TUI's o do the same. Tested: an off provider's models are not in the catalog or served, a group with it routes to the member left, a fallback to it is not tried, a request for it is refused as switched off, and turned on it is listed and answers again; an account's off is kept. Checked the Providers page in a sandbox HOME in light and dark: switching a row off and on, the editor's switch and its note 2026-09-29 02:49:36 +08:00
yetone 6fd85894ea routing: Jev (TypeSafe's System One) as a group's classifier — asked once as a turn begins which of the rules' intents the message is, with how sure it is, and, for a group with effort auto, how hard the turn is to think about; the turn's requests then ask their model for that reasoning, where the agent asked for any. TypeSafe is a decision provider: it serves no conversation and is no group's member 2026-09-27 01:53:04 +08:00
yetone cdd1e8e7a4 group: a group's id can change — a group magpie found is group/auto-<model>, and agents could only pick it by that; now its id (any group's) is changed in the editor or with magpie group set auto-gpt-6-astra id=gpt-6-astra: the found one stays removed under the old id, the groups that have it in them and their rules follow, and an agent set to the old id is told it needs setting again (#83). magpie groups no longer says a group in a group is not served 2026-09-26 14:14:26 +08:00
yetone 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 2026-09-26 13:41:17 +08:00
yetone 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 2026-09-26 03:53:33 +08:00
yetone 925e4a6ccd provider: a provider can serve only through routing groups — ticked, its models leave the list agents pick from (and /v1/models) while the groups they are in, and a request naming provider/model, still reach them (magpie provider listed <id> no); the routing groups come first in the list; a model list fetched from the vendor can be forgotten; magpie group add under a name in use replaces that group; and the Library gives MCP servers to Claude Desktop, the ones it runs as a command — a remote one is added in its Connectors, which the page says 2026-09-25 20:11:29 +08:00
yetone 06997e90eb gateway(routing groups) + gui(picker, gateway, routing) + codex: routing groups come first in the model picker under a routing icon of their own, each shown as its providers' icons stacked, and are listed first in the Gateway view's models too; a model is found to be the same under the ids its vendors give it — claude-opus-5-5 and claude-opus-5.5, dated or not — so the Claude subscription's Opus 5.5 joins its group; keys made for different protocols are pools apart, a request going round the keys that suit it before trying another's; Codex's model list is asked for as the newest Codex on the machine (codex --version) rather than the version its cache last wrote, so models only newer clients are shown — GPT-6 Sol and Luna — are listed; the Routing view keeps its providers in one order rather than reshuffling them per request; mask icons in the picker have a size to fall back on, so OpenRouter's and Copilot's show 2026-09-25 05:01:18 +08:00
yetone 520a2425fc gateway(routing groups, affinity) + gui(routing): routing groups — several models, from one provider or many, that an agent picks as one (group/<id>), routed over all their members' keys and accounts together, smart, in order, in turn or least used first; a model more than one provider serves is a group magpie finds on its own, and becomes the user's once changed. Affinity keeps a conversation with the key or account that answered it — for the session, within a turn, never, or by default while what the vendor read from its cache is worth keeping and not yet cold — so the prompt cache holds; in turn now spreads turns rather than requests, a turn's tool results staying where it began. The Routing view shows each agent's requests in its own colour, the magpie flying them through the gateway's box rather than jumping across it, groups and why a conversation stayed or moved; and a Hide emails switch blurs the email addresses on the page, for a screenshot to share 2026-09-25 04:07:40 +08:00