ac4af582301a4e8a29245dbba767eba31334ddf9
222
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a6e4cf7635 |
settings: what routing does sits under Models › Routing, and the Routing page opens it
The scattered settings audit after netube99 on X. Ask again after a
refusal, the Retry-After cap and the intent classifier's timeout were
under Models › Replies beside rows about a reply's content, and Busy
models last sat in Network and sharing, far from the routing it changes.
The four are now one Routing section under Models, after Replies, and the
Routing page's header has a Settings › button that opens Settings at that
section with its first row lit. The docs (reference.md, the site's
plugins page in en, zh and ja) name the new place.
Run (mote, mote-run):
- settings-places, retry-after-cap-setting, refusal-retries-setting,
classify-timeout-setting, model-load, i18n-keys and bare-ids, both
engines: all pass.
- mobile-web against origin/main
|
||
|
|
4064c10362 |
routing groups: on while Routing is off, their Built-in row says their page went with it
Routing groups have no page of their own: theirs is on Routing. With
Routing off and Routing groups on, Plugins › Built-in showed the groups
switch on and nothing anywhere to set them, and the quick start's
routing step still counted groups alone (netube99 on X, and the
scattered settings audit after it). The groups row now says "Their page
is on Routing, which is off" with Turn on Routing, which flips Routing's
own switch on the same list, and the quick start's step leaves with
either one off.
The hook lives in a new plugins/routing/settings.js, loaded after app.js,
whose featWho it extends (plugin client files load before app.js; the
first try in client.js threw "featWho is not defined" in every test).
Run in the tree with this change and the rest of the audit's fixes
(mote, base
|
||
|
|
88b541a25c |
images: every pointer names Settings › Models › Images, where the page is
The image models moved under Settings › Models, but the Library's Magpie
Image sheet, the MCP server's instructions to agents, the gateway's
"no image model" errors, the video tool's text and the docs still sent
users to "Settings › Images", a tab that no longer exists (the scattered
settings audit after netube99 on X). Every user-facing string now names
Settings › Models › Images in en, zh, zh-TW, ja and de, as do the site's
Qwen docs (en, zh, ja), llms-full.txt, the subsystem pages and comments.
Run in the tree with this change and the rest of the audit's fixes
(mote, base
|
||
|
|
7a2a05c7a3 |
routing: Accounts and keys keeps each provider's heading while it says the same
freefcw on X (11-09, v0.1.3373 and v0.1.3375): magpie at 32% CPU with 2,250 idle wakeups and its webviews at 80 to 223MB; lemonkillergame and laincatx say the same of CPU and memory. The Routing page draws Accounts and keys again each second while it is in sight (countdown: its rests and resets count down). Each drawing made every provider's heading anew, icon <img> included, and patch then kept the old heading in the page. But an <img> asks for its picture as soon as its src is set, in the page or not, and the app's icons go out no-cache (revalidated), so every provider's icon was asked for again each second: through the Wails asset server in the app (a read and a sha256 of the file each time), and each a new SVG document in the webview (~0.6MB, #909). Over `magpie web` on mote, a seeded HOME with five providers on Routing: 322 requests a minute, 155 of them icons every 30s; every other page asks for 4 to 13 in 45s. A heading is now kept per provider while its icon, name and routing mode are the same, and a heading with its first row are a list of nodes, no longer a box they were moved into: the move took a kept heading or keys row out of the page each second, so patch never found it in place. Measured on mote (M5 Pro, load 50 to 90 from other sessions), the 0.1.3377 build vs this one, `magpie web` in Playwright WebKit on ?view=routing, 60s, twice each: - requests: 322 and 325 a minute -> 7 and 7 (icons: 31 each per 30s -> 0) - magpie's CPU: 0.78% and 0.73% -> 0.32% and 0.32% - magpie's RSS: 225-227MB both Test: routing-acts-idle.test.cjs, in Chromium and WebKit, en, zh, zh-TW, ja, de at 1100px and en at 420px: a resting key's countdown redraws the list, and over 3.5s no icon is asked for again and each heading is the node drawn before. 14/14 pass; with client.js before this change 0/14 (each heading is a new node). Its icon count alone passes on the old code there, since page.route's replies are kept in the browser's memory cache; the real server's requests are the numbers above. Run on mote: - every GUI file that opens Routing (181 files, both engines, at origin/main |
||
|
|
2b8ad61468 |
routing: a group's header counts its members on, not who one request was held to
adorable_piglet on Discord: the group magpie found for GPT-6 Astra, In order, three of its five members on (two on providers switched off), read "GPT-6 Astra · routing group · 1 on" over a Codex request answered by one member. The header counted the request's order, who that one request was weighed among. A conversation held to one member (native compaction, Strict, a sealed task, a key's models) has an order of one, so the group read as having one on. It now counts the route's group.members (GroupRef: the group's ready members as the request came); why the request went to one alone stays the first line's to say. Routing itself was not at fault: a gateway repro with five members, two providers off, routed In order over all three on. Run on origin/main |
||
|
|
f5f68b4335 |
routing: with routing groups switched off, their sidebar tab goes
yyddbds (Discord) turned Routing groups off in Plugins > Built-in and the sidebar still showed its tab. The tab was tagged with the routing plugin only (data-feature="routing"), so only switching Routing off hid it. It is now tagged "routing groups", like Routing's own "Routing groups >" button and the two "Make a routing group" buttons. The page also holds each provider's accounts and keys (pools), which stay editable with groups off. So with groups off: - ?view=groups, or a page open when groups are switched off, opens Routing (offView in app.js), not Agents; - the groups' section moves under Routing's requests, with the "turn on routing groups" note and the pools; turning them on opens the groups page again and moves the section back. Every other sidebar tab (sessions, library, routing, gateway, usage, masking) was already tagged with its own plugin; only groups was wrong. Run, on mote (macOS 27): - routing-groups-off.test.cjs (rewritten: 1200, 900 and 420px, both engines, every language): 12 of 18 red on the old code, 18 of 18 green on this one. - routing-groups-off, builtins, sidebar at the rebased head 3930a3917: green in Chromium and WebKit. - Whole GUI suite at the old base |
||
|
|
9edc6506e0 |
routing: a group's editor folds what few change under Advanced
The owner found the Add group form too long. Name, In agents' lists, Models, Accounts, Rules and the classifier stay in the form; Patterns, Model lists, Routing, Rate limited, Slow to start, Every member busy, Context, Stays, Effort and Levels move into an Advanced fold (details.more, as the provider editor's). It opens by itself when the group sets any of them, remembers being opened or closed while the editor is up, and Save opens it when a typed pattern is invalid so the focus lands on it. The fold's inner grid takes the editor's label column (--ed-lab), so its labels line up with the ones above; without it English sat 30px off (group-editor-fits caught it), and at 520px and in the web layout it stacks like the rows above. edAlign now sets --ed-lab/--ed-at only when they change, and in an open fold a later change waits a frame (a closed fold only moves its chevron and follows at once): opening the fold re-measured inside the ResizeObserver callback and routing-rows-fit failed on "ResizeObserver loop completed with undelivered notifications". The GUI tests that edit those rows open Advanced first (openAdvanced in group-context, -unlists, -first-token, -patience, -defaults, -editor-align, -from-model-add); group-editor-align measures the fold's labels too. Run (Linux, WSL magpie-desktop, Chromium + WebKit, 5 languages): - the 34 GUI files red in a first run plus group-editor-fits and group-editor-selected, at this head rebased on |
||
|
|
a912cdc369 |
routing: the groups page's Select and New group no longer touch
The groups page's toolbar row has gap 0, so Import, Select and the filled New group sat edge to edge: Select's hover met New group's fill (the owner's screenshot, 11-08). The buttons right of the spacer now stand 4px apart, New group 8px. Run at this head (rebased on |
||
|
|
f99ad62a9c |
routing: the magpies fly over the cards again, off their words
The owner, 11-09: "鸟要在卡片上面". Since |
||
|
|
82ca554be9 |
routing: a provider's accounts routed In order give a conversation back to the first
CryptoSarom on X: with a provider's accounts set to In order, a
conversation that had moved to the second account (the first was
resting) stayed on the second once the first was ready again. Only a
group's members went back to the first; a provider's own accounts never
did, because inOrder was read from the group's routing alone.
- gateway.go: inOrder comes from the provider's routing, or the group's
when the request is to a group.
- affinity.go: backToFirst compares accounts (who()) for a provider's
own accounts. For a provider it overrides only a cache that would have
kept the conversation (cacheHolds: worth keeping and still warm), so a
cold or empty cache keeps its own "cold"/"new" label.
- plugin_factory_cap_test.go: "auto, cached on B" pinned the old
stay-on-B behaviour; it now expects A, the first account, on purpose.
- GUI: the Routing affinity line for "order" without a group says the
provider goes in order and the first is ready again (all languages).
- docs/subsystems/gateway-routing.md: the In order bullet covers a
provider's own accounts.
Run on mote at this tree on aa3d11d5b; rebased onto
|
||
|
|
50eec4994a |
routing: with motion reduced, a request in flight fades instead of standing still
vantiboolean (Discord, v0.1.3327, Windows app): the Routing page "lost its animation". The screenshot: Codex, round-robin, two accounts both "answering another request…", the wires dotted and nothing moving, no bird. That is the page with motion reduced. WebView2 reports prefers-reduced-motion when Windows' "Animation effects" is off, and Settings' Reduce motion does the same in the page. Then the flowing wires' dashes, the held dot's fade and the bird all stood still, so a request in flight looked the same as one that was over. This was so before |
||
|
|
eadc6cdb96 |
routing: a request with a named gateway key is drawn as that key
acezan (Discord) sent the Routing flow for an Antigravity group: a
script's requests showed only "Python-urllib", the caller's
User-Agent, on the left node. The request should be named by the
gateway key it came with.
The trace and history routes already carry callerKey (the key's id)
and callerKeyName, never the secret. The stage now groups callers by
agent plus key, so two keys behind one User-Agent are two nodes, each
in its own colour. A keyed node reads the key's name as Gateway keys
lists it now, else the name the route kept. A request with no key
keeps the agent's name, as before. The agent's icon stays, and the
tooltip names the key and then the agent. No new labels.
Siblings:
- The request rows' swatch, wire hue, the play dots and the replay
marks follow the same caller, and "Sent by" names the key.
- The tray panel's stage and its .pr-who rows name the key the same
way. The panel doesn't read /api/caller-keys, so it shows the name
the route kept; a key renamed later shows its old name there until
the next request.
- Usage already shows "agent · key name" on ledger rows and has its
own key split. Unchanged.
- The By-key and By-session group heads and the story prose ("X asked
for...") are unchanged.
Run on mote at
|
||
|
|
4ab1191bc9 |
routing: Routing groups opened from Routing lead back to it
Since Routing groups became a page of their own, a group chip on a request (or Routing's "Routing groups ›") switched to the groups page with nothing leading back. Without the sidebar the only way out was the tab bar, and the request you came from was gone from view. The groups toolbar now starts with "‹ Routing" (gBack). It goes back to Routing through window.show, so a dirty draft is still asked about, and focus returns to the chip or button the page was opened from. Esc does the same, except while an editor, Import, Select or a modal is open, or focus is in a text field. With the sidebar the back control shows only when the page was opened from Routing (.rt-gfrom); from the sidebar's own Groups tab the page is top level and has none. No other drill-in page in app.js binds Cmd-[, so neither does this. The label follows the language on every draw. No new layout, no accent stripe. Run (mote, playwright 1.62.0): - routing-groups-back.test.cjs (new): 30/30, Chromium and WebKit x en/zh/zh-TW/ja/de x 1280 window, 640 window, 420 web. Red on origin/main's assets (MAGPIE_ROUTING_ASSETS): no visible .rt-gback. - Broken by hand: Escape handler off -> red (chromium en 1280); the side-nav hide rule off -> red (webkit en 1280, "no back from the sidebar's own tab"). - Every routing*, sidebar*, group-*, i18n-keys, i18n-en-no-cjk, old-webkit and settings-groups file at 2d66e9f23 (main |
||
|
|
00198b26e0 |
gateway: a session's side call goes on the account its main conversation is on (#5655)
With two Claude accounts, Claude Desktop's own Sonnet calls beside an
Opus chat (desktop-beside), and Claude Code's auto mode classifier, ran
on account B while the chat was on A. Each model's conversation is kept
under its own scope (p.ID/model), so the side call was routed as a
session of its own: leastHeld, or Smart's order once its cache was cold,
put it on the account the fewest others held, and B's 5 hours drained on
calls the user never made there.
Decided (product call delegated): one session goes on one account. The
user picked one, the vendor sees one client, and the cost is one cache
write of the side call where the session goes on reading it.
withSession (affinity.go) puts first, for a request whose session a
header names, the key or account of that session's largest conversation
under another model's scope (answered within heldFor, at least
cacheWorth kept, larger than this one's own). It acts for Why first,
gone, cold, no-cache, cache and session; never mid-turn, under Strict,
for a subagent (withLead), past a rest, reserve, credits or a fallback
routing put first, nor to an account that isn't readyForNew. The trace
says Why "lead" with LeadModel, and the Routing page says "Put on
{first}, where this session's {model} is: one session goes on one
account." in en, zh, zh-TW, ja and de. docs/subsystems/gateway-routing.md
says the same.
Not fixed here: the classifier's ~110-130K cache write per call. That one
is ours too: in Claude Code's interactive mode the bridge pastes the
classifier's transcript as one block without the client's marks
(claudetui userPieces, clientCache.pasted), so only the fixed prefix
(Claude Code's system plus the appended rules, the 68,925) is read and
the rest is written again on every call. The cause and a candidate fix
are on #5585. It changes what a real Claude Code sends and can't be
checked without a real account.
Run (mote, through mote-run), at this head (aeeeed54a's tree, origin/main
|
||
|
|
2b08ccc838 |
routing: the story says why by the keys Smart sorted by (#5646)
The Routing page explained Smart's order from each window's raw reset (Weighed.Renews), while the gateway sorts by Allowance.Renewal (a credit pack's end when it runs out before the reset) and breaks hour ties by Allowance.Lapse. So a WorkBuddy account whose pack ends in 3 days was said to "renew within the same hour, so the order given stays". The trace now carries both keys (Weighed.Soon, Weighed.Lapse); renewsBy, cmpRenews, firstWhy and behindWhy compare them, with two new story lines (credits expire before the other renews; same hour but its credits expire sooner) and a row note, in en, zh, zh-TW, ja and de. "Kept in order" is said only when every key ties. A route from before soon falls back to renews and restarts. The other keys Smart reads (tier, unreached, learns, balance, use first) were already in the trace. Two accounts with one name: logoed() gave only the first its icon. Each later occurrence of the name now gets the next same-named member's own icon, so "louis and louis" shows WorkBuddy's and Zhipu's. Run (mote, via mote-run): - go test ./internal/gateway -count=1 -timeout 45m: ok (1010s), before the rebase onto |
||
|
|
ee8f4de36c |
routing: the story's ResizeObserver waits a frame, so a wrapping Smart header isn't a loop in WebKit (#5639)
3b541a7f3's longer Smart explanation wraps to more lines at 420px. The story's ResizeObserver called holdStory, which sets the story's min-height, inside its own callback, and WebKit reported "ResizeObserver loop completed with undelivered notifications" as a pageerror. routing-order-unknown went red in webkit en and ja at 420px. The callback now does its work on the next animation frame, the same fix #3164 made for the other observers in this file. Run on mote: - routing-order-unknown, both engines: 10/10 green, de included. Before this change, webkit en and ja at 420px were red. - GUI rerun of routing-*, panel-routing* and gui-ja/de/zh-TW in both engines: 2927 pass, 20 fail. Every red is filed and fails the same at 3b541a7f3~1, or passes alone at both heads: - routing-context-fold webkit (#5586, a different observer); - routing-intent-entry (#5392); - row-swap (#3799); - story-shrinks (#3954/#4629); - routing-credits zh-TW, under load (#5161, commented); - routing-pulse-composited webkit light, under load (#5647, new). - internal/gui Go package: ok. Not changed: routing-context-fold's own observer (#5586). Refs #5639 |
||
|
|
f4179b7812 |
routing: Accounts & keys in columns keeps each provider's rows under its own name
The owner's screenshot (这里的布局直接崩坏了): below 1150px the accounts list flows in columns, and a provider's accounts ran on into the next column with no heading over them, while the line meant to part two providers stood over a column's top. Each provider's heading and rows are now one box (.rt-pgrp) that doesn't break; one with more than 12 rows may, but its heading stays with its first row. The parting line is between two boxes and is dropped in columns, where the column gap parts them. Run (mote): at |
||
|
|
6b7ee4a984 |
routing: every group follows a default for rate limits, slow starts and busy members unless it sets its own
jiezhengj on Discord asked to set the per-group policies once instead of
in each group. The Routing groups page's Settings card, under the list,
now has three rows: Rate limited (keeps its place / goes to the back),
Slow to start (wait / 30 s ... 4 min) and Every member busy (off / 1 min
... 4 min). They are saved in settings.json as groupSink, groupFirstToken
and groupPatience (settings.SetGroupDefaults, POST /api/groups/defaults).
A group follows the default for each value it leaves unset, and its own
value always wins:
- Sinks() is the group's Sink, or else the default unless NoSink, a new
field for an explicit "Keeps its place".
- FirstTokenOr() is the group's own FirstToken (-1, FirstTokenWait, is an
explicit Wait), or else the default. The gateway reads it where it
reads a group's first-token time.
- Waits() reads the default when Patience is 0. 60 is an explicit 1 min.
Groups saved before have 0 and no NoSink, so they follow the default,
which starts at magpie's own (keep its place, wait, 60s). Nothing a user
set changes. The group editor's three rows gain a Default option, on for
a group that sets none, and its hint names the value it follows. Segments
only, with no native select.
Run on mote, at 06b2daeff rebased on origin/main
|
||
|
|
3b541a7f36 |
routing: Smart ranks an account by its week once its month can't be used up before it renews (#5639)
Smart ranked a Volcengine Agent Plan (5 hours 2,000, week 7,000, month
20,000) by its month, the biggest window, so it always stood behind
accounts renewing weekly, and its month could reach a point where it
could no longer be used up before it renewed.
The rule keeps #1778's reasoning: a month holding less than its weeks add
up to is the real cap while the weeks can still carry it. Once what the
biggest window has left is more than the next window (a day or longer,
same unit, counts known) can let through between its own reset and the
biggest one's (Of x time between / Span), what the week leaves at its
reset is lost, and the week ranks the account.
- provider: Allowance.Unreached counts the biggest windows to pass over.
Renewal and Seat.Soon are unchanged for other strategies and plugins.
- routes: Seat.Unreached; Smart compares Soon past it.
- gateway: weighRouted fills it; the trace's Weighed carries `unreached`.
- GUI Routing: renewsBy skips those windows, and a new story line says the
shorter window decides. The Smart header and the group hint say so in
en, zh, zh-TW, ja and de.
- docs: reference.md (How magpie picks an account) and
subsystems/gateway-routing.md.
With the issue's numbers as reported (month 696 h away, 18,372 left),
four weeks carry 28,017, so the order is unchanged. Two weeks before the
month renews, 14,017 < 18,372, and the plan goes first, ahead of the
point where a week's leftover is lost.
Run on mote at this tree (base 2dac9b84e; origin/main
|
||
|
|
2dac9b84eb |
routing: a session's context line is its conversation's, not whatever asked under it
The Routing page's context window card drew every request the session id went under into one "This session" line — the lead's turns, a subagent's (298K against a lead holding at 96K–108K), and the agent's tool-less side calls (a classifier, a title) — so the line rose and fell as though the conversation kept compacting (WK-Apollo, #5561). The Usage page's Context tab draws the same session by its turns alone (contextOfRecs, |
||
|
|
83d9ee892d |
routing: flowing wires and held dots move from a 15/s timer, not per-frame CSS animations
With several requests in flight (Claude Code's subagents, five at once), magpie on Windows sat at 20-30% of a core for as long as they ran (chenxiang, #5467). The gateway's own share is small: about 2.2 CPU-s per 56s of five streams on macOS (~4% of a core) and 4.0-5.2 on Windows (~8%), unchanged by this commit. Most of the rest was the Routing page in the webview, which Task Manager counts under magpie on Windows: each flowing wire's copy in .rt-flows animated its stroke-dashoffset, and each dot held at an account pulsed its opacity under a drop-shadow filter. Chromium draws both on the main thread every frame, and a flowing wire spans the whole stage. Both now move from one setInterval at 15 Hz (slowTick) that sets --rt-dash on the flows svg and --rt-held on the sky; the CSS reads them. The timer runs only while a wire flows or a dot is held, the page is in sight and motion is on, and clears both properties when it stops. Reduced motion is as before: no dash movement, held dots at full opacity. The dash moves the same 8px per 0.7s and the fade has the same 1.2s period and .45 low. Measured (zzload harness, not committed: a local fake Anthropic upstream, five parallel /v1/messages streams from one client with tool_use turns and tool_result histories, 15ms per event, Playwright on ?view=routing; browser CPU-s per 5s, mean of the loaded samples, before/after runs alternated at the same tree): - mote (macOS 27, Chromium): 1.15/1.13 -> 0.89/0.90 (wires only); Claude Code subagent shape (one session id, sidechain transcripts growing under a sandbox HOME): 1.24 -> 0.99. Gateway 2.23 vs 2.22. - xiaomi-gpu (Windows 11, Chromium): 1.55/1.59 -> 1.21/1.22, about 31% to 24% of a core. Gateway 4.2-5.2 in both. - What's left: the fliers' rAF loop and wing flaps (~0.3 on mote), the composited dot pulses, and the page's own work. Run on 578053d6a; after the rebase onto |
||
|
|
ea1a8ae809 |
routing: a folded fold of accounts on one plan says what they have left together
chen2652 (Discord #help): a provider with several accounts on one plan
should show, when its group is folded, one bar and what is left in all;
opened, each account's own quota as now.
A Routing account fold (3+ adjacent accounts of one provider and model),
when folded, now writes its tightest shared window before its status
("5 hours 40% used · …") and a bar under it, from quotaall.js's
mergeQuotas over the accounts' Usage cards. Its tip lists every window,
how they were put together (the mean of n accounts on one plan, added up,
or unlimited on each) and when the first of them starts again. Only when
every account has a card, all on one plan, none free; with different
plans, a card missing, the fold open, or the day view, nothing changes.
An open fold shows only each account's own row, as before. No new words:
every string is already in i18n.js in every language. routing.css is
unchanged (the account rows' bar grid). foldQuota in plugins/routing/
client.js; documented in docs/subsystems/gui-shell.md.
Run:
- routing-fold-accounts-together.test.cjs (new): 5 languages x 1100/420px
x Chromium/WebKit, 22/22 on mote. Folded: figure, 40% fill, tip in each
language, no email in the figure; mixed plans: no bar; open: no bar;
nothing overflows.
- At this tree (rebased on origin/main
|
||
|
|
3441035a2e |
routing: a group's member maps the reasoning level asked to the one sent
A Routing group that relays one long task across vendors sent every
member the same effort word, but one vendor's high is another's xhigh
(LuckymanJC on Discord). A member that follows the group may now carry
a map from the level asked to the level sent: Group.EffortMaps, json
effortMaps, keyed by the member's id as Members spells it.
- Default: no map, or a level the map doesn't name, goes as asked, so
every group saved before is unchanged and nothing of the user's is
overridden. A member fixed at an effort (or with several levels) and
a rule's UseEffort still win over the map.
- SaveGroup keeps a map only for a plain member of the group (not
:effort, not :a+b, not group/), drops pairs that send what was
asked, lowercases, and refuses a word that isn't a reasoning level.
- Carried by member rename (groupfast RenameMember and the all-groups
rename), provider rename, fold (and its fingerprint), share/import
and CanonicalRef; on a collision the map already spelled so wins.
- Gateway: the level asked is the suffix's/agent pick, then the turn's
pick, then the request's own (askedLevel: agentEffort, plus none for
an Anthropic request with thinking disabled); the target is sent with
withFixedEffort, fitted to the model's catalog levels unless none, and
the trace's try records mappedFrom. Per candidate, so fallback and
retries send each member its own; count_tokens sends no member effort.
- The group lists a mapped member's own levels plus the map's keys to
agents (mappedLevels in buildGroupEntries).
- GUI: the member's reasoning menu has "Map levels…" (app menus only):
a level asked, then As asked or one of the model's levels. The chip
reads "Mapped reasoning", its title the pairs. Follow the group or a
fixed level drops the map. zh, zh-TW, ja and de.
- docs/subsystems/gateway-routing.md says all of it.
Run (mote, at this tree):
- gofmt -l: clean. go vet (provider, gateway, gui), GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./...: clean.
- go test ./internal/provider/: ok. go test -run
'Effort|Level|Group|Fallback|Rule|Auto|Fixed' ./internal/gateway/: ok.
- node --test group-member-effort-map (30: chromium + webkit, en zh
zh-TW ja de, 1100 and 420px) and group-member-levels: pass;
i18n-en-no-cjk: pass. i18n-keys' "a plugin's words are its own" is
red only for the three words it is red for on origin/main
|
||
|
|
c39d366447 |
cline: the Upstream tick never writes providerOptions, which Cline refuses with 403 (#5442)
Since 2026-11-06 the Cline API answers any request carrying a
client-supplied providerOptions with 403 `client-supplied
"providerOptions" model routing is not supported`. HK-bruc1 showed it
with the same key: 403 with the field, 200 without. magpie's Upstream
tick ("DeepSeek and GLM models only from their makers' own APIs")
wrote providerOptions.gateway.only (and has) into every ClinePass
DeepSeek and GLM request, usage-billed deepseek/… and zai/glm-… too,
so with the tick on every one of them failed.
This overrides a value the user set. It is done because the value
breaks every request it touches: the models Cline sends through
Vercel's AI Gateway can only be pinned with providerOptions, and that
field is refused on each request. The saved pinUpstream is left as
set, so if Cline takes the field again the pin can come back without
asking anyone to tick it again.
Changed:
- provider.ClinePin pins only the OpenRouter entry (glm-5.3-flash,
provider.only ["z-ai"], which Cline still accepts); DeepSeek and the
other GLM models get "". The Cline plugin's DeepSeek skip and
ClinePassHas/clinePassDeepSeek are gone.
- gateway clinePin writes only top-level provider.only, never
providerOptions. A body's own provider/providerOptions goes as sent.
- provider.ClinePassAsked is what magpie actually wrote (ClinePin). It
no longer claims "deepseek" for the Cline plugin's DeepSeek models:
opencode-cline-auth 0.1.13 pins nothing by default, and a pin it
writes is refused, so no reply is served on it.
- GUI: the Upstream note says Cline refuses the pin since 11-06 and
only glm-5.3-flash still asks Z.ai (en, zh, zh-TW, ja, de). The
Routing page's "tick … to ask for the maker's own API" is gone.
Run on mote at this tree on origin/main
|
||
|
|
8e350155b6 |
routing: a provider set to Use first goes ahead of the others Smart weighs it with
hzh_1119 on Discord: ChatGPT Pro and Business now come with monthly API credit, and they want an OpenAI API key spent before the ChatGPT subscription where both serve a model, the subscription taking over after. Smart had no way to say so: an API key tells no allowance, so it went after every account with room, in every model's found group (auto/<model>). The only way round was a group set to In order with its members dragged, one group at a time, which nothing pointed to. A provider row's right-click has Use first (provider/usefirst, provider.SetUseFirst, Provider.UseFirst, copied onto its accounts by accountSettings, kept by the editor's Save). Its keys and accounts are routes.Seat.Lead, and Smart (leadFirst) puts those not all but used up ahead of every other seat, each side in Smart's own order. A resting one is passed over as before, so a 429 insufficient_quota (out of credit) or a failure moves the request on to the subscription. Off by default; within one provider nothing changes. The Routing page says why the first went first (Weighed.UseFirst, firstWhy) and doesn't call the one behind it "renewing later" (behindWhy). The menu shows a tick when it is on. Free quota by expiry orders its paid seats with Smart and so follows it; other strategies don't read it. The core's script budget is met by cutting three Providers-page comments in app.js, no raise. Run (on mote via mote-run, at |
||
|
|
8de63c8b5a |
gateway, usage, gui, otlp: a request its agent canceled is no failure (#2398)
An agent that cancels its request before it is answered is logged 499 "the agent canceled the request": a person stops the reply, or sends the next message while it is coming and Claude Desktop cancels it and asks again, or Codex takes a subagent's report (#2398). The gateway already says nobody failed (no rest, no reroute: TestCanceledRequestRestsNobody), but Record.Failed is a status >= 400 or an error, so every page counted it as a failure: the Requests card's "N failed" and success share, its Failed filter, the CSV's error column, the Routing page's "errors your agent saw", the Context page's error rate, the failed colour in the Requests list, Routing and Recent calls, and the OTLP export's error status. A Claude Desktop session on 2026-10-27 had four, each a message sent mid-reply; #2398 had 91 of a day's 92 failures. usage.CanceledBy tells the agent's cancel (499 with AgentCanceled) from magpie's own limit on a request it asked of itself, logged 499 too and still a failure (#2318). The cancel is logged with an error type of its own, agent_canceled (usage.CanceledErrType, set in failedWith), so the record says what it was and nothing guesses it from a 499, as #2398 asked. Record.Canceled reads the type, and a record logged before it by its status and message, so the old log reads the same with nothing migrated. A middleware's usage rows carry the type, so a module can tell the cancel from magpie's own limit, which its rows (no error text) couldn't. Record.Failed leaves the cancel out; Totals counts it apart (Canceled, in count and plus); RetriedRequest and the first-token and speed sums ask Answered, so a canceled request is timed nowhere, as before; Codex's memory of the last model still skips it. Routes and Recent calls say canceled (set as a route is done and as a day's history is read, so old days read the same); the Routing totals and the Context page's errors leave it out. Ledger rows say canceled, and the pages show it muted, in neither the failed nor the answered colour: the Requests list and its detail ("499 · canceled"), the Requests card ("N canceled", the success share of the requests not canceled), the overview tile, the Routing page (a "gone" outcome, no speed) and Recent calls (muted). New strings are in zh, zh-TW, ja and de. The OTLP export: the records the gateway gives its observers for a request and its try carry the type too (canceledAs), and a root span's error.type follows Record.Failed, so a canceled request's span and its try's go with status code 499, no error and no error.type. TestOTelWaterfallFailureAndCancellation's canceled case held two failed spans (the try the vendor refused as the agent left is recorded canceled, as the request is); it now holds neither failed, both 499 and no error.type. That change to the test is the point of this one. mdwsk88's patch (aea0027fd) ran its tests at |
||
|
|
80ae904c23 |
routing: routing groups get a page of their own, beside Routing
The owner asked for the groups to leave the Routing page (11-06): under the live stage and every request they were a long scroll down, and New group with them. The design was reviewed before this was built. - New page, Routing groups (#view-groups), drawn by the routing plugin's same script (routingPage), so the editor, its dirty/discard and every group action are unchanged. Toolbar: filter, "N groups · M on", Templates, Import, Select, and New group as the filled button. The list is right under it, and a Settings section under the list holds Found groups (with Exclude providers…) and Names in agents' lists. - No Export button: each group already has its own Copy to share. - Routing keeps the live stage and the requests. A request's group opens the groups page at its row. - The sidebar has a Routing groups tab right after Routing (from 1024 points). The header's row has no room for one: at 860px the extra tab pushed the logo out (brand.test). There the tab is hidden, Routing's tab is lit for both pages (markNav), and Routing's head has a "Routing groups ›" button, hidden beside the sidebar. - Every way in now goes to the groups page: the guide's Open routing groups, the panel's and the provider editor's Make a routing group (window/main?view=groups&newgroup=…). mainView still takes view=routing&newgroup from an older panel. - Words: "Routing groups", "Open routing groups", "Once saved, make a group of them in Routing groups.", and the editor's names note now says the setting is under the list, in zh, zh-TW, ja and de. "Open Routing" stays for the Agents page's button. - Docs: providers-accounts, gateway-routing, plugin-runtime, gui-shell and reference say "Routing groups page" where they mean the groups. - Core budget: the core's scripts are 1,533,774 of 1,533,802, paid for by three show()/setGatewayMode comments cut in app.js. No raise. Tests: routing-groups-page.test.cjs (new) covers the page in Chromium and WebKit, en/zh/zh-TW/ja/de, at 1280, 640 (window) and 420 (web): no groups on Routing, the tab or the head's button by width, the lit tab, toolbar order, New group primary and in sight, list then Settings, no sideways scroll, no native select, no left-border accent; a request's group to its row; quotas redrawn with an open editor left alone. The trace tests (routing-compact, -pause-folder, -rule-models, -folder) open Routing, then show the groups; routing-editor-foot and name-suffix-where-named scroll by wheel, as the scroll guard lets a reader; builtins expects the groups tab beside the sidebar only. Removed: routing-groups-jump (the head's "Routing groups ↓" that scrolled down to them, gone with them), routing-pointer-pin and routing-steady (the groups kept in place under requests streaming in above them: no request is above them now). Their guarantee that what redraws leaves an open editor and its typing alone is routing-groups-page's quotas case; Routing's own lists keep their keepInView. The groups page's jump: a request's group, or a pool's "Several keys" chip, opened the groups page and scrolled the row to the centre, and the next frame show()'s backAfterLoad put the page back where the reader last left it, then brought the focused segment in by "nearest": in WebKit the pool sat half under the window's foot (routing-mode-goes, 9 of its 10 WebKit cases). goRouting now jumps at once on a page it opens and marks it arrived(). The wheel in routing-many-keys turns over the keys: at the page's foot, now shorter, the mouse rested over the requests list (.rt-reqs, overscroll-behavior: contain), which took every wheel up, and the test stopped with 2 keys in sight. That is #4082's cause. routing-days-fit's fixture has 12 requests, a day that fills the window, since the day bar held needs room under it. Run on mote (macOS 27, load 25 to 65), Playwright 1.62.0: - Go: go vet, gofmt -l and go test ./... at the rebased head ( |
||
|
|
8b4029adfe |
routing: a long session name is cut short inside its own block, in WebKit 17 too (tz_188 on Discord)
tz_188 on v0.1.3122: three ZCode sessions at once on Routing, each named
by a long one-line prompt ("这个commit 中的内容帮我再核对一下
51538fc170c6…", a path under /Users/lbx_16/work/b2b/b2b-platform). Every
name ran past its block and over the next blocks' names, so the three
read as one smear.
|
||
|
|
152c3852ff |
routing: a switched-off group's words stay readable, its logos go grey (jiabubu on Discord)
A group switched off had everything but its switch at opacity .5, and
one with no member ready either (.off, .6) was dimmed twice, to .3: its
name read at 1.92:1 (light) and 2.49:1 (dark). jiabubu found such
groups too faint to read.
Now a switched-off card is not dimmed. Its name is --fg-2 at weight 500
instead of --fg at 600, its handle's logos are grayscale at .6, and the
off switch and the "switched off" tag stay as they were. Its members
keep the same --muted as an on group's. .off does not dim it again. No
new colours, only existing tokens.
Measured contrast (both engines, en and zh):
- light: name 8.64:1 (on: 16.97), members 3.66 (on: 3.66), id 8.22
- dark: name 8.03:1 (on: 13.41), members 4.64 (on: 4.64), id 8.43
Tests:
- group-disabled-contrast.test.cjs (new). Composites each text's colour
and every opacity above it over its backgrounds and checks:
- the name and id are at least 4.5:1;
- the members read no fainter than an on group's;
- the name is quieter than an on group's;
- the switch is off, the tag is there, and the logos are grey (an on
group's are not).
Runs in chromium and webkit, light and dark, en and zh.
- group-switch-add-many.test.cjs checked that every child but the switch
was at .5. It now checks the new look: the handle is grey at .6 and
the rest is not dimmed.
Run (on mote):
- At the pushed base
|
||
|
|
09812e66bc |
routing: a group's patterns, models and id can be selected and copied on its card and in its editor (jiabubu on Discord)
The window is user-select: none outside text it marks as text, and a
group's card is one big click target that opens the editor. So on the
Routing page a group's 模式 (patterns) line, its members line, its quota
lines and its name could not be copied: the members and names were not
selectable at all, and a drag across a pattern's code (selectable) ended
in a click on the card that opened the editor and threw the selection
away. The editor's model and account-provider names were not
selectable either.
Now:
- routing.css: a card's name, group/<id>, and every .mem line
(members, patterns, quota, classifier failure), and the editor's
member, pattern and account rows' names (.fbrow > .n) are
user-select: text, except while their list is being sorted. Controls
(routing tag, handle, Edit, switches, Remove, Up/Down) stay none.
- client.js groupRow: a click that ends a drag-select inside the card
does not open the editor; it compares the selection at pointerdown,
so a plain click with an old selection still opens it.
Not changed: a double-click on a word in the card still opens the
editor on its first click (the card opens on click, as before).
Test: internal/gui/tests/group-select-copy.test.cjs, chromium + webkit,
en + zh: drags across the pattern, the members line and group/free on
the card select them and leave the editor shut, no scroll moves; a click
still opens the editor; in the editor a model's name and a pattern drag
to a selection; controls compute user-select none; nothing is posted.
Broken by hand: client.js reverted alone -> 4/4 red ('' !== 'or/*:free',
the editor opened); routing.css reverted alone -> 4/4 red (members line
not selected).
Run on mote at base
|
||
|
|
a10ad0ec8e |
routing: a Codex memory call put on its conversation's model says why (#5413)
The Routing page read every Codex memory move as codex-turn: "asked for
{model} ..., which magpie doesn't serve". The #4765 branch of
codexMemoryStandIn moves a bare Codex default that magpie does serve
(a provider has a model by the same name) when Codex's config names no
memory model, so that sentence was wrong for it. That branch now
records codex-follow, said as "{agent} asked for {model}, one of its
own default models, for its memories, and its config names no model
for them; magpie served it on {to}, the model of its conversation.",
in en, zh, zh-TW, ja and de. Models magpie doesn't serve stay
codex-turn.
Run (mote): go test ./internal/gateway -run
'TestCodexMemory|TestCodexSide|TestCodexMemories|TestCodex.*Follow'
-count=1: ok. node --test routing-moved-why (chromium + webkit, every
language, 1100 and 420px), i18n-keys, i18n-en-no-cjk: 27 of 28; the red
is i18n-keys "a plugin's words are its own", red the same at
origin/main
|
||
|
|
763ea9438c |
routing: a live dot pulses by transform and opacity, on the compositor
Routing with requests in flight kept the renderer busy (unscientific9: "高并发路由页面" is slow). Every live dot (the answering account, the live dot, a waiting try, probe, preview target and step) pulsed by a box-shadow keyframe, which Chrome and WebKit run on the main thread: the page was restyled and repainted every frame for as long as anything was under way. Each pulse is now a ::after disk that grows and fades by transform and opacity alone, which the compositor runs without a paint. A muted dot's disk lies behind it (its parent isolates it, the disk at z-index -1), so its colour isn't tinted; a filled dot's disk is its own colour. Sizes match the old shadow (6px each side). Reduced motion and a quiet account still show no pulse. Measured on mote (headless Chromium 1280x820, app mode, sandbox HOME with a 300k-row ledger, a fake upstream, Routing held 30 s, Chrome trace): - 6 in flight: Paint 5714 / 5598 ms -> 3055 / 2804 ms; main-thread RunTask 7448 / 7148 -> 6851 / 6320 ms - 64 in flight: Paint 4408 / 4217 -> 1746 / 1759 ms; RunTask 8056 / 7921 -> 7405 / 7434 ms Most of what is left is the wires' rtflow (stroke-dashoffset, also main thread): with it off as well RunTask is 3415 ms at 6 in flight, and with every animation off 2560 ms. That one changes how the wires look, so it is filed separately, not changed here. Test: routing-pulse-composited.test.cjs, with the real stylesheets in Chromium and WebKit, light and dark: every endless animation of each live dot animates only transform and opacity, each live dot pulses, a muted dot's centre keeps its colour, and no dot moves. reduce-motion, routing-idle-frame and routing-live-bytes read the pulse from ::after now. Run via mote-run: routing-pulse-composited, fonts, reduce-motion, routing-idle-frame, routing-live-bytes, routing-wait-dot and status-dot-shape, 101 of 101 ok. Broken by hand: with the old routing.css the new test fails in both engines. Not run before the push: the wider run of the 359 GUI files that load Routing or the font code; its reds, if any, get issues. Not tried: a real Mac's window (WebKit in the app) on a display; the numbers are headless Chromium. Reported-by: unscientific9 (on Discord) |
||
|
|
83545a5d8f |
routing: two providers' keys of one name each say their provider on the stage (iamleehom on Discord)
iamleehom's chain had two providers each with keys named Key-01 and Key-02, all serving gpt-6-astra: four rows of the same icon, key name and model chip, so which provider a row was of couldn't be told. A key or account whose name another provider's row on the stage has too now says its provider after the name, in the muted words a fallback row already uses for its provider (an account's plan after it, when it has one). A name only one provider has says nothing more, so a chain without twins looks as before: no label is added to every row. Run (mote, via mote-run, Playwright chromium + webkit): - routing-twin-keys.test.cjs (new): Relay A's and Relay B's Key-01 and Key-02 plus Solo's Key-09; the four twins say Relay A / Relay B, Key-09 says nothing, no two rows read alike, nothing runs off the page; en, zh, zh-TW, ja, de at 1100px and 440px: 22/22 pass. - with routing-keys-fold, routing-group-fold, routing-account-name, routing-free-seat, routing-agents-apart, routing-account-identity and routing-held-member, both engines: 164/164 pass. A first try kept the provider's span on the row as `sub`, which wiresTo reads as a folded group's heading; agents-apart (20) and keys-fold (8) went red with "reading 'split'", and the field is now `subEl`. Broken by hand: client.js put back to its parent; the new test is 22/22 red (the rows say "" where the provider goes). Not tried: the reporter's own chain (only the screenshot), the real app's WKWebView, Windows and Linux. Reported-by: iamleehom |
||
|
|
6f0aeec180 |
routing: a request that tells no measured speed shows the least it wrote at, as Usage's Requests tab does (zzzkl3994 on Discord)
zzzkl3994: in Routing's request list some streamed requests showed tok/s and some showed none, while the Usage page's Requests tab gave every one of them a speed. The Requests tab gives a gateway call that tells no measured speed a floor, "≥N tok/s" (usage/page.js ledFloor_): one that reasoned with no first text recorded (a tool call after hidden reasoning), its answer over the time after its first token unless its content came in a burst; else, 1,000 tokens or more over a second or more, its output over its whole time. Routing's rows had only the measured speed. Now a row (and the side panel's row) says the floor by the same rule, with the Requests tab's own tooltip words for it; a measured speed is as before, and the story's per-try line still says only a measured one. The floor's two tooltips are said by two plugins now, so they move from plugins/usage/i18n.js to i18n.js, in every language (i18n-keys: a plugin's words are its own). reasoning-speed, which held that a tool call after reasoning says no speed on Routing while Usage says ≥100, now wants ≥100 on both. Run (mote, via mote-run, Playwright chromium + webkit): - routing-row-floor-speed.test.cjs (new): four gateway rows, a measured one, hidden reasoning before a tool call, a burst, and one too small for either; each row's speed is compared with what usage/page.js's ledRowSpeed/ledFloorSpeed say for the same request, and the floor's tooltip with the Requests tab's words; en, zh, zh-TW, ja, de at 1100px and 390px: 22/22 pass. - routing-request-metrics.test.cjs (rows 6 and 7, two 8,264-token bursts, now say ≥339 and ≥5,509 rather than nothing) and routing-burst-speed.test.cjs: 8/8 pass. - reasoning-speed (updated), panel-routing, routing-speed-first, usage-session-speed, usage-speed-count, usage-speed-every-row: green (10/10 and 48/48 for the first four). - i18n-keys: the floor's two words no longer listed; its "a plugin's words are its own" is still red for "No session ID" and "View routing", the same at origin/main (#5332, #5426). Broken by hand: client.js put back to its parent; the new test is 22/22 red ("waiting for .rt-metric.speed .v" on the hidden-reasoning row). Not tried: the reporter's own requests (no trace of theirs), the real app's WKWebView, Windows and Linux. Reported-by: zzzkl3994 |
||
|
|
7a2b9340d6 |
routing: a session named by a prompt of many lines is one line in its block, with its bar shown (tz_188 on Discord)
tz_188's ZCode card on Routing had a session whose title was a long
Chinese prompt, and its text ran over the rest of the block. A session's
name comes from its first prompt as written, line breaks included; the
name's box is one line tall with an ellipsis, but a break (U+2028 in
WebKit, a newline elsewhere) still wrapped it, so the second line drew
over the context bar beneath. titleOf and sessionName now fold every run
of white space (U+0085 too) to one space, so the name is one line and
ends in its ellipsis. The bar under it (.rt-ctx-s .ctx-stack) had
flex: 1 in a column box and could be squeezed to 0px by a long name; it
is now flex: none, full width, 4px.
Run (mote, via mote-run, Playwright chromium + webkit):
- routing-ctx-sessions.test.cjs, with a new case of a long CJK prompt of
several lines (\n and U+2028): en, zh, zh-TW, ja, de at 1100, 700 and
390px: 56/56 pass.
- the whole routing-* GUI set at this commit: 2870 of 2910 pass. The 40
reds are in i18n-keys (#5332, #5426), routing-intent-entry (#5392),
many-keys, order-unknown, row-swap, rule-drag, rule-remove, steady,
steps-cap and story-shrinks. Those nine files run again alone, here and
at origin/main
|
||
|
|
7e5a54147f |
gateway: a routing group's intent sureness is its own, intent-sure= (#5101)
Jev's sure of an intent had to reach jevSure, a fixed 0.4, for every
group. zminds measured 39 of 237 turns in one day (16.5%) refused at sure
0.153 to 0.395, and those turns went by the group's routing as if it had
no intent rules. A group can now set its own threshold: intentSure, from
0 (take Jev's likeliest intent however unsure) to 1. Missing keeps 0.4.
readJev keeps Jev's likeliest intent, its sure and Topic (an answer of
intents rather than levels). ruleFor applies the group's own sure through
intentOf, so two groups sharing one classifier and its cached answer each
judge it at their own. "none of these" is never an intent, at 0 too.
Levels and effort are as before.
Set from a terminal: magpie group set <group> intent-sure=0.25, empty to
unset. SaveGroup and the CLI refuse a value outside 0 to 1, NaN too: the
patch's `v < 0 || v > 1` let intent-sure=NaN through the CLI, which
SaveGroup then failed on as "json: unsupported value". cloneGroups copies
the new pointer, since TestCloneGroupsSharesNothing went red on it.
Changed from ggbdpq's patch on #5101:
- The group editor's "Intent sure" row is left out. Its hints were long
secondary text, it showed for every classifier when only Jev answers
with a sure, and it had no GUI test. The Routing page instead carries
intentSure through each save it makes of a group (the editor's Save,
the routing menu, the manual pick), so a value set from the CLI isn't
wiped by the next GUI save.
- Its i18n strings and site/public/docs/intent.html are left out. A
site/ change waits for the maintainer (docs/contributors.md). The site
diff was documentation text only: a paragraph id="sure", a sentence
in "Match the rules" and one table row. It had no links or scripts.
- docs/subsystems/gateway-routing.md has a bullet for IntentSure.
Run on mote (mote-run):
- gofmt -l internal/: clean.
- go vet -tags nogui, also with GOOS=linux and GOOS=windows, on
internal/gateway, internal/cli and internal/provider: clean.
- go test -tags nogui -run 'TestGroupIntentSure|TestJev|Rule|Classif|Decide'
./internal/gateway: ok.
- -run 'Group|Apply' ./internal/cli: ok.
- -run 'Group|Save|Clone' ./internal/provider: ok.
- go test -run Budget ./internal/gui: ok.
- node --test group-intent-sure (new), routing-group-strategy and
group-first-token, in Chromium and WebKit: 42 pass, 0 fail.
- i18n-keys has one red, "a plugin's words are its own". It fails the
same on origin/main
|
||
|
|
74d1cda421 |
gateway: a rate limit with a bracketed reset time rests the model until then, and says rate limited
taoxiaoxin on Discord (v0.1.2992, WorkBuddy China, plugin 0.2.24):
deepseek-v4.1-flash got 429
{"error":{"code":null,"message":"WorkBuddy: 您的使用量已超出频率限制,将在
2026-11-06 17:13:04 (UTC+8) 重置,您也可以切换其他模型继续使用。",
"param":null,"type":"rate_limit_error"}}
with credits left, and Routing showed the account as 额度用尽.
Cause: WorkBuddy now writes the offset in brackets, "(UTC+8)".
resetsWhen read "UTC+8" only bare, so the reset time went unread, the
refusal fell to plannedWords (用量) as failQuota with no time, and the
whole account rested a quarter of an hour as quota used up. With the time
read, the existing path (resetsWhen + otherModels) rests only that model
on that account until 17:13.
- resetsWhen takes an optional ASCII or fullwidth bracket round the
offset (zh and en forms); a body cut inside or after the bracket,
before 重置, still reads no time.
- Rest.Rate (and provider.KeyRest.Rate): a refusal read as out of quota
until a named time whose words say rate/frequency limit. Routing is
unchanged (it rests as the quota it is until then); the Providers row,
Routing's stage row, its Accounts line and the account tallies (live
and the day's, history.go) say "rate limited" (限流, 限流, レート制限,
Rate-Limit; strings already translated) with "back at {time}".
- workbuddy-ai gets the same: one path, tested for both ids. The plugin
(opencode-workbuddy-auth) already reads the bracketed time; no plugin
version or mover min.
Run (mote, at this tree):
- go test ./internal/gateway -run 'TestDayTallies|TestResetsWritten|
TestWrittenReset|TestBracketedReset|TestMonthlyWritten|
TestRateLimitBelieves': ok
- go test ./internal/gui ./internal/provider: provider ok; gui red only
in TestMainWindowCorners/macOS_26_SDK, #3949 (macOS 27, untouched)
- go vet (darwin) gateway, gui, provider; GOOS=linux and GOOS=windows
go vet gateway, provider: ok; gofmt -l clean
- node --test account-rate-rest (new; chromium + webkit, en zh zh-TW ja
de, 1100 and 420px): 10/10
- GUI routing-*, account-*, i18n*, key-rest*, rate-limited-* (194
files, 3127 tests): 3086 pass, 41 red. Rerun at concurrency 2 here
and at origin/main
|
||
|
|
814a625a24 |
usage: the top refresh reads saved Claude accounts again (#5380)
The tray panel's Allowances refresh said "Allowances refreshed" but a
saved, non-active Claude account kept its old reading: claudeWindows runs
Claude Code's /usage for a saved account only under savedRefresh, which
only that account's own card refresh sets.
Now a refresh of every allowance by hand asks usage/quotas?asked=1&all=1
(AskEveryClaudeUsage). It marks its ask generation in claudeEveryAsked,
and for claudeEveryFor (2 minutes) each saved account not read since is
read as its card's refresh would, under the same due check, the
30-second per-account floor and the same running holds. Opening the
Usage page or the Allowances tab (?asked=1 alone), the timed refresh and
every background read are unchanged, so nothing polls more. Callers:
the panel's top refresh (refreshPage "allowances"), the Usage page's
refresh and sidebar reload (refreshUsage -> loadQuotas("all")),
Routing's Read allowances, and the TUI's r. loadQuotas no longer lets a
lesser load on its way (an opening's asked read) swallow a Refresh.
Siblings: saved Codex accounts are already read anew on every asked
whole read (loginReading over HTTP after AskUsage clears the cache), so
Codex is unaffected. PlanQuotas and KeyBalances keep their 1-minute cache
on an asked read; left as is. The core scripts' budget is not raised:
the ~140 bytes are paid for by two loadQuotas/quotasOpened comments cut.
Run (mote, at 807341cdc on origin/main 5666cb049; rebased onto
|
||
|
|
326e72f4c5 |
routing: the "No session ID" group folds like the others, and one button folds or opens every group (zzzkl on Discord)
zzzkl: the Routing page's 未提供会话标识 group couldn't be collapsed. Its
head was a div with no click handler, no arrow and no aria-expanded,
because only a group with a key could be folded (`g.key ? "button" :
"div"`). closedSessions is keyed by the group's key, and "" is a key a Set
holds, so the no-session group now uses the same button, arrow and
handler as the rest.
Also, as asked: an icon button in the request list's existing header row
(.rt-fold-all, beside Replay) folds every group while any is open, and
opens them all otherwise. It shows only when the list is grouped (by
session or by key) into two or more groups. It has a tooltip and an
aria-label only, no text: "Collapse all" / "Expand all". Those two words
moved from plugins/library/i18n.js to the core i18n.js (zh, zh-TW, ja,
de), since Library and Routing now both say them (i18n-keys: a word used
by two plugins is the core's). The core script budget doesn't count
i18n.js or plugins/, so it isn't raised.
routing-sessions and inner-scroll-contain found group heads by
`button.rt-session` with a key; they now filter .rt-session by text, as
the no-session head is a button too.
Run (mote, node --test, Chromium + WebKit):
- routing-fold-all.test.cjs (new): 2 engines x 1100/420 x en, zh,
zh-TW, ja, de. It covers the no-session group folding on click, the
fold-all button folding then opening every group, its tooltip in each
language, and it being hidden with one group.
- i18n-keys, i18n-en-no-cjk, routing-sessions, inner-scroll-contain,
skill-fold-all, routing-row-swap, routing-rule-drag,
routing-order-unknown, routing-many-keys, in one run at concurrency
3 with routing-fold-all: 170 tests, 157 ok, 13 red. Every red is also
red on a clean origin/main
|
||
|
|
a9b1877cfc |
routing: a session's name stays when a later poll answers without it (#5365)
refreshOtherNames deleted a name the page had whenever a poll of /api/gateway/session-titles came back without it, so a read that failed or ran late (ZCode's database busy or slow, Flandern1211's report) put the card back to its folder until a later poll named it again. An answer without a name is unknown, not a session that lost its name: the page now only takes new names in. 226fc8ea3 makes ZCode's poll fast; this is the "names that vanish" half of #5365, which that commit leaves alone. Co-authored-by: Flandern1211 <163982805+Flandern1211@users.noreply.github.com> Run (mote, via mote-run): - node --test internal/gui/tests/routing-session-name-kept.test.cjs (new; Chromium and WebKit, all five languages, 1100 and 420): 20 pass. With client.js at origin/main: red, the card reads "Claude Code · work/zc" after a poll without the name. - go test ./internal/gui (budgets, i18n guards): ok but TestMainWindowCorners/macOS_26_SDK, #3949. - node --test on the 8 GUI files that fake session-titles (claude-subagent-tag, routing-by-key, -credits, -moved-why, -request-metrics, -session-folder, -session-title, -sessions) and i18n-keys: 185 pass, 1 fail, i18n-keys "a plugin's words are its own" on two words in files untouched here (#5332, #5327). Not tried: the whole GUI suite (one routing file changed by four lines, no new strings, no new API call). |
||
|
|
97ccb90e88 |
routing: a group with no rule shows only the example rule's button, no paragraph under Rules (mr_coffee0083)
|
||
|
|
01a260af46 |
routing: a group with no rule says what a rule is for, with an example rule (mr_coffee0083)
mr_coffee0083 on Discord asked how to set up a group where one model
thinks and several others write code: the group editor's rules part
had no word on it and no example to start from.
- plugins/routing/client.js: a group of two models or more, not routed
by hand, with no rule yet, says under Rules that every turn goes by
the routing, and how one model thinks while others write code: the
coding models in a group of their own added first, the thinking model
after it, routed In order, and a rule sending planning and hard
problems to the thinking model. "Add an example rule" beside "Add a
rule" adds that rule, its intent filled in ("planning, design, or a
hard problem to think through"), for the editor to finish. Neither
shows once the group has a rule, or for one model, or routed by hand.
- i18n.js: the three strings in zh, zh-TW, ja and de, with each
language's own word for In order.
- routing.css: the button wraps and reads in the accent colour, as the
text buttons beside it.
Run (wsl-run, magpie-desktop, Node 22, Playwright 1.62.0):
- routing-rule-example.test.cjs (new): 20 of 20, chromium and webkit,
en zh zh-TW ja de, at 1100 and 390 wide. The hint and button show,
nothing is past the editor's side, pressing adds one rule to opus
with the translated intent, Save posts it with the classifier Jev;
after a reload a group of one model, or routed by hand, shows
neither.
- the 16 i18n-*, routing-rule*, routing-rules-*, group-editor-* and
routing-classifier* files: 190 of 221. The 31 reds are in
i18n-keys (#5327, #5332), routing-rule-drag, routing-rule-models,
routing-rule-remove and routing-rules-line (#4585, #5088, #3789,
#4112, #4560). Those five files run alone, one at a time, at clean
origin/main
|
||
|
|
24d315fa85 |
routing: the request list can be grouped By key, each gateway key's calls under its name
acezan (#help on Discord) asked to see API use on the Routing page the way
it shows each agent's, live and in the history. The list's group bar gets
a third button, By key, after By request and By session. It shows once
Settings has a gateway key (/api/caller-keys). Each head is the key's
current name (else the name the route kept, else its id), with its agents
dim beside it and the usual count, tokens, in progress and cost. Calls with
no key (from this computer, or kept before 75fb76186 named the key) go
under "No gateway key". A row's tooltip names its key too. The choice is
kept in localStorage (magpie.routingGroupBy), and the old
magpie.routingBySession still works. Text added in zh, zh-TW, ja and de.
click-scroll counted two group buttons and now counts three, with By key
hidden when there is no key. purpose-filter clicked .last() for By
session and now picks [data-by="session"].
reference.md and gateway-sessions.md describe By key and Route.CallerKey.
Run (WSL magpie-desktop: mote's disk is full, ld errno=28):
- routing-by-key.test.cjs: 20/20 in chromium and webkit, in en, zh,
zh-TW, ja and de, at 1100 and 420. Red 20/20 with client.js and
i18n.js at the parent (waits for By key).
- 254 Routing-related GUI files at concurrency 4. Every red was rerun
serially, with this change and at origin/main
|
||
|
|
bf60ea5968 |
routing: an earlier account's overload reads overloaded, not quota used up (danzi002)
danzi002 on Discord (v0.1.3005): a Codex request's row read "529 · 额度用尽" (quota used up) while its detail said ChatGPT's 529 service_unavailable_error server_is_overloaded, on an account with its allowance left. The account was not rested as spent: an overload is failOther, rested a moment at most (vendorOverloaded). The words came from the row. When the last account left is out of its allowance after an earlier one failed otherwise, Codex is told the earlier failure (Try.Earlier), and the route takes that one's status, but the row paired that status with the last try's own fail, quota. The route now records the kind of the failure the agent was told (Route.Fail, from toldFail: overloaded for a 529 or a 5xx that says overloaded, the prompt turned away, else failure's reading), at both places serve tells an earlier try's failure: Try.Earlier, and every account after it passed over by a middleware. The Routing page and the panel's request rows (endWord) say that kind when it is there. "servers overloaded" is a new word for the row only (en, zh, zh-TW, ja, de), never a rest's Why. Run (mote, through mote-run; rebased on origin/main |
||
|
|
11d9d0a3a5 |
routing: each account one calm cell in Accounts and keys (danzi002 on Discord)
danzi002 (v0.1.2945): Accounts and keys "显示的好乱啊,没有之前一目了然". |
||
|
|
43849d51c3 |
routing: By session heads a session by its title, its folder quieter beside it (flandern1211_58540 on Discord)
Routing's By session headed each session "Claude Code · folder · title",
and with no title only the folder and id ("路由这里的会话名只能看到目录名和
会话ID吗"). Now the head is the agent and the session's title on one
line (whitespace folded), with its folder after it in a quieter .dir; with
no title the folder stands in, and with neither the id. The tooltip keeps
the title, the folder and the id.
The title comes from what magpie already reads, no second reader:
sessions.Titles (the agent's own title, else its first prompt) and Codex's
name index, and where both find nothing, the first prompt the gateway
recorded for that session (sessions.GatewayTitler, the title the Sessions
page shows for it), looked up under the agent the page names and the one
the gateway records it under (usage.AgentOf). A Codex thread Codex never
named now goes to sessions.Titles as a codex: key, so its rollout's first
prompt names it. withGatewayTitles and codexReadableTitles in trace.go.
Nothing is read that the Sessions page doesn't show already, and nothing
leaves the local GUI.
Tests: TestSessionTitlesFallBackToFirstPrompt (new): an unnamed Codex
thread gets its first prompt, a named one keeps its name, an unknown id
stays out, a pi session known only to the gateway gets its first words.
routing-session-folder.test.cjs follows the new head: title then .dir,
the first prompt on one line, the folder said once, the id with neither,
nothing clipped (chromium and webkit, en zh zh-TW ja de, 1100 and 420px).
Run on mote via mote-run, at origin/main
|
||
|
|
0f1b40bbc4 |
gateway: a reply in flight shows on Routing how much has arrived and roughly its tokens (#4951, Canda15)
A long or reasoning reply looked stuck on the Routing page. A request still out now shows, on its row and beside the account answering it, the bytes the agent has had, "≈ n tokens" once a rate is learned, and how long ago content last came; after 15s with no content the account's dot stops pulsing. Nothing stays once the request is done. Ported from Canda15's 7f7bdb189 (github.com/Canda15/magpie), the idea and the per-protocol content extractors kept, the hot path and storage reworked: - every write to the agent passes captureResponseWriter.Write, which calls liveRow.observe; the row hangs on the request's inflight (an atomic pointer), not a context value made per request - rates are in memory only (256 pairs); the fork wrote a JSON file under the estimate lock on every finished request - a whole JSON reply is counted in bytes only: the fork held and decoded up to 8 MiB of it at the end; a stream is cut into lines in place, only a line cut by a write's end is copied, a line over 1 MiB passed over, and each event decoded once (the fork ran json.Valid then Unmarshal) - the reply's kind comes from its first byte, not a header read on every write; the keepalive check allocates nothing (the fork split each write) - everything a row counts is under its own lock, and inflight.tr is read under f.mu; the estimate is in float64 (the int64 product overflowed) - the route's Seq is bumped on every write and traceGather batches the wake-ups; the fork's global throttle could drop the last update before a pause - learned only from a streamed reply that did not fail and had the vendor's output tokens - left out: the finished row's "Received" metric and the ended caption (layout restraint; an ended row has its own metrics), a duplicate "Received" i18n key, the receive-monitor doc (the design is in gateway-routing.md now), the fork's xmod and Windows CI commits The Routing plugin and i18n.js are outside TestCoreScriptBudget. Run on mote at this head unless named: gofmt -l; go vet (darwin), GOOS=linux -tags nogui and GOOS=windows go vet ./...; go build ./...; go test -race on the live tests; go test ./internal/gateway ./internal/gui (gateway ok; gui red only on TestCoreScriptBudget, #5139, 1533907 > 1533802 before this change and untouched by it, and TestMainWindowCorners/macOS_26_SDK, #3949); routing-live-bytes.test.cjs and i18n-keys in Chromium and WebKit, en/zh/zh-TW/ja/de, 1100 and 420px (24/24); every routing-* and panel-routing* GUI file with i18n-keys in WSL Linux (Chromium all green; WebKit reds in 12 files, the same class at origin/main |
||
|
|
9095fd82d8 |
gateway: a conversation kept for its cache is asked again once on a passing 5xx before it moves (jiabubu)
jiabubu on Discord: a channel that errs once and answers a moment later had the conversation moved off it at the first error, under every rule, and the next one was sent it all uncached. Only the last candidate left (or Strict's lone one) was ever asked again. Now when the conversation is kept where it is (Affinity.Kept: Auto with a warm cache, Session, or within a turn) and that key or account fails in a way that passes (busy: overloaded 503/529, another 5xx that says nothing of quota, 408), and not as a 429, quota, refusal or sign-in, it is asked once more after retryPause (or a Retry-After up to longestPause) without resting. Once per request; failing again it rests and the next is asked as before. A conversation nobody answered yet, or under Stays Off, moves at once (keptAgain in affinity.go). The trace marks the try (Try.Kept) and the Routing page says it was asked again for what its vendor cached, not "nobody else is left to ask", in en, zh, zh-TW, ja and de. TestFixedMemberEffort and TestHeldRuleFailsOverWithinItsMember had a kept member fail with a lasting 500; they now expect it asked once more (kq1 kq1 kq2) before it moves, the outcome unchanged. Run on mote (mote-run): - TestKeptConversationAskedAgainBeforeItMoves (7 cases: Auto, Use before expiry, Session, failing twice, 429, new conversation, Off), TestFixedMemberEffort, TestHeldRuleFailsOverWithinItsMember: ok. - go test -count=1 -timeout 45m ./internal/gateway/: all ok but TestGroupBackupStandingInWhileTheFirstIsBackAndBehind and TestGroupMemberPutFirstOnItsMeritsKeepsItsCache, red with keptAgain switched off too: #5209. - routing-kept-again.test.cjs: 20 of 20 (chromium + webkit, en zh zh-TW ja de, 1100 and 420 wide). - GUI routing-*, group-*, i18n*, gui-* (2967 tests, concurrency 4): 42 red, all in files this doesn't touch; 14 of those files alone: 28 red, and the same files at origin/main |
||
|
|
ce21ea8566 |
usage, routing: counts are said short (K/M, 万/亿), the exact number on hover (skyhuang1994)
skyhuang1994 on Discord: long token and request counts on Usage and
Routing are hard to read at a glance. They now go through fmtN (K/M/B,
in Chinese 万/亿), with the exact grouped number (ledNum) as the title,
so hovering shows it. A count that fmtN already writes in full gets no
title.
- Usage (plugins/usage/page.js): the Requests table's input, output and
cache cells (output keeps its reasoning line, cache write its TTLs
under the exact number), the Requests block, retried, the sources
tile and the ledger's sum line. sameRead moves here from app.js,
beside loadSessions, its only reader.
- app.js: the Tokens and Requests blocks (blk takes a title), the
ledger's call count, the rank's values and "{n} requests".
- Routing (plugins/routing/client.js): the day menu's note, the "more
days" name, the day rows and the stats.
Core scripts: 22 bytes smaller than their base (1533979 at this head;
TestCoreScriptBudget stays red on #5139 as on main, not worse).
Tests: usage-compact-counts.test.cjs is new (Usage and Routing, every
language, chromium and webkit, 420 and 1100px). panel-usage's rank
value expects "900K" with title "900,000"; ledger-cache-unknown's
counted cells expect fmtN text with ledNum as the title.
Run (mote-run):
- at ded9e4a62 (on
|
||
|
|
70a98dd85c |
routing: a long Accounts and keys shows its first rows, the rest behind Show N more (ferock4669, iyou00 on Discord)
With many keys the Routing page's Accounts and keys ran on and on: each card held every window, the models it answered and a meter. Now a card keeps its name, one line of what is left (or its rest) and how it fares, with Try now or Sign in again when it needs one. The models it answered are in its tooltip under its id, and a subscription's other windows are on hover over its figure. A list longer than 8 rows shows the first 8 and puts the rest behind "Show N more" at its foot (kept across a reload in magpie.routingActsAll). Never behind it: a row to sign in again, a resting account or model, failures with no answer, a remote whose allowance can't be read, rows under a fold the reader opened, and the heading of a provider with a row shown. Two more alone aren't folded. The button clicked stays where it is on the screen. "View usage" beside it opens Usage's Overview, where each account's card says it all, without making that tab the reader's own (window.openUsageOverview). The foot writes only what changed, so an idle page writes nothing (routing-live-calm). Tests: routing-acts-compact.test.cjs (new; chromium and webkit, en zh zh-TW ja de, 1300px and 420px). routing-account-windows, routing-read-allowances, routing-wallet-lapse, routing-accounts-narrow and routing-columns follow the card's new shape and the foot. Run on mote via mote-run, worktree based on origin/main |