4794de398ea8337d223a91e207181c56fcf4ad76
201
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
250bdd5c4f |
gui: Names in agents' lists names the connected agents it changes nothing in (love1sbug on X)
love1sbug on X found Names in agents' lists seemed to do nothing. Claude Code and Qwen Code follow it now; a sweep of every agent in a sandbox HOME (each set to one relay model, the setting switched, the files compared) found the rest that follow it, and those that can't: - handed the models' ids alone, their formats having no name for one: Goose, jcode, Hermes Agent, Reasonix Studio, AtomCode, fx, Antigravity CLI, AstrBot, Mister Morph; - with no list of magpie's models: Gemini CLI, Snow CLI; - reading the gateway's /v1/models themselves, whose display_name is the name alone on purpose (a remote magpie relies on it): Empryo, Cursor Private Inference. Those carry agent.NoNames (copied to an agent in WSL), sent to the GUI as noNames. Where the setting is offered (Settings › Provider in model names, Routing's Names in agents' lists, a provider's Names & levels) a line names the connected ones: "Changes nothing in Goose, Hermes Agent: magpie's names don't reach their model lists", in every language. With none connected nothing is said, so the Settings row keeps no line under its name (1ooogle on X, model-suffix-own's check). A page drawn before the agents are read (Routing, an open provider editor) says it once they are (redrawNoNames, beside redrawSuffix). name-suffix-no-names.test.cjs checks the three places in chromium and webkit, en/zh/zh-TW/ja/de, at 900px and 390px with no sideways scroll, that an agent not connected or following it isn't named, that none says nothing, and, with /api/state answered 1.5s late, that all three still say it. On the old assets 12 of the first 13 chromium tests fail; the late case failed on this commit's first version too (found when a loaded run failed the editor's case; reproduced with the injected delay). Run: that test and i18n-keys, gateway-mode, model-suffix-own, name-suffix-remote, name-suffix-saved, name-suffix-where-named, settings-general/groups/search/sections in both engines; go test -tags nogui ./internal/agent ./internal/gui ./internal/provider ./internal/gateway (before the rebase); gofmt -l; go vet darwin/linux/windows. With 11 files at once at load 80-120, webkit failed once on this test's "no page errors" check (ja 900px, the late case) beside settings-sections' "Settings in parts"; not reproduced in 3 runs since (10 files, then 8 copies at once), and the errors weren't kept. Not tried: the GUI against a real magpie with Goose connected. |
||
|
|
eba7187368 |
gateway, provider, cli, gui: a group can route By weight, each member's share set beside it (#1910, DD on Discord)
DD asked for weighted round robin as a group routing, next to In turn.
A provider's keys could already route by weight (#841). Groups could not.
What changes:
- provider: Group.Weights maps a member's spelling to its weight, 1 to
1000. A member left out, or set to 0, weighs 1. SaveGroup accepts
routing "weight". It also cleans weights the way it cleans fast and
off: it strips :fast, drops weights of members that are gone and of
members weighing 1, and refuses a weight below 0 or above 1000.
Weights follow a member when it is renamed (RenameMember, Rename,
RenameGroup) and survive Share/Import.
- gateway: planLevel treats each member of a weight-routed group as one
unit: a model with its keys in its provider's order, or a nested group
routed its own way. weightedUnits orders the units by smooth WRR on a
round per group ("group/<id>"), sharing wrrPick with the keys. The
round's pick goes first and the rest stay in member order for
failover. A unit whose head is resting leaves the round. When a
conversation is kept on another member (session/turn/cache/strict),
the charge moves to that member (wrrSeat, wrrMove).
- cli: routing=weight (also weighted, wrr). weight=<model>=<n>[,...]
sets weights and keeps the rest; weight= on its own clears them. The
group view shows "· weight N" for each member.
- tui: By weight is in the group routing list.
- gui: the group editor offers By weight. Each member then shows
"Weight N · S%", its share among the members that are on. Clicking it
edits the number in place: Enter or blur keeps it, Escape cancels,
and a value outside 1 to 1000 shows a warning. The trace header uses
group wording for a weight-routed group. Strings are added in zh,
zh-TW, ja and de.
- docs: reference.md, gateway-routing.md, and site start pages in en,
zh and ja.
Run:
- go test -tags nogui ./internal/provider ./internal/cli ./internal/tui:
ok.
- ./internal/gateway: ok in 988s with -timeout 45m. The first run hit
the default 10m timeout at load average ~170. The test running at
that moment had been running for 2s; it was not a hang.
- go vet -tags nogui on those packages, for darwin, GOOS=linux and
GOOS=windows: clean. gofmt -l: clean.
- New group-member-weight.test.cjs: 8/8 in Chromium and WebKit, en and
zh at 1100, en and de at 420. The WebKit de 420 case also passed six
runs at once.
- gui-zh-tw, gui-ja, gui-de, i18n-keys, routing-*, group-*,
panel-routing*, settings-groups and agent-model-groups: all green
except two.
- routing-steady (WebKit) is #1804. It is red 2/3 alone on origin/main
|
||
|
|
38247dee27 |
routing: no agent is marked in red, the colour of a failure (zhouatie on X)
zhouatie's Routing map showed an agent named OpenAI (asking for antigravity/gemini-...) with a red dot before its name and a red dotted wire from magpie to the seat that answered, and read it as something wrong: "这个红色颜色,让人以为是状态异常". Nothing was wrong. The dot and the wire are the agent's own colour (hueOf): an agent with no maker's colour gets one of SPARE by a hash of its id, and "openai" hashed to rose #e11d48. omp's #f43f5e was rose too. On this page red means a failure (an answer ringed red, a failed request), so an agent marked in it reads as one, and its failures couldn't be told from it either. SPARE's rose is now teal #0d9488 and omp's is fuchsia #d946ef (omp's icon is currentColor, so rose wasn't its maker's colour). Claude's clay stays: Anthropic's own, read as orange, 13-14 degrees of OKLCH hue off --red where the rose was 7-9. hueOf colours every place an agent is marked (stage dot, wires, flier, request swatches, timeline marks, the tray panel's stage), so the one palette covers them all. routing-agent-hue-not-red.test.cjs checks every HUES and SPARE colour against app.css's light and dark --red (OKLCH hue within 12 degrees with chroma > 0.04 fails), and draws the reporter's case on the stage in the dark theme, checking the agent's dot, --agent and the wires. Run: the new test, Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 420px: 21/21 pass; on the old routing.js 21/21 fail (rgb(225,29,72)). Screenshots looked at (webkit zh 1100, chromium de 420): the OpenAI node's dot and the dotted wire are teal. All routing-*/panel-routing* GUI tests at concurrency 4: 818 pass, 2 fail, both routing-wb-restricted webkit 420px under load, already filed as #1905; that file passes alone (10/10) and with five routing files at once. go test -tags nogui ./internal/gui -run 'Asset|Routing' passes. |
||
|
|
657e48abbf |
routing: a request whose agent left in the retry pause says it was canceled, not "tried again in 2s" (#1894, heng91)
heng91's relay was unreachable while their proxy was off; magpie answered the relay's 503 with its short same-one retry (or a group's replan), and they closed the Claude Code / Codex window in the pause. The gateway already stopped there: the pause selects on the request's context, the route ended with 499 and the upstream was asked nothing more. But the trace never said so: the last try kept only its Again, so the Routing page's story ended on "... it is tried again in 2.0 s" and the list said "499 · failed", which reads as the closed session still retrying. - gateway: the three pauses (the last one left asked again, the same after spentAfter, and the group's replan through pauseAlive) mark the try whose pause it was `Gone` when the agent leaves in it. - Routing page: such a try says the agent canceled the request before the retry and nobody is asked again (en, zh, zh-TW, ja, de); the request list and the outcome label say canceled; the replay's dot goes home. - docs/subsystems/gateway-routing.md says so. Reproduced first with a fake upstream (httptest) answering 503 and one hanging, a real gateway server and a client that disconnects: single provider, group replan, streamed and not, hang mid-try. In every case the route ended at once with nothing in flight and the upstream saw no further request (the hanging one saw its request canceled); only the trace's last line was wrong. The plugin fetch path already sends the host an abort on cancel (host.js "abort"). Run: - TestAgentGoneInTheRetryPause (new, -race): agent leaves in the pause, single and group; upstream count stays, route done 499, no try in flight, last try Gone. Red with the Gone marking removed (Gone false), and red with the pauses ignoring the context (route not done). - routing-agent-gone.test.cjs (new): Chromium and WebKit, en/zh/ja/de, 1100 and 420 wide, 16/16; red (0/4) with the story and label change reverted. - go test -tags nogui ./internal/gateway ./internal/gui; routing-*, rest-try-now and ledger-retried GUI tests on both engines; gofmt -l; GOOS=linux and GOOS=windows go vet -tags nogui on both packages. Not tried: the reporter's own relay and proxy, or a real Claude Code / Codex window closed mid-pause. The one other red in that GUI run, routing-wb-restricted at 420 in Chromium under the full run (passes alone 3/3), is filed as #1905. |
||
|
|
e528aeb3ce |
agent: DevEco Code, Huawei's OpenCode, as an agent (#1885)
foobra asked for DevEco Code (npm @deveco/deveco-code), Huawei's
HarmonyOS coding agent. It is OpenCode underneath, so it joins through
openCodeLike as MiMo Code did (
|
||
|
|
fd907c986e |
gui: every resting key or account can be tried again by hand, on Routing and in the provider's key list (#1869)
A key resting after a 429 with a long Retry-After (a relay's 3600s) came back only by waiting or a restart, though relays often recover in a minute or two. The Routing page offered the lift (/api/gateway/unrest, which already takes any rest key) only to verify and restricted rests. - routing.js: every resting row with a rest key gets the button: "Try now" for quota, rate, retry-after and backoff rests, the old wording for verify and restricted. A lifted rest is remembered by key and the time it was lifted (liftedAt), so the history re-render, which reuses the try's rest, doesn't show it again; a newer rest still shows. - app.js: "Try now" beside the "resting · back at …" note in a provider's key list, posting the key's own rest key; not hover-only. - i18n: the three new strings in zh, zh-TW, ja and de. - gateway-routing.md: any rest can be lifted; only the rest ends, the backoff count stays. Run: rest-try-now.test.cjs (new: Routing row with the issue's zx retry-after rest, key list row; en/zh/zh-TW/ja/de, chromium and webkit, 1100 and 420px; asserts the post, the note gone, no sideways scroll, reached by wheel, the click doesn't scroll) 40/40, red on the old app.js/routing.js. 71 key*/routing*/rest* GUI files at concurrency 6: 826/831; the 5 reds (key-balance-card, routing-group-fold) pass alone and are timing under load (routing-group-fold fixed in the next commit). go test ./internal/gui passes. |
||
|
|
bf60d32bde |
gateway: a key set to a protocol its provider has no URL for is said on Routing and in the editor, not passed over quietly (#1702, edussss)
edussss set a relay key to Responses only on a provider with a Chat URL
and no Responses URL. perKeyBarred skipped the key (no endpoint for its
protocol), every key was skipped, so the provider was tried whole and the
request went out on Chat with nothing saying why. The owner: it shouldn't
fall back quietly.
Requests are still served on the URLs the provider has (so working setups
keep working), but now it is said:
- fallback.go: perKeyBarred remembers the protocol of the first key it
skipped for having no URL, and the whole-provider candidate carries it
as noURL.
- trace.go: Weighed.NoURL, so the Routing page sees it.
- routing.js: the row and the activity line say "key set to {api} only,
no {api} URL · sent on the others".
- app.js/app.css: the editor's key row shows an amber "No {api} URL" chip
(keyLacksURL) with a title that says how to fix it.
- i18n.js: the three strings in zh, zh-TW, ja and de.
- docs/subsystems/providers-accounts.md: the Keys row says so.
Run: go test -run 'TestKeyForAProtocolWithNoURLIsSaid' ./internal/gateway/
(the reporter's case: upstream /v1/chat/completions with k-resp, NoURL
"responses"; with an Any key added it goes to k-any and NoURL is empty);
key-nourl.test.cjs in chromium and webkit, en/zh/zh-TW/ja/de, at 420 and
1000 wide, no click-scroll, no sideways scroll: 40 pass; with i18n-keys,
gui-zh-tw/ja/de, key-copy, key-weight, key-weight-fit, key-import,
routing-key-windows, routing-keys-fold, proto-menu-overflow, nokey-editor
and ledger-protocol: 174 pass, 0 fail.
Broken by hand: without the noURL mark the Go test fails (noURL = "",
want "responses"); with keyLacksURL/noURLWord removed chromium fails 20
of 20.
Not tried: a real relay, or the GUI against a live gateway.
|
||
|
|
2d3b33bb78 |
usage: time tool-only replies only with visible reasoning evidence
Revises #1463 after the hidden-reasoning inflation review. Keep answers separate, retain evidence in routes and cached ledger rows, and exclude sealed or summary-only reasoning even without a token breakdown. Sync the backend and both GUI formulas. Checked real WorkBuddy DeepSeek, Codex and Claude bridge responses in an isolated HOME; sanitized timings and failures are in docs/verification. Chromium/WebKit speed regressions pass (20 tests, five languages). New edge regressions and loop-order check pass under race repetition. Restoring the old formula or removing the hidden guard fails TestVisibleReasoningSpeed. macOS/Linux/Windows vet/build pass. Full-suite verification is recorded in the issue at this head; inherited proxy/Bun 1.3.14 failures are retained, with clean Bun 1.4.2 rerun in progress. No installed app replacement. Rebased onto main by yetone (#1463). Conflicts with main's Own/Retried/ Queued/Tries row fields, HandedOn and the Codex speed floors were resolved by keeping both. The packed row's ReasoningHidden bit was 64, which main has since given to block_price.go's swapKnown, and main's rowHandedOn took 128, filling the uint8: Flags is now uint16 and ReasoningHidden is bit 512 (rowReasoningHidden; #1874's rowOwnCost took 256), read back in row(). The docs/verification notes and their sample JSON are left out of the tree; they stay on the contributor's branch and the issue. Run after the rebase: go test -tags nogui ./internal/usage/ and the gateway's reasoning/speed/TTFT tests, ok. |
||
|
|
bc2743f4b9 |
routing: a picked request goes back to live once it leaves the list, and the panel's stage has a place per provider (#1389, Creat55)
The reporter's two screenshots are the Routing window holding one request: at 13:42 the stage still showed a 13:22 Antigravity request, and at 15:58 it still showed a 13:42 qoder request while every request listed went to WorkBuddy's deepseek. A request picked in the list (or from the tray panel's row that opens the window on it) pins the stage. followListed lets a pin go when a filter leaves it out, but poll never did when the request dropped out of the 60 the page keeps, so the stage stayed on it for hours. poll now lets it go and follows live. The tray panel's mini stage (pDraw) had three places on the right, each a provider's account. A provider whose requests went from account to account filled all three, and the providers other sessions used were left off. A place is now a provider, naming the account its latest try went to, with how that went. A request under way when the page dropped it kept its panel dot waiting at its account until pUntil's 180 s limit, holding the dot, the place and one of four play slots. pPlay now ends it at the next trace update, as the window's play does through its rt(). The dot doesn't fly home red, since nothing failed. Run: - routing-pin-leaves.test.cjs (new): 5 languages, 420 and 1100 wide, chromium and webkit. On main it fails in every case with "the stage stayed on the picked request". - panel-routing-providers.test.cjs (new): 5 languages, chromium and webkit. On main it fails with three Qoder places. With only the pDraw part, it fails with "a dropped request still flies". - All 67 routing/panel/tray-bird GUI files: 429/429 in chromium and 428/429 in webkit. The one webkit red was routing-steady under --test-concurrency=4 (1.69 px), which is the known #1804. It passed 3/3 alone and 6/6 in parallel with and without this change. panel-routing's stage expectations are unchanged. Not tried: the reporter's real gateway traffic, and Windows. |
||
|
|
d13a4a1396 |
gui: Routing's story of a request keeps its logos as it is redrawn, so they no longer blink
The owner: in "How the request at … was routed" the provider logos "会不
停地闪烁". renderSteps made every line and logo afresh whenever the story
changed, which is on every new request and at each step of a live one,
so with an agent at work the logos were made again and again, and WebKit
draws a mask logo made afresh as nothing for a moment.
A line whose text, kind, model and logos are unchanged is now kept as it
is, and a changed line takes the logos of the lines it replaces
(keepIcons), so only what changed is made.
Run: routing-log-icons.test.cjs's new case walks a live request through
three steps (trying, 429 and trying the next, done) and checks the why
line and every logo are the same nodes after: chromium and webkit, en,
zh, zh-TW, ja, de, 14/14 with the old cases; the 10 new cases fail on
origin/main
|
||
|
|
091593f7d3 |
gateway, gui: a WorkBuddy account the vendor restricted (403 11140) rests 2 hours as restricted, and Routing names the appeal as the way back (#1849)
WorkBuddy answers an account it restricted for unusual activity with
403 {"code":11140,"msg":"request illegal","displayMsg":{"en":"Your
account has been restricted due to unusual activity",...}}. failure()
read it as an unknown failure, so the account rested 1-10 minutes and
was asked again, refused, all day.
What changed:
- provider: WBRestricted knows the refusal by code 11140 (top level,
data or error; number or string; whole, so 111400 isn't it) or by its
displayMsg words. wbExplain ends the built-in's error with
WBRestrictedHint.
- gateway: a new failRestricted ("restricted") rests restrictedRest, 2h:
one refused request per account per 2h, and a lifted restriction (or a
misread refusal) comes back the same afternoon; Unrest lifts it at
once. It is read from the hint in the error (restrictedSaid; both the
built-in and the plugin translate the vendor's body before failure()
sees it, so the raw JSON never reaches it in a chat try), or from the
raw body only for a WorkBuddy candidate (restrictedRefused,
isWorkBuddy), since another vendor's 11140 is its own. Bare "request
illegal" is not matched. 11128 stays promptRefused and rests nobody.
The stale-allowance shortcut skips it, as it does model refusals.
drawsWorkBuddy now uses isWorkBuddy.
- plugin: @magpie-community/opencode-workbuddy-auth 0.1.17 (plugins
caf3908) ends the error with the same hint; the mover's min is 0.1.17
so keepMovedCurrent brings moved users to it.
- gui: Routing labels the try "account restricted by the vendor", says it
rests because only the vendor lifting it brings it back and to appeal,
shows the hint translated, and the account's row has "The restriction
is lifted — try it again" (POST /api/gateway/unrest). en, zh, zh-TW, ja,
de.
- docs/subsystems/gateway-routing.md says the above.
Run: gofmt -l (clean); go vet darwin, GOOS=linux -tags nogui, GOOS=windows
on gateway, provider, gui; go test ./internal/gateway ./internal/provider
./internal/gui (ok). New Go tests use the reporter's literal body through
the vendor's shape, the built-in's and the plugin's, a string code and the
words alone; another vendor's 11140, a non-WorkBuddy account with the same
body, 11128/14018/111400 not restricted; an e2e through the fake plugin
host where the restricted account is skipped by the next request.
Broken by hand, each went red: rest case removed, restrictedSaid removed,
the match unscoped, the raw match removed, the provider hint removed.
GUI: routing-wb-restricted (chromium and webkit x en/zh/zh-TW/ja/de x
1100/420px, 20 pass), routing-wb-refused, i18n-keys; after the rebase
every GUI test of the Routing page (107 files, both engines): 103 green.
The 4 red ones fail the same in WebKit on origin/main
|
||
|
|
73c3c16cf1 |
gui: on Routing picked mid-request, the request's dot waits at the account answering it, not where the account was a frame before (#1859)
What changed: a request's dot, let go at the account that answers it, is held there (`.pkt.held`) until the try ends. It was posed only while flying, so any layout after it landed left it where the seat had been. Picking Routing while a request is under way does exactly that: the view's box is 0 wide while hidden, so byWidth marks it max560 and the stage comes back stacked (accounts under magpie) for its first frames. With reduced motion the flight is one frame, so the dot lands at the stacked seat's edge; the stage then goes wide and the wires follow (the stage's ResizeObserver runs layout()), but the dot doesn't. That is ouchxp's screenshot: a dot at the left of the line under the stage, and the seat's own dot plain. A window resized while a request waits did the same with any motion setting. Now play() records each held dot with its row (`holds`), and layout() poses every held dot at the end of its row's wires again (holdAll), so it follows the seat through the narrow-to-wide switch, resizes and FLIP moves. holds is cleared with the play, and by stopPlays. Not changed: byWidth still marks a hidden box narrow, so the stage is stacked for a frame or two after the view is picked. Skipping a 0 width there also hides this case at wide windows, but not a resize or a narrow window, so the fix is in the held dot. Run (worktree on |
||
|
|
6669d497d0 |
gui: an account's seat on the Routing stage tells each of its windows and when each resets in its tooltip (#1835)
A seat on the stage says the fullest window's figure while idle
("40% used · renews in 2h"), and what it is doing while it answers. The
other windows, and their resets, weren't anywhere on the stage. Its
tooltip, which held only its id, now adds one line a window, the same
lines Accounts and keys shows (winsOf, the Usage page's readings,
#1833). It is a tooltip rather than a second line on each seat because
the stage is the live picture of a request, and a line more on every
seat would crowd it. Live only.
docs/subsystems/gui-shell.md: under Routing account windows.
Run: tests/routing-seat-windows.test.cjs (new), chromium and webkit,
en, zh, zh-TW, ja, de at 1100 and 420px: the answering seat's title is
its id and both windows, and the seat whose only card is another
computer's keeps its id alone. 22/22 pass, and 11 of 11 fail in chromium
with routing.js as before. Not tried with a real account.
|
||
|
|
0801c7bb02 |
gui: Routing's Accounts and keys has a refresh beside its heading that reads the accounts' allowances again, by hand only (#1834)
The windows each account shows (#1833) are the Usage page's readings, read the ordinary way when Routing opens. To see them fresh one had to go to Usage and back. The icon button beside "Accounts and keys" makes the asked read Usage's Refresh now makes (loadQuotas(true), /api/usage/quotas?asked=1). It turns while the read is on its way, a click then asks nothing more, and the rows are drawn from what comes back. There is no timer: nothing reads again by itself, as #1518 has allowances read only when asked. It shows only live, with a subscription account listed. Its tooltip is new ("Read the accounts' allowances again", in zh, zh-TW, ja, de), and its label reuses "Refresh now". docs/subsystems/gui-shell.md: under Routing account windows. Run: tests/routing-read-allowances.test.cjs (new), chromium and webkit, en, zh, zh-TW, ja, de at 1100 and 420px: title and label, on the heading's line, opening reads only unasked, one asked read on click with the button busy until it lands, a second click while busy asks nothing, the windows show the new reading, the view doesn't move, and no asked read in 2.5s after. A list of keys only has no button. 24/24 pass, and 11 of 12 fail with routing.js, routing.css and i18n.js as before. gui-ja, gui-zh-tw, gui-de, i18n-keys and routing-account-windows pass. Looked at in screenshots at 1100px (en) and 420px (ja). Not tried with a real account. |
||
|
|
6627ddd54b |
gui: a subscription account in Routing's Accounts and keys shows each of its windows and when each resets, as the Usage page read them (#1833)
The list said one figure for an account, the window routing went by. A
Claude account's 5 hours and 7 days, or Codex's, each with its reset, are
now on a line under it ("5 hours 40% used · resets in 2h"). cardOf matches
the route's account to app.js's quotas: a subscription card of this
computer (no from) whose provider is the account's agent (a plugin's
provider id) or its provider, and whose user is the account's, ignoring
case. Nothing new is read from vendors: opening Routing asks
/api/usage/quotas in the ordinary way when the readings are missing or
over a minute old, never ?asked=1. A kept day's list shows none, as its
requests were weighed by readings long gone.
loadQuotas now treats an answer that isn't a list of cards as a failed
read and keeps what it had. Routing reading quotas showed it: a page given
{} stored it and renderQuotas threw on quotas.some.
docs/subsystems/gui-shell.md: Routing account windows.
Run: tests/routing-account-windows.test.cjs (new), chromium and webkit,
en, zh, zh-TW, ja, de at 1100 and 420px: exact window lines, none for an
account whose only card is another computer's, no overflow, no asked
read. 22/22 pass; fails with app.js, routing.js and routing.css as
before. Looked at in a screenshot at 1100px (en) and 420px (de). All 60
routing-*.test.cjs and click-scroll: 636 pass, 5 fail, all in WebKit in
routing-group-fold (en, ja, de) and routing-sessions (en), which fail the
same alone on the old assets at
|
||
|
|
50adf78e66 |
gateway, gui: the web searcher picked in Settings is never handed on to another provider, and one that answered without searching is said so (Gearclickist on Discord)
Cause: Gearclickist picked the Grok subscription's grok-4.7 in Settings ›
Web search. Their grok rows were about 1.3k tokens. That is the size of a
Grok request that ran no search. With the tool and searching, our real
Grok account gives 6k-66k input every time, and /models says
supports_backend_search for all four models. So on their account Grok
answered from what it knew. searchWith read that as "found nothing", and
modelSearch handed the search to the next of Searchers() by rank: Codex's
gpt-6-astra, a pricier subscription model they never picked.
Change:
- modelSearch: a searcher named in Settings gives way to no other
provider. Its error goes back to the model ("no other provider searches
in its place"), and webSearch then asks the search APIs, if any are set
up. Automatic keeps its fallback (#669) with the Routing row that says
why.
- searchWith tells a reply with no server_tool_use or
web_search_tool_result (errNotSearched) apart from one that searched and
named no page (errFoundNothing). CallFor gets notSearched.
- namedFailed/SearcherFailed keep the named searcher's last failed search,
cleared by its next success or by picking another searcher.
/api/settings returns it as searchFailed.
- Settings › Web search puts a warning at the start of the row's help
(before the ellipsis) naming the searcher, when, and why ("answered
without searching the web, so its account or plan may not offer web
search"). The help text now says a picked provider is never replaced by
another provider. The Routing row (kindWhy) says not-searched too.
zh, zh-TW, ja and de strings added.
- docs/subsystems/gateway-routing.md rewritten for the rule.
Run (worktree on origin/main
|
||
|
|
31c1e3ab1c |
gui: dates, times and numbers read in the GUI's language, not the system's, so a Chinese Mac set to English no longer shows Routing's days as 10月11日 周日 (#1843)
What changed: intlLang() was the GUI's tag for Intl, but returned
undefined for English ("the system's own formats"), and about 60 calls
in app.js, routing.js, library.js, plugins.js, caller-keys.js and
context.js formatted with no locale, [] or undefined anyway. All of
those follow the system's locale, so with magpie set to English on a
zh-CN Mac, Routing's day pills read "10月11日 周日" (the report), and so
did request times, reset/until titles on Accounts and Usage, plugin and
library dates, the restore notice, and key rest times. Now intlLang()
always returns a tag: zh-CN, zh-TW, ja-JP, de-DE for those languages,
and for English the system's own English (en-GB keeps day-month) or
plain "en" on a system in another language. Every date, time and number
formatting call in the assets takes intlLang(); the `intlLang() || "en"`
and `documentElement.lang || undefined` variants are folded into it.
<html lang> stays "en" for English. Routing's clock formatters, made
once, are made again when the language changes.
Tests: dates-gui-lang.test.cjs runs English on a zh-CN browser, English
on en-GB, and zh, zh-TW, ja, de on en-US, in Chromium and WebKit at
1100 and 390px: Routing's day pills (in the bar and under its menu) and
a request's time must read in the GUI's tag and not the browser's.
TestDatesFollowGUILanguage (Go, so CI runs it) fails on any formatting
call in the assets given no locale, [] or undefined.
github-token and reset-each-title computed their expected text in the
browser's locale, i.e. they encoded the bug for zh/ja/de; they now ask
intlLang().
Run: with routing.js put back to origin/main the new GUI test fails 10
of 12 (all but en-GB, where the system's English is right either way);
with intlLang() returning undefined for English the English cases fail.
TestDatesFollowGUILanguage fails on origin/main's routing.js (lines 244,
688, 1925, 2230, ...) and passes on the fix. gofmt -l clean; go vet
./internal/gui on darwin, GOOS=linux -tags nogui and GOOS=windows ok;
go test -tags nogui ./internal/gui ok. Full GUI suite (621 files,
concurrency 6): 51 failures in 21 files; rerun alone, the same 8 files
fail the same way on an origin/main
|
||
|
|
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.
|
||
|
|
552e974f22 |
gateway, gui: a classifier that can't say keeps the intent the turn before had, rather than sending the turn to the group's first member (#1826)
What: in ruleFor, when the classifier errs (an error, no answer within
classifyTimeout, an answer that isn't a number, or resting classifyRest
after a failure) and the conversation's turn before had an intent that
is still one of this turn's (Classified.After), the turn keeps it:
Classified.Intent is that intent, the new Classified.Fallback
(json "fallback") is "previous", and Error is kept. With no intent
before, nothing changes: no rule with an intent matches. The Routing
page's classWhy says "… but couldn't — {err} — so the turn keeps
“{intent}”, as turn {prev} was.", in zh, zh-TW, ja and de too.
Why: #1826 section 3: two timeouts in a row (20:54:43, 20:55:20) sent
turns of a known 复杂 conversation to the group's cheap first member.
Not done: persisting turnRules beside the sticks (the issue's idea 3).
After a restart a turn under way still waits for the next turn, with the
stick holding it meanwhile; with the previous commit the stick's key no
longer changes mid-conversation, which was how the reporter lost both.
Run: TestIntentClassifierFailsKeepsThePreviousIntent (down, then resting,
then a conversation with nothing to keep) fails with the fallback line
taken out and passes now; routing-intent-fallback.test.cjs (Chromium and
WebKit, en/zh/zh-TW/ja/de, 1100px and 390px with no sideways scroll)
30/30, and 10 of 15 red on Chromium with the old routing.js;
routing-intent-entry, routing-effort, panel-routing, routing-folder,
i18n-keys and gui-de pass; go test ./internal/gateway -count=1 green
(295s); go test -tags nogui ./internal/gui green; gofmt -l clean; go vet
on darwin (gateway), GOOS=linux -tags nogui ./... and GOOS=windows ./...
clean.
Not tried: a real classifier timing out in a live session.
|
||
|
|
7639c1d8db |
gateway, gui: a web search made in place of the picked searcher says in its Routing row which searcher failed or found nothing, and why (Gearclickist on Discord)
Gearclickist picked Grok as the web-search model (代搜). In Codex, a web_search did go to Grok, but Codex's default search model then searched, and nothing said why. modelSearch asks the searcher picked in Settings first. When it errors, or its reply names no page it found, the next of Searchers() searches in its place (#669, up to three). The first error was dropped, so the Routing row only showed the model that answered. Falling back stays. searchingInstead now puts on the search's CallFor the searcher asked first (instead), whether the user picked it (picked), and its error (why) or that it found nothing (nothingFound, from a new errFoundNothing that searchWith and kimiSearch wrap). Routing's kindWhy says "<grok>, the searcher picked in Settings › Models › Web search, didn't search for Codex's <model>: <why>. So magpie had <next>, the next searcher it can use, search in its place." There are 7 new strings, in zh, zh-TW, ja and de. Grok itself: magpie's exact search body was sent to real Grok (4 models, 6 queries) through the built-in, and replayed through the plugin. Every time it answered with pages, so no Grok or plugin cause was found, and there is no plugin publish or mover min raise. The next time Grok fails for Gearclickist, the row now names the error. Run: - go test ./internal/gateway ./internal/agent -count=1 under a sandbox HOME: ok (933s, 720s). - TestSearchInPlaceOfPickedSaysWhy (found nothing, failed) passes. With the searchingInstead call taken out by hand, both subtests go red. - search-instead.test.cjs: chromium and webkit, en/zh/zh-TW/ja/de, at 1100 and 520px: 10/10 pass. With kindWhy's new branch turned off by hand: red. - search-mcp, routing-side-calls, provider-search and routing-kind GUI tests pass. - go vet on darwin, GOOS=linux -tags nogui, and GOOS=windows; gofmt -l is clean. Not verified: a real Grok search failing for Gearclickist's account, since it couldn't be reproduced. |
||
|
|
908c910931 |
gateway, gui: Stays: Strict keeps a conversation on the account or key that answered it, even past its cap, and passes its error on rather than moving it (#1797)
miniers asked that a conversation never move to another account: a
move changes the account a vendor sees mid-conversation and loses its
prompt cache. Session affinity keeps the account while it can answer,
then moves on.
The new affinity mode "strict" (Stays: Strict) does what session does
for a new conversation. Once one has an account, strictKeep asks that
account alone (its other models too) and no other account, key or
provider:
- one resting or spent is still asked, and its error (429, 402, 5xx)
goes to the agent rather than to the next candidate;
- one over a user cap is asked past it (plan's capped candidates,
capHeldOnly);
- one held for credits answers 429 naming Stays: Strict rather than
moving;
- one removed, turned off, barred or not allowed for the key counts as
gone, and the conversation is routed as usual.
A last try that fails verification is not rested for a strict
conversation that had nowhere else to go.
Set in the provider editor and the Routing page's pool row (GUI, all
five languages), `magpie groups ... stays=strict` (strict-session,
never-move), and the TUI ("stays strictly"). Documented in
gateway-routing.md, reference.md and the site's start pages (en, zh,
ja).
Run:
- go test -tags nogui ./internal/gateway (-timeout 30m under load ~150),
./internal/provider ./internal/tui ./internal/cli: ok. The three
TestStrictAffinity* tests fail on the code before this commit (200
where 429 was expected, acct-2 answering).
- GUI: stays-strict.test.cjs, chromium and webkit, 900 and 560px, en,
zh, zh-TW, ja, de: 30 of 30. On the assets before this commit it
fails 15 of 15 in chromium. routing-*.test.cjs pass but for
routing-steady's webkit 1.69px shift, which fails on the old assets
too: filed as #1804.
- gofmt -l, go vet (darwin, linux, windows), full go test ./... before
the push.
Not tried: a real agent conversation held on a real rate-limited
account.
Known and left: planLevel doesn't merge a nested group's sub.held, as
before this commit.
|
||
|
|
c533499446 |
provider, gui, cli: a group can keep its models out of the lists agents see, offered through the group alone (#1783)
cybershape asked for a client's model list to show only a group, not every model behind it. A provider could already be kept for routing groups (Provider.Unlisted), but that hides the whole provider, and the models a group names may come from providers used elsewhere too. Group.Unlists (json "unlists"): the models a group names (a member fixed at an effort counts as its model) and those its patterns match leave Catalog(), so `magpie models`, /v1/models and every agent's list (CatalogFor) show the group without them. They stay in Served(), so a group routes over them and a request naming one as provider/model is still answered, and Unlisted() returns them for the GUI as it does an unlisted provider's. A nested group keeps its own setting; a group switched off or hidden keeps nothing out. With no group unlisting, Catalog() takes a fast path and is unchanged. - Routing view: the group editor's "Model lists" (Its models too / The group alone, segmented, with a hint), saved with Save; the card shows "Its models unlisted". Both group Save paths send unlists. zh, zh-TW, ja, de. - CLI: `magpie group set <id> listed=no|yes`; `magpie group <id>` shows listed: no. - TUI: the group member picker offered Catalog(), so models kept out of the lists (an unlisted provider's, before this too) couldn't be put in a group from the TUI. It offers Served(), as the GUI's picker does. - docs/reference.md, Routing groups: listed=no. Product call: a per-group switch, off by default, rather than hiding members of every group, so existing lists don't change under anyone. Run: - go test ./internal/provider -run 'Group|Catalog|Unlisted|Served', ./internal/gui, root package, ./internal/tui: ok. TestGroupUnlistsItsModels fails with the Catalog filter removed; TestMemberOptionsOfferUnlistedModels fails with the picker on Catalog(); TestApplyGroupPairs covers listed=no/YES/maybe. - GUI group-unlists.test.cjs, Chromium and WebKit, en zh zh-TW ja de, at 1100px and 420px: 20/20. i18n-keys: ok. - gofmt; go vet darwin, windows, linux (-tags nogui): clean. Not tried: with the reporter's own client; a real agent's model file written after toggling (CatalogFor is covered by the test). |
||
|
|
446bffcac7 |
gateway, gui: a Routing row's share used renews with its own window, not the biggest one (#1778)
Vigilans' Factory account showed "32% used · renews in 27 days": the week's 32% beside the month's reset. Allowance.For gives the fullest window's share and the renewals biggest first, and routing.js paired the share with renews[0], so for any account of more than one window the row mixed two windows. - provider.Allowance.Fullest(model, now): the reset of the window For's share is of (the later of two as full; a window whose reset has passed counts as empty, as For does). - The trace's Weighed gains usedRenews (from weighRouted's left.fullest); routing.js's usedRenews(w) uses it in both the story rows and the account rows, and falls back to renews[0] only for an account of one window (a route recorded before this commit). - Smart's order is unchanged on purpose: it goes by the biggest window, and Factory's month holds less than its weeks add up to, so what a week leaves isn't lost at the week's reset. docs/reference.md says so, and gateway-routing.md names Fullest/usedRenews. Run: - go test ./internal/provider ./internal/gateway -run 'Fullest|UsedRenews|Weigh|Routing|Smart' and the packages whole. - TestUsedRenewsWithItsOwnWindow fails with left.fullest set to the biggest window's reset (broken by hand, then restored). - routing-key-windows.test.cjs: 44/44 in Chromium and WebKit, all languages and widths; it fails on HEAD's routing.js. - Every routing-*.test.cjs plus panel-routing in both engines: 594/601. The 7 WebKit failures are clicks waiting for an element to be "stable" under load average ~44, in routing-group-fold (#1612, #1672), routing-sessions (#1307) and routing-days-fit. routing-days-fit passes run alone. The other two fail the same alone with HEAD's routing.js. Not tried against a real Factory account: the windows are those the Factory plugin's limitWindows reports (5h/7d/30d with resetsAt). |
||
|
|
6c1c0a7472 |
gateway, gui: magpie's image recognition is an MCP server of its own, /mcp/magpie/vision, with one analyze_image tool (JonahFu on X)
What: beside /mcp/magpie/web-search, the gateway serves the model that describes images (Settings › Models › Image recognition, else magpie's automatic pick) as a Streamable HTTP MCP server. analyze_image takes an image (absolute file path, http(s) URL or data:image URL) and an optional prompt: without one it is described as a model's image is (same cache and system text), with one the prompt is asked beside it. The JSON-RPC serving, guard and Origin check are shared with the web search server (serveMCP). A file path is read only for a local, unproxied caller, up to 20 MB, and only when its bytes are an image; another computer sends a URL or data URL with a gateway key. Each call holds the key's limit (budget.Reserve) and reads in Routing as the agent's analyze_image call. Settings › Models shows the address under Image generation (#visionMcpRow), in every language. Run: - go test -tags nogui ./... (no failures); gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/gateway. - New TestVisionMCPAnalyzesImage / WithNoSeer / Guarded / HeldToKeyLimit. Broke the local() guard by hand: TestVisionMCPGuarded went red on the other computer's file path being read. - GUI (chromium + webkit, en/zh/zh-TW/ja/de, 1100 and 520px): vision-mcp, search-mcp, public-url-default, images-missing, settings-sections, i18n-keys, routing-vision-why: 95 pass. The row was first put between the two pickers and images-missing went red (it finds them by position), so it sits last. - Real use: this build under a sandbox HOME holding only the owner's OpenRouter provider, Image recognition set to openai/gpt-6-luna. initialize, then tools/call with docs/screenshots/font-settings.png as a file path and a prompt: the model listed every settings row and its value correctly. Not tried: a real agent (Claude Code, Cursor) mounting it; its MCP exchange is the same as the web search server's. |
||
|
|
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. |
||
|
|
0fcf563e61 |
routing: a pause rule can hold by folder, in some or outside them (#1606, Ti800)
Ti800 keeps a subscription's quota for one long task in one folder and wants every other request kept off it (their option A). A pause rule held by hours, days and agents only; it now holds by folder too. What changed - provider.Rule gains ExceptFolders (json exceptFolders, CLI except-folders=, aliases except-folder/not-in/outside): the folder the agent works in is in none of them. An agent that says no folder isn't known to be in one, so except-folders holds for it; folders= still never matches an unknown folder. Both conditions are allowed on send-to and pause rules (Rule.ByFolder, inFolders); cleanRules cleans and dedupes both and lets a pause hold by time, days, agents and folders. - PausedOut takes the request's folder. The gateway reads it (workDir) only when a pause by folder is on the way (PausesByFolder); embeddings and System One's decision calls pass none. Paused carries Folder and ByFolder for the trace. ruleFor reads the folder for except-folders rules too. - Group sharing drops every rule by folder, except-folders included. - CLI usage, TUI hint, ParseRule/Line round-trip except-folders. - GUI: the rule editor has a "not in folder" condition beside "in folder", both shown on a pause and kept when a rule turns into one; a folder that isn't a whole path and a pause with no condition are refused; the group's rule and the trace say "not in …", and a paused reason says the folder read or that the agent said none. Strings in zh, zh-TW, ja, de. - Docs: gateway-routing.md, site start.html (en, zh, ja). What was run - go test -tags nogui ./internal/provider ./internal/gateway (folder, pause, share, rule tests); full go test ./... before pushing. - Broke it by hand: with the gateway's folder read replaced by nothing, TestPauseByFolder fails (in-task requests went to the other member). - GUI: routing-pause-folder.test.cjs (new), routing-pause, routing-folder, i18n-keys and 10 other rule-editor tests in Chromium and WebKit, en/zh/zh-TW/ja/de, at 1100px and 390px. - gofmt -l; GOOS=linux and GOOS=windows go vet of the touched packages. Not tried: a real Claude Code subagent's request against a live group; by the documented rule a request without a folder is paused off the kept member, which is what the reporter asked for. |
||
|
|
35eea09464 |
gateway: a provider routed its own way keeps that order inside a group that routes another way (kchen0x on X)
kchen0x had a Smart routing group with Antigravity (9 accounts, set to 按顺序) and a Business account. Requests still went to the 9th account, the one renewing soonest. planLevel pooled every member's keys and accounts into one list for any group not routed in order, so the provider's own routing was never read; Smart then put the soonest renewal first. Now a member whose provider routes other than Smart, and other than the group does (ownRouting), is planned as a nested group already is: a unit weighed by the first account or key it would try (firstAwake), then tried whole in its own order. A provider left on Smart is pooled as before. leastHeld, which reorders a rotate group's first request, leaves such a group alone as it does one holding a nested group (without that, a rotate group still came back "k2 k1 k3 kb"). GUI hint (GROUP_NEST, 4 languages), start docs (en, zh, ja) and gateway-routing.md say so. Run: - TestProviderKeepsItsOwnRoutingInAGroup covers outer Smart, rotate, usage, pace and manual, plus a Smart provider still being pooled. On the old planLevel it fails with "k3 k2 k1 kb" (the reported order). - go test -tags nogui -count=1 -timeout 40m ./...: all ok. - gofmt -l clean; GOOS=linux and GOOS=windows go vet ./internal/gateway. - GUI: i18n-keys, gui-ja/de/zh-tw and every *group*/*routing* test, both engines: 765 pass. A first run beside the full go test had 9 webkit timing reds (routing-group-fold, routing-keys-fold, routing-ctx-still, gateway-key-groups); each file passes alone, and the whole set passes when nothing else runs. |
||
|
|
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.
|
||
|
|
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 |
||
|
|
ae70d8eac8 |
routing: a group's rule can hold by the folder the agent works in (Cario0x on X)
Cario0x on X asked to route by the project being worked on. A group's rule now has a "folders" condition: it matches when the request's working folder is one of the listed folders or inside one. It combines (AND) with the existing conditions: tokens, images, intent, time, agents and quota. - gateway/workdir.go reads the folder each agent states in its own request: - Claude Code: "Primary working directory", including "(was …)" after a move. - Codex: <environment_context><cwd>. - Pi: <cwd>. - OpenCode: <env> "Working directory". The last one stated wins. Assistant text and tool results are ignored. A request that states no folder matches no folder rule: unknown, never empty. - provider/rulefolder.go matches a folder only at a path boundary. - ~ is the home folder. - C:\x is the same folder as /mnt/c/x, and \\wsl$\Distro\x as /x. - Case is ignored on macOS and Windows, and always for a drive. - A rule's folder must be a whole path. Pause rules can't have folders. - The trace's RuleHit.Folder makes the Routing page say "The agent works in …". - GUI: an "in folder" condition in the group editor, hidden on pause rules. Strings in zh, zh-TW, ja and de. - CLI: `magpie group rule add … folders=~/oss,"~/My Project"`. The TUI shows the condition. - Docs: docs/subsystems/gateway-routing.md and site start.html (en, zh, ja). Fixtures are real requests from Claude Code 2.1.296, Codex 0.162.0 and Pi 1.1.0, run in a sandbox from a folder named "a&b <c> 中文" or "My Proj", with the sandbox path replaced. Run at this head: - go test ./... green. - gofmt -l clean. - go vet green for darwin, GOOS=linux -tags nogui and GOOS=windows. - GUI routing-folder.test.cjs: chromium and webkit, en, zh, zh-TW, ja and de, 1100px and 390px (no horizontal scroll). It fails on the old routing.js. - Related routing, group and i18n GUI tests: 85/85. - Full GUI suite: 5611/5631 under --test-concurrency=6. Rerun alone, every failure passes except: - skill-install-agents-all (chromium, 420px), which is red on origin/main too: #1554. - The menu-scroll track flake, which flakes on main as well: #1550. - e2e: a sandbox HOME, a dev build and fake upstreams, with real Claude Code 2.1.296 (`claude -p --model group/fd`). - From proj/acme/web, rule 1 matched and the request went to kb. - From proj/acme-old, no rule matched and the request went to ka. The trace and UI showed the folder. |
||
|
|
552c2244dd |
gateway, gui: magpie's web search is an MCP server too (Kayphoon on Discord)
What: /mcp/magpie/web-search serves the gateway's existing web search
(webSearch: the searcher's model, a Kimi Code plan's service, the search
APIs, in the order Settings sets) as an MCP server with one web_search
tool, so Cursor, Claude Desktop (through mcp-remote) or any agent can
mount it. Streamable HTTP only: POSTed JSON-RPC messages and batches are
answered with JSON (initialize with version negotiation, ping, tools/list,
tools/call), notifications get 202, GET/DELETE 405. Legacy SSE isn't
served. Two segments under /mcp/, so it can't hide a signed-in server's
/mcp/{name}.
Guards: lanGuard as on every route (a gateway key from another machine,
only while shared; rebound browser hosts refused), plus a local/shared
backstop in the handler. Any web page Origin (localhost too) is refused
unless listed in Settings, as the MCP spec asks of a server. keyLimited
passes /mcp/ by, so each tools/call reserves the calling key's limit
(budget.Reserve) and a spent key gets a tool error with no search. The
search is marked CallFor{MCP: true}, and Routing says the agent called
magpie's web_search MCP tool. With nothing that can search, the tool error
says where to add a search API.
GUI: Settings > Models > Web search has an "MCP server" row with the
address (from the Settings page's gateway URL) and Copy, in en, zh, zh-TW,
ja, de. docs/subsystems/gateway-routing.md has a section on it.
Run:
- go test -tags nogui -timeout 40m ./... (all ok, at the first rebase),
then gateway/gui package tests again after rebasing onto
|
||
|
|
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
|
||
|
|
3d7acfb40f |
routing: the mode chip leads to where the routing is set, and a lone key names none
xczzhh on X: "这个路由策略能自己选吗,我的一直是smart,也改不了好像". The Routing page's hub chip and the Accounts and keys heading said Smart for every provider, even one with a single key on, where there is nothing to route, and nothing on the page said where it changes. Now, where routing can be changed (a group, or a provider listed in /api/groups' pools: two or more accounts or keys on), the chip and the heading are .rt-go controls (goTo/goRouting): a click or Enter brings the group's card or the provider's row under Several accounts or keys into view via scrollOnPurpose, marks it (rt-found, off under reduced motion) and focuses its routing picker. A provider with one on names no routing, and the mode paragraph says to turn on a second in the provider's editor (LONE, in zh, zh-TW, ja and de). The header is drawn again when the groups arrive (headOf). routing-weight-chip's fixture now lists its two-key relay in pools, as /api/groups does. Run: routing-mode-goes.test.cjs 40/40 (chromium+webkit, en/zh/zh-TW/ja/de, 1100px and 420px); all 20 chromium cases fail on the old routing.js. All routing-*, quota-pool*, rate-limited-sink, panel-routing, click-scroll, view-scrollbar-drag and i18n-keys tests pass (group-fold, keys-fold, flood and context-fold failed only under a 6-way parallel full run and pass alone, as on main). go test -tags nogui ./internal/gui ok. |
||
|
|
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
|
||
|
|
c43681d64c |
gateway: a group whose every member is busy asks them again within a budget, 1 minute by default, instead of ending the agent's turn on the last one's error (#1418, Aliceonly)
Aliceonly's Codex turns ended on server_is_overloaded when plus-B and sub2api were both overloaded, to be told "continue" by hand. #1421 promised a group-wide budget for errors that pass. This builds it. When every member of a group has failed in a way that passes (busy: 408/500/502/503/504/529 that isn't a proxy, quota or response protection; a 429 that is a short rate limit, not a plan or credit), and nothing of the reply has been sent, the members that failed so are asked again in turn after a pause (replan). The pause starts at 2s, doubles each round up to 30s, and is never shorter than the soonest Retry-After; a member still asking for time goes after the others. At most 6 rounds, and only while the group's Patience lasts, counted from the first time every member had failed (provider.Group.Patience: 0 = 60s default, -1 off, at most 240s). While another member is busy too, the last one isn't first retried alone (passing): the members take turns. The last member's failure is held while the budget lasts, and a streaming agent gets SSE keepalives through the pause (pauseAlive). The trace's try says Again (the pause), Replan (how many) and Patience. Plain providers are unchanged. GUI: the group editor's "Every member busy" row (Off / 1 min / 2 min / 4 min) and the trace's line for a replanned try, in en, zh, zh-TW, ja and de. Run: - TestGroupWaitsOutEveryMemberOverloaded, TestCodexStreamWaitsOutOverloadedGroup (new): both fail with patience forced to 0 (the old behaviour: the 529, and the response.failed stream, reach the agent), pass now. - go test -tags nogui ./... under a temp HOME: all ok. - gofmt -l: clean. go vet (darwin, GOOS=linux, GOOS=windows) on internal/gateway and internal/provider: clean. - GUI: group-patience (new), group-first-token, i18n-keys, gui-ja, gui-de in Chromium and WebKit: 15/15 pass. - Real use: a sandbox `magpie serve` on 127.0.0.1:3782 under a scratch HOME, group/sol of two Responses providers on a fake upstream that sends 200 + response.created/in_progress, pings, and 20s later response.failed server_is_overloaded. curl streaming /v1/responses: plus-B failed at 20s (held, not let through), sub2api at 40s, 2s pause, plus-B asked again answered "hello from a"; the client saw only keepalives and the reply. Trace: plus-B 529, sub2api 529 with again 2000 replan 2 patience 60, plus-B 200. With both always overloaded the request ended after 3 rounds (127s) with the vendor's response.failed. |
||
|
|
ddd4f43144 |
provider: a routing group can be duplicated, from its menu on the Routing page or with magpie group copy (lc on Discord)
provider.CopyGroup(id, name) saves a copy of the group as it is now: its
models and patterns, routing, stays, rules, classifier, effort, context,
levels, and fast and off members. The copy is deep, so its rules' time
windows aren't shared. Its name is the one given, or "<name> copy", with a
number added past a name in use. Its id comes from the name, numbered past
any id in use, removed ones included. It is listed right after the group
it copies. The copy is a group of the user's and switched on, even when
it copies a found group or a switched-off one. The original is unchanged.
Surfaces:
- GUI: a group row's menu (right-click, or a click on its logos) has
Duplicate under Move up and Move down. It posts /api/groups/copy with
the id and t("{name} copy"), so the name is in the reader's language.
It asks before discarding an editor with unsaved changes. The status
then says "Duplicated {name}". No click scrolls the page.
- CLI: magpie group copy <id> [name]; duplicate, dup and clone work too.
- zh, zh-TW, ja and de strings. docs/reference.md and the site's start
page (en, zh, ja) list the command.
Run:
- TestGroupCopy (internal/gui): the copy has the models, pattern,
routing, rule and off member, is on, and is listed after the original.
The original stays off and unchanged. A second copy is "Fast copy 2" /
fast-copy-2. An unknown id is refused.
- TestGroupCopyCLI (root): the default name, a given name, a found
group's copy as the user's, and the errors.
- group-duplicate.test.cjs: Chromium and WebKit, en/zh/zh-TW/ja/de at
420px, 10/10. It fails 10/10 on the old routing.js. Siblings
group-arrange, removed-groups-menu-scroll, group-bulk-remove and
click-scroll pass 36/36.
- Sandbox CLI (sandbox HOME): group copy and duplicate made "DupTest copy"
and "DupTest copy 2", listed after DupTest.
- gofmt -l clean. go vet darwin/linux/windows on the root, provider and
gui packages: ok.
|
||
|
|
c98160c045 |
gateway: a group's rule can pause one of its models at set hours, days or agents, leaving it out of the group then, not first, not a fallback, not kept by affinity (John on Discord)
John asked for a pause in a group's Rules, e.g. a model paused in its vendor's peak hours. A time rule could only send those turns to another member first: the paused-for model stayed behind it for failover, went first when the other was unready, and was kept by affinity mid-turn. What changed: - provider: Rule.Pause (`"pause": true`, typed `pause=<model>`). It holds by time/days and agents only; cleanRules and ParseRule refuse any other condition, and refuse a pause with none. Pause rules are not send-to rules: MatchesBesidesIntent, ruledEntry and Ruled() leave them out. PausedOut(g, ms, agent, at) drops members a pause holds for, from the group's own rules and each nested group's (a group named = all its models; a model named = wherever a nested group has it, #625). - gateway: serve and embeddings run PausedOut on ruleClock before planning, on every request. Every member paused -> 503 naming each rule (pausedError). The trace's GroupRef carries Paused. - GUI: the rule editor's "send to" is now an app-menu action button (send to / pause); a pause hides the request conditions (clearing them), keeps hours, days and agents, and isn't saved without one. The group card's rule reads "→ pause <model>", and the Routing trace says which model was paused by which rule. Strings in zh, zh-TW, ja, de. - CLI/TUI: `magpie group rule add <g> pause=<model> time=… days=…`. - docs: gateway-routing.md step 2; start.html en/zh/ja "Hours and days". Run: - gofmt -l clean; go vet -tags nogui ./...; GOOS=linux and GOOS=windows go vet -tags nogui on gateway, provider, tui, root; go build ./... - go test -tags nogui ./... under a temp HOME with pinned caches: all ok. - rules_pause_test.go (3 tests) fails with the PausedOut call in serve removed (the paused model answers mid-turn, as a fallback, and the all-paused case returns 200). grouprule_pause_test.go covers clean, parse/Line, Ruled, Pauses and nested PausedOut. - GUI: routing-pause.test.cjs in Chromium and WebKit, en/zh at 1100px and en/zh/zh-TW/ja/de at 420px: 14/14; all 7 Chromium cases fail on the old routing.js. routing-*, group-*, i18n-keys, gui-ja, gui-de, click-scroll: 618 pass, 4 fail under --test-concurrency=4 (routing-blocked, -idle-frame, -side-calls, -wb-refused), all of which pass run alone; routing-side-calls failed 1 of 6 alone and passes with the old routing.js too, so it is a load flake not touched here. |
||
|
|
666c0fa4fd |
routing: the context window holds still while requests stream in, and the prompt-cache card shows the last request's hit, dimmed, or a dash with the reason instead of "——命中" and an empty bar (dumplings on Discord)
dumplings reported that on Routing, every new request made the context
window jitter and flash, and that the prompt-cache card read "——命中",
glued together, with an empty bar under it.
Causes, measured with a frame sampler while requests stream through
start/read/done:
- A live request's story is shorter than a finished one's. "Is
answering…" becomes "answered in 4.0 s…", which wraps onto two lines
at phone width. The log head also gains View usage and Replay once the
request is done. So the card under it moved up and back down on every
request: 45px at 420px wide, 6px at 900px.
- The state pill ("Live" or "Counted") changed width, which moved the
model name beside it by about 11px.
- While a request was under way the cache card dropped to "—" with a
0% bar, then came back. That was the flash.
- A flex item's leading space is dropped, so " hit" and " / 272K" were
glued to the figure before them.
Fix:
- routing.js holdStory keeps the log head and steps at the tallest
height seen while following live, at this width and language. A
picked request, a replay or a past day is drawn at its own height. A
ResizeObserver on the steps measures again as soon as the width
changes. Without it, a scrollbar appearing before the first request
left a stale height and a 6px shift (seen in WebKit under load).
- context.js stacks all three state words in one grid cell and shows
only the current one, so the pill keeps one width.
- While the next request is under way, the cache card keeps the last
request's figure, dimmed (.was), with "The last request's · this one
is on its way". When there is nothing to show, it gives a faint "—"
and the reason ("Read once the vendor answers" or "The vendor didn't
say"). The bar stays hidden but keeps its space. The remembered
figure resets when the agent or session changes.
- .ctx-big gets a gap. Width and opacity transitions are turned off
under reduced motion.
- The three new strings are added in zh, zh-TW, ja and de.
Verified:
- The new tests/routing-ctx-still.test.cjs streams two requests and
checks that the card, model, state, used, cache, figure, bar, grid,
legend and foot rects never move by more than 0.5px. It also checks
the figure-to-word gap and both empty states.
- It runs in Chromium and WebKit, at en 420/1100, zh 420/1100,
zh-TW 900, ja 900 and de 420. It narrows the viewport by 10px after
load.
- On the old assets it fails 16 of 16 (the card moves 6–52px). It also
fails with only the ResizeObserver removed.
- routing-live-patch now expects the held figure ("97%") on live steps
instead of "—".
- Under --test-concurrency=4 in both engines: 578/578 pass across
routing-*, context-*, click-scroll, group-context, panel-routing and
gui-de/ja/zh-tw.
- go test -tags nogui ./internal/gui passes.
- GOOS=linux and GOOS=windows go vet -tags nogui ./internal/gui are
clean.
|
||
|
|
189586612e |
agents, gateway: Codex's subagents go on a model set in its row, a ChatGPT account's (willz on Discord)
Codex's lead names each subagent's model itself in spawn_agent, and
Codex's [agents] config can't overrule it. The Agents page's Codex row
now has a "subagent model" square (the app's model picker, Default
first). Its options are only models a ChatGPT account in magpie serves,
because a subagent's task is sealed for ChatGPT accounts.
- settings.CodexSubagentModel holds it. It is an agent Field
(subagent_model), so the TUI/CLI, profiles, davsync's "agents" part
and WSL twins carry it too. The setter refuses another provider's
model. It keeps a ChatGPT account's model that isn't served now, so a
backup restored on another computer still applies (ApplyFields stops
at the first failed Set). POST /api/settings keeps it.
- The gateway (codexSubagentPick) moves a collab_spawn request onto it.
codexBackend does this for Codex's own bare models; serve() does it
for any other model. When no ChatGPT account on in magpie serves it,
or a held gateway key may not use it, the request stays on the model
asked for. Route.Subagent records asked/to/kept. The lead's turns,
titles, guardian and the rest are never moved. Off (the default)
changes nothing.
- Routing page: kindWhy says the subagent was put on the model set, or
stayed on its own and why. "only account on for" names the model it
went on. Strings added in zh, zh-TW, ja and de.
- docs/subsystems: gateway-routing.md and agent-wiring.md describe it.
Run (darwin, rebased on origin/main):
- gofmt -l internal/: clean.
- go vet -tags nogui on gateway, provider, agent, gui and settings:
darwin, GOOS=linux and GOOS=windows.
- go build ./...
- HOME=<temp> go test -tags nogui ./...: all ok.
TestSettingsSaveKeepsWhatItDoesNotSend flagged the new field; it is
now set there.
- GUI tests, Chromium + WebKit:
- codex-subagent-model.test.cjs: 20/20 (en, zh, zh-TW, ja, de at
1100 and 560 px).
- Also green: routing-kind, subagent-effort, codex-memories,
codex-memories-settings, i18n-keys, gui-ja, gui-de, gui-zh-tw and
click-scroll.
Failing without the change (codexSubagentPick returning nil):
- TestCodexSubagentPutOnTheModelSet
- TestCodexSubagentOnAnotherProviderPutOnTheModelSet
- TestCodexSubagentModelNotServedKeepsTheAsked
- TestCodexSubagentModelHeldKeyKeepsTheAsked
TestCodexSubagentModelLeavesOtherRequests guards the other side: the
lead's turns, titles and guardian stay untouched.
Not tried with a real Codex CLI and ChatGPT account. A subagent spawn
needs a signed-in Codex home, and this session may not touch the live
~/.codex. The fake ChatGPT backend tests cover both routes.
|
||
|
|
ea1c5d0457 |
gateway: Antigravity's 429 to a Claude Code / Agent SDK system prompt is the prompt turned away, not a quota, everywhere, and the agent gets 400 (#1425)
Antigravity answers the system prompt of Claude Code and the Claude Agent SDK (Claude Desktop's chats) with 429 "Resource has been exhausted" at whatever quota is left (#666). The detail text already said it was not a quota, but when Antigravity was the last one left (a direct model, the reporter's case) the route still fell through to failureOf: the try was counted 额度用尽 on the Routing page and in the account's tally, and the 429 went to the client, so Claude Desktop asked ten times over. What changed: - codeassist.go: antigravityTurnedAway(p, system, said) needs the Antigravity account, a Claude Code / SDK system prompt and the "resource has been exhausted" words. A real quota 429 ("You have exhausted your capacity ... reset after ...", QUOTA_EXHAUSTED) stays a quota and rests the account as before. turnedAwayStatus = 400 (the Anthropic and OpenAI SDKs retry 408, 409, 429 and 5xx, not 400); ledger ErrType "prompt_turned_away". - gateway.go: such a try is failPrompt (was failRefused in a group, and failQuota as the last), no rest, no usage re-asked, no passing retry, no auto reset. The last one left answers the agent 400 with the vendor's words and the hint; in a group the next member is asked, and if it fails only on a quota the agent is told the turned-away 400. The in-reply (stream error event) form is told the same way. - continuation.go / translate: the hint is appended to the in-reply form too, and the ledger row carries the ErrType. - routing.js: the hint joins HINTS, so the Routing page shows Antigravity's words as "It said: ..." and the explanation on its own line, translated in zh, zh-TW, ja and de (i18n.js). Tests (each fails on the old gateway.go/continuation.go/routing.js): - TestAntigravityTurnedAwayLastIsNoQuota (stream and not): 400, asked once, failPrompt, no rest, ledger 400 prompt_turned_away. - TestAntigravityTurnedAwayInsideTheReplyLast, TestAntigravityTurnedAwayThenAQuota, TestAntigravityQuotaOnAClaudeCodeTurnStaysQuota (scope: a real quota 429 still rests and reaches the agent as 429), TestAntigravityTurnedAwayHintIsTheRoutingPages. - gui/tests/routing-ag-turned-away.test.cjs: row status word, account tally, "It said" line and the hint line, in en/zh/zh-TW/ja/de. The real-quota fixture's words are from public reports, not captured from a real account. Run: gofmt -l internal/ (clean); go vet ./internal/gateway/ and GOOS=linux / GOOS=windows go vet -tags nogui ./internal/gateway/; go build ./..., GOOS=linux and GOOS=windows go build -tags nogui ./...; go test -tags nogui ./internal/gateway/ ./internal/gui/... under a scratch HOME with pinned caches (ok); GUI node tests (new test, routing-*, gui-de, gui-ja, gui-zh-tw, i18n-keys) in Chromium and WebKit. |
||
|
|
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.
|
||
|
|
55544f09f6 |
routing, gui: a provider's accounts and a group in the group fold on the Routing page, long ones folded at first, what the reader picks kept (Aiirobyte on Discord)
Aiirobyte: a routing group of many accounts took so much of the page that editing the groups below it was a long scroll. The stage folded only runs of three or more API keys (#1319). Now: - Three or more accounts of one provider side by side for one model fold into one row the way keys do: the count, the lit one and what it does, how many are available and resting. A request to a folded account flies to the fold. - A group in the group's heading folds from a click, Enter or Space (it is a button now, with a chevron). Folded, it says "{n} on" and what its seats do together; requests under it fly to the heading and a failure tags it. - Accounts and keys sums a provider's accounts up in one row too. - Keys start folded as before. Accounts and group headings start open under six, folded from six. What the reader opens is kept in magpie.routingKeysOpen as before, what they fold in the new magpie.routingFolded, so both directions survive a reload. - Redraws go through steady(), so a click keeps the page where it is. - Strings in en, zh, zh-TW, ja, de. Display only: the gateway's order and choice don't change. routing-account-order now opens the relay's key fold by :not(.open), since the account folds there start open. Run: new internal/gui/tests/routing-group-fold.test.cjs (defaults, click and Enter in place with the page not moving, kept across reloads both ways, a live request to a folded group heading with its tag, Accounts and keys folds, 420px fit) in Chromium and WebKit, en/zh/zh-TW/ja/de, 40/40. On origin/main's assets it fails (no account fold, heading not foldable). All routing-* tests, panel-routing, click-scroll, gui-ja, gui-de, gui-zh-tw and i18n-keys: 255/255 in Chromium and 255/255 in WebKit. Not tried in the real window with a live gateway. |
||
|
|
ea6f8f89f8 | routing: a group under the pointer stays where it is as requests come in (cwfox67 on X: picking a manual group's model meant fighting the page, which shook as it live-updated) — the Routing page keeps the groups in place on the screen only while they're in the upper half of the view or a field in them has the focus, else it keeps the requests list's place; at the page's foot the groups sit low in the view, so the list kept its place, grew with each request, and pushed a manual group's card down from under the pointer about to click it. Now the groups are also the part kept while the pointer is on them, and the pointer coming onto them or leaving them takes where the reader is again (readerLeaves), as their own scroll would. No new strings. Tested with a new internal/gui/tests/routing-pointer-pin.test.cjs in Chromium and WebKit at 420 and 1100 wide: wheeled down to the groups, pointer on the manual group's card, 8 requests streamed in (start, prompt read, done each): the card stays within 1.5 px on the screen. On origin/main it fails in both engines at 1100 (588 → 702 px). All routing-* GUI tests (199) and click-scroll pass in both engines. The wheel over the requests list still scrolls the list first (the browser's own scroll chaining); not changed. Not tried in the real window with a live gateway. | ||
|
|
c17cbfa161 |
routing, gui: the folded context window shows a thin bar of what fills it beside how full it is, one line high whatever a live request puts in it, and a request opened from the Usage page's Context tab shows its card unfolded, it alone (PILIPALA @NXirg2 on X, Jeremy.Zhou on Discord)
On af798bd1's fold: folded, the head carries a bar of the window's
parts (system, tools, memory, files, results, chat), morphed with the
head so a live request changes its widths only; the folded head is
pinned at the open head's 20px and doesn't wrap. "Latest request" and a
point of the session line on the Usage page's Context tab open the
request with { context: true }: its card shows unfolded for it, the
next request takes the reader's choice (magpie.ctxShut) again, which is
left as it was; folding that card by its title keeps it folded.
routing-context-fold (new): folded at 1920x1080, 1440x900 and 440x900
in en, zh and de, one line with the bar, the stage and (at 1440 and
wider) the request list in view, nothing running over; opening doesn't
move the page; the Usage page's request opens unfolded for itself only.
routing-live-patch's folded cases: the card, head and bar are the same
nodes across live requests and the card's height never changes. Both
fail on af798bd1's assets. No new strings.
|
||
|
|
af798bd1bf |
routing, gui: the context window's card folds to its head, with how full it is beside the title ("114K / 272K · 42%"), and stays folded for the next request and after the page comes back, so the request list under it has the room (0xBCD18E on X: 这个"上下文窗口"的板块非常占"上下"高度,还不能折叠,下面只能展示三行)
ctxCard takes opts.foldable (Routing passes it; the Usage page's cards don't): its title becomes a button with a chevron, aria-expanded, and a click toggles .shut on the card, which hides all but the head. The choice is kept in localStorage (magpie.ctxShut). The head is morphed in place, so the click reads the button from the event, and the card that is there keeps .shut across live patches; a new card takes it from the saved choice. Verified: routing-ctx-fold.test.cjs (new), at 420 and 1100 wide in Chromium and WebKit, 3/3 each: open, then folded to one line (<60px) with the figure, the list under it up by >200px, nothing runs over at 420px; another request picked is still folded; after a reload still folded; opened again, 400 cells and the same height as before. It fails on the old code (no .ctx-fold). routing-*, context-*, usage*, group-context, click-scroll, panel-routing, old-webkit, gui-ja/de/zh-tw: WebKit 371/371; Chromium 370/371 once at --test-concurrency=4, routing-blocked's "picking the request moved the page", which passes 3/3 alone and in two more routing-* runs at the same concurrency (196/196 each). Not filed as caused by this change; seen once under load. |
||
|
|
ed31293c0e |
usage, gui: a reply its vendor let go in a burst over a couple of hundred milliseconds tells no speed, not 2,237 tok/s (John on Discord)
John's Kimi Code rows after v0.1.1119 (OpenCode, group/k3-glm, api.kimi.ai,
Chat, k3-256k): 550 tokens, 22 of them reasoning, in 16 s with the first
content at 5.2 s read 2,237 tok/s, and 395 tokens in 19 s 2,012. 528 answer
tokens at 2,237 tok/s is 236 ms: the burst the vendor let go at the end.
|
||
|
|
3d34c2d747 |
routing: live, the next request is patched into the context window that is there, so its cells don't come in again and the card no longer goes and comes back, moving the request list under it (Zhenzhen on Discord)
Each new request in a session emptied the card while the gateway read its prompt (the box collapsed to 0, everything under it jumped up), then drew a new card whose 400 cells scaled in again, then a third card when it was done; a request under way had no Prompt cache stat, so the grid moved again when it came. Now ctxCard returns a card with ctxUpdate: the grid's cells are made once and only their classes change, the head, stats, legend, contents rows and foot are morphed in place, and an under-way request keeps the cache stat's place with "—". Routing patches the live card, keeps it in place while a live request has no prompt yet, and still draws a request the reader picks afresh. Verified: routing-live-patch.test.cjs (new) feeds two requests in three steps each, at 420 and 1100 wide, in Chromium and WebKit: the old rows, card, grid, cells, legend and contents rows stay the same nodes, the grid and card keep their height on every ResizeObserver frame, the view never scrolls. Without the change it fails: the card reads '' while the request is under way, the card/grid are new nodes, the box goes 884 -> 0 -> 789 -> 884. routing-*, context-*, click-scroll, panel-routing, old-webkit, gui-ja/de/zh-tw, usage* pass in both engines; go test ./internal/gui and GOOS=linux/windows go vet pass. |
||
|
|
8db24fd62f |
gui: Routing folds three or more of a provider's keys for one model into one row that shows the count and their state, and opens in place to each key (#1319, tkhs101)
53 agnes-3.0-flash keys were 53 near-identical stage rows and 53 rows under Accounts and keys. Now three or more keys of one provider standing together for one model (same fixed effort, fallback and group-in-group heading) fold into one stage row: "Agnes 53 keys agnes-3.0-flash", then the lit key and what it does, "51 available · 2 resting". A request on a folded key flies to the fold; a key failing and the next answering show there (its 429 tag too). A click, Enter or Space opens it in place: each key keeps its own row, state and wire, drawn from the fold. Accounts and keys folds the provider's keys into one row with their summed tally and models, and opens the same way. Open folds are kept per reader in localStorage magpie.routingKeysOpen. Two keys stay two rows; one key is as before. Display only: the gateway's order and choice don't change. New strings in zh, zh-TW, ja and de. docs/subsystems/gui-shell.md says how. routing-account-order's relay has three keys, so it now opens their fold to read their order. Run: routing-keys-fold.test.cjs (32: folded, open/persist/Enter, live updates folded and open, Accounts and keys, 440px; Chromium and WebKit; en, zh, ja, de) — fails on main (no fold). All routing-*.test.cjs, panel-routing, click-scroll, fold-show-grip, gui-ja, gui-de, gui-zh-tw, i18n-keys: 409 pass. Every other test that opens Routing (29 files, 152 tests) passes but purpose-filter's WebKit "returning focus does not scroll the page", which fails the same alone on origin/main (off by 1px). go vet -tags nogui ./internal/gui (darwin, GOOS=linux, GOOS=windows). |
||
|
|
8514750426 |
gui: focusing the window no longer blanks the Usage chart: the window coming back (focus, visibilitychange) reads the Usage tab shown as its timer does, drawn again only on a change and with no skeleton between; the tray panel's Usage tab isn't dimmed or redrawn by its 10 s timer or a focus when nothing changed; Routing's groups aren't redrawn on focus when the same (Zhenzhen on Discord: omarchy/Hyprland, focus follows mouse, the bar chart flashed each time the pointer crossed into magpie)
Cause: window focus and visibilitychange called load(), which on the Usage
page called loadUsage(): renderUsageLoading() hid #chart, put the KPI
skeletons up, and renderUsage() drew every bar again. Under focus-follows-
mouse every pointer crossing is a focus. load(true) now goes through
refreshUsage() when the tab's figures are drawn (usageDrawn), and loadUsage()
as before on a first draw or when the language changed.
Test: internal/gui/tests/usage-focus-steady.test.cjs fires focus and
visibilitychange and watches the Overview bars, the Requests columns, the
tray panel's columns and Routing's group card. With the old app.js it fails
in all 4 runs ("nothing changed: the chart isn't blanked": skeleton, chart
hidden); with only the panel change reverted ("dimmed", "bars removed");
with only the Requests path reverted ("bars removed"); with the old
routing.js ("the same group card stays": 0 vs 1). Passes in Chromium and
WebKit, en and zh. 998/998 pass across the usage*, panel*, tray*,
sessions*, context*, group*, routing* and focus/visibility-firing GUI
tests in both engines. No strings or Go changed (no gui-ja/gui-de, go vet
needed). Not tried on real Hyprland.
|
||
|
|
de5455b8fe |
gateway, usage, gui: a reply whose vendor sent its first words and held the rest to send in one burst tells no speed, not 1,367 tok/s (John on Discord)
John's request (OpenCode, a group served by Kimi Code at api.kimi.ai, Chat) showed 1,367 token/s: its tokens counted over the time from its first token to its end, though nothing came in between and the rest came at once. The 100 ms / 10,000 tok/s bounds catch a burst only when the first content comes with it. firstToken now reads on past the first text and marks when each content event's bytes came (one mark a millisecond, up to 65,536 marks and the 8 MB it reads), and flowMs is how long the content took to come from where the speed is counted: the span from a tenth of its bytes to nine tenths, scaled to the whole. A steady stream gets about its whole window; one let go in a burst about 1 ms. It is kept as Call/Try/Route .flow and usage.Record.flow_ms (and the Requests page's packed rows), and usage.DecodeOf, routing.js's decodeOf and app.js's ledDecode count no longer a window than it. A record without it reads as before. Verified: TestBurstTellsNoSpeed, a fake Chat vendor that sends a word, waits 600 ms, then 199 words and the end in one write (1,000 tokens), for a Chat and a Responses agent: no speed; before, 1636 and 1655 tok/s. Its steady case (a word every 60 ms) keeps 200 tokens over most of its window. TestCodexBackendBurstTellsNoSpeed is the same through Codex's own ChatGPT backend (before: 1,000 tokens in 601 ms). TestFirstTokenKinds now expects the stream read past its first text. Go tests ran on Linux (golang:1.26 in Docker; this Mac's syspolicyd held new test binaries at launch). GUI: routing-burst-speed (a route with John's 5.1 s first token, 6.7 s and a 2 ms flow: was "1367 tok/s", now none) and usage-speed (a row with flow_ms 2 shows "—") fail without the JS change and pass with it, with reasoning-speed, routing-request-metrics and usage-ledger-detail, in Chromium and WebKit (en/zh, ja/de where the tests have them); no strings changed. Not reproduced with Kimi Code itself: whether it holds the stream so is inferred from the numbers. |