ac4af582301a4e8a29245dbba767eba31334ddf9
69
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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 |
||
|
|
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 |
||
|
|
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 |
||
|
|
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
|
||
|
|
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 |
||
|
|
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
|
||
|
|
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) |
||
|
|
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
|
||
|
|
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
|
||
|
|
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
|
||
|
|
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 |
||
|
|
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 |
||
|
|
d16dcba227 |
routing: the stage's agent and magpie columns grow with their words, up to 15% of the stage
refeccd on Discord (#help): on the Routing page, in a full-screen
window, the stage kept the agent and magpie in columns of 124px each, so
the agent read "Claude Desk…" (and its model auto/claude-opus… was cut)
while the group's member rows ran on across the rest of the stage.
The two columns are now fit-content(max(124px, 15%)): as wide as their
words, at least 124px (min-width on .rt-srcs/.rt-hub, dropped again in
the narrow layout), at most 15% of the stage. Where 15% is no more than
124px (a stage up to ~826px) they are exactly as before, so the member
rows lose nothing on a narrow window; the narrow layout (560px and less)
is unchanged. The stage's ResizeObserver now also watches the agents'
and magpie's cards, so the wires follow a card that changes width while
the stage keeps its size (a new agent name or gateway address).
Run, on mote:
- new routing-stage-wide.test.cjs: 60/60 (chromium + webkit, en zh
zh-TW ja de, 2560/1920/1100/800/560/390px): name, model and address
read whole at 1920+, columns 124px..15%, exactly 124px where 15% is
less, wires start and end at the cards, no sideways scroll.
- broken by hand: with the old routing.css the same test is red in all
20 cases at 2560 and 1920px ("Claude Desktop" cut, columns 124/124).
- every routing-*.test.cjs + i18n-keys at 8d7583a78 (this change on
|
||
|
|
f0e0385a0e |
routing: a row's model chip is whole; its status is what is cut short (yi_time)
yi_time on Discord (#feedback): on the Routing page, a group member's
row that was answering showed its model chip cut to "gpt-6.1-te…".
The status after it ("回答中… · 按意图"任务主要依靠视觉或界面…")
took up to 60% of the row (fit-content(60%)), and the head, with the
account, plan and model as one inline run, was cut at its end, which
is the model. So which model answered didn't show. The same happened
in a fold of keys, whose status column was auto, and at narrow widths,
where a long account name pushed the chip off.
The head's column is now as wide as its content (minmax(0,
max-content)). The status takes the rest and keeps at least
min(14em, 40%), cut short with an ellipsis. Inside the head, the
account name, then the plan, give up room. The chip and its
fast/fallback tags never shrink. Folds get the same columns, and their
status still wraps. A status beside the name is right-aligned, as
before. Under the name (max460/max560) it starts at the left. A status
cut short is read whole on hover: its em gets a title when the pointer
finds it overflowing. Measured on pointerenter, not each render
(#3164). Resting rows keep their rest tooltip; the intent and session
titles are as before. Sibling of
|
||
|
|
889767b7b3 |
routing: a failed try's tag over its row is whole until it fades (yuancjun)
yuancjun on Discord (#feedback, v0.1.2784, Chrome 128 on macOS): a member
row's failure tag ("504 · 迟迟未开始") showed whole for ~0.45s, then its
top half, the ~10px over the row's top edge, was cut off until it faded
at 1.8s. Their analysis was right: `.rt-accts .tag` sits at top:-10px,
`.rt-accts li:not(.hit)` has content-visibility: auto (#3164), which
always paint-contains, and rerun() takes `.hit` off on the shake's
animationend at 0.45s while `.tagged` stays 1800ms.
The row is now drawn whole by a class of its own, `lift`, put on with
`tagged` and taken off 300ms after it, once the tag's .25s fade-out is
over: with `:not(.tagged)` alone the tag's top would be cut again for
the whole fade. The CSS rule goes on `:not(.lift)`; `.hit` always came
with the tag, so it adds nothing there. A row tagged again within 1.8s
(the next try failing on it) starts the 1.8s over: the first failure's
timer used to take the second tag down early. This is the only place a
row is tagged; nothing else in .rt-accts stands over a row's edge.
Run on mote (load 70-110 from other sessions' suites):
- routing-tag-whole.test.cjs (new): Chromium and WebKit, en, zh, zh-TW,
ja, de, 1100 and 420 wide, motion on (the shake must end for the cut
to show): 20 of 20 ok. It plays a live request failing 504 slow,
checks the tag's words, then at ~0.8s screenshots the band of the tag
over the row's edge and counts the tag's red in it, checks the row's
content-visibility while tagged and while it fades, and that rows go
back to auto after.
- At the rebased head (on
|
||
|
|
2cfeda3d3a |
routing: a group editor's Cancel and Add have the scroll capsule above them, their ground to the window's edge
jiabubu on Discord: in a Routing group editor, its bar of Cancel and Add,
held at the window's foot while the editor runs on below, had the Scroll
to top and Scroll to bottom capsule over Add, and under the bar's ground a
gap above the window's bottom edge.
- The capsule (scrollends.js) rose above Providers' sticky Add bar only.
It now rises above any page foot marked .view-foot that is under it,
and the editor's bar is one. A foot elsewhere on the page, not under
the capsule, leaves it where it was.
- The bar was held at bottom: 0, which stops at the view's own foot
padding (4px, 8px in the window, max(12px, the safe area) on the phone
page, from app.css), so that much of the page showed under it. It is
now held that far down, its ground to the window's edge; on a phone
page its buttons keep the safe area under them.
routing-editor-foot.test.cjs: sixteen groups, then New group, scrolled so
the page is a screen down and the editor runs on below the window: the
bar's foot at the window's edge, the capsule above the bar and over none
of its buttons, and Add's right end taking a click as Add. Desktop 1100,
700, 560; browser page 1100, 700, 440, 360; Chromium and WebKit,
en/zh/zh-TW/ja/de.
Run on mote (mote-run):
- routing-editor-foot, Chromium and WebKit, en/zh/zh-TW/ja/de: 10 of 10
ok.
- At b3cf5641a (this change on
|
||
|
|
96acc59c4d |
routing: a group's tags, a provider's segments and the live stage stay inside the window
young02036 on Discord: a long line in a group's row ("WorkBuddy AI · Hy3 ·
免费") made the Routing page wider than the window, with a scrollbar under
it. v0.1.2769 held the member lines; the rest of each row could still go
past it:
- a group's tags never shrank or wrapped (flex: none, nowrap). With many
tags (German's long words, or any language at 700px) they pushed Edit
and the switch out past the row's edge, where the list cut them off.
The tags now take up to half the row and go onto more lines, each one
ellipsized; on a phone page they keep their own line as before.
- a provider's Routing and Stays segments (several accounts or keys) sat in
an auto-wide grid column and ran out past the row in the desktop window,
63px in Chinese and 265px in German at 560px. The column is now as wide
as the row has room for, and the segments wrap there, as they already
did on the browser page.
- in WebKit the live stage's "No request yet" row, out of sight
(content-visibility), kept the width it was last drawn at in a wider
window. In a grid column as wide as its rows, that held the stage, and
the page, 1193px wide in an 880px view after a group's editor opened.
The stage's list now has one column as wide as itself.
routing-rows-fit.test.cjs: three groups (smart, manual, and an order group
with every tag a row can carry) of the reporter's WorkBuddy AI members and
long model names, and a pooled provider. The list, then each group's
editor in turn on one page, at each width down to 560px (desktop) or 360px
(browser page) and back to 1440: the view and the document no wider than
the window, and every row's tags, buttons, switch and segments inside the
row. Chromium and WebKit, en/zh/zh-TW/ja/de.
Run on mote (mote-run) at the pushed head:
- routing-rows-fit and routing-accounts-narrow, Chromium and WebKit,
en/zh/zh-TW/ja/de: 20 of 20 ok. At origin/main's routing.css (rows-fit
copied in): red in both engines, en and de ("desktop list 700px: each
row's tags, Edit, switch and segments inside it").
- With the next two commits and the one before, at 77eed2ea4 rebased on
|
||
|
|
ecdb80f7f1 |
routing: under the requests, providers flow in columns, each heading over its own
jiabubu on Discord, on v0.1.2774 in a narrow Windows app window: Usage &
keys still listed the providers one under the other.
|
||
|
|
a5c1fa4b42 |
routing: long routing groups no longer widen the page (noahhrreion)
noahhrreion (Discord #general): on Routing the groups at the foot made the page wider than the window, a scrollbar under it and each row's routing, Edit and switch far off to the right. Cause: |
||
|
|
cb7d7f9aa6 |
routing, usage: a request names who answered with the provider's logo (Jiabubu)
Jiabubu on Discord asked for the provider's icon before the answering provider or account in the request lists. Routing's Requests rows now draw icon(logoOf(member)) for the try's member (tried(r, tr)), the same logo the request's story uses, between the dot and the name, at 14px. A request nobody answered has no try and no logo. In Usage → Requests, the "Provider · account" cell holds the ledger's provider icon (l.providers) before .where-name, inside a new .where-line. A row read from a session file (source "log") names no provider for sure and gets none. .where-name's text is unchanged. No new strings, no new icons. Test: request-provider-icon.test.cjs. Routing has codex-color and deepseek-color, none on the failed row, a 14px logo before and level with the name. Usage has openai and zhipu-color, none on the log row, the name alone in .where-name, the logo inside the cell. Chromium and WebKit, en zh zh-TW ja de, at 1100 and 420px. Run at the pushed head on mote: see the head run below. Also routing-log-icons, routing-row-reuse, routing-live-patch, usage-ledger, usage-ledger-search, usage-ledger-fit, usage-ledger-agent-middle, session-identity, i18n-keys, phone-rows. Budget tests ok: app.js is untouched, and the plugin files are outside the script budget. Broken by hand: dropping the Routing logo makes 22 of 22 red; dropping the Usage logo makes the Usage checks red in every case. Not tried: the whole GUI suite (mote was busy with two other whole suites); the real Windows app. Head run (mote, 1e6a29337 on |
||
|
|
51dcb67383 |
routing: in a narrow window the accounts and keys sit several to a line (Jiabubu)
Jiabubu on Discord (Windows, 0.1.2738): with the window narrow, Requests and Accounts and keys go one under the other, and every account or key then took a whole line, so a page of many accounts ran far down. The cause is routing.css: under 1150px .rt-acts stays a one-column block list. Now, when the columns stack (not .min1150, or .solo), .rt-acts is a grid of auto-fill columns of at least 168px. Each provider's heading and an open "N accounts" summary row span the whole line. Beside the requests (1150px and wider) the column holds one to a line, as before. No collapse arrows and no other change to the page: once the list is compact the page is no longer long. Test: routing-accounts-narrow.test.cjs. At 700, 560 and 420px, four accounts with two of them sharing a line, side by side; headings and the summary row across the list; no sideways scroll; names inside their box; one to a line at 1440. Chromium and WebKit, en zh zh-TW ja de. Run at the pushed head on mote: that file 10/10. Also routing-columns, routing-keys-fold, routing-group-fold, routing-compact and the rest of the head run in the next commit's body; TestCoreScriptBudget and other Budget tests ok (no script grew). Earlier, at |
||
|
|
173b7e2742 |
routing: the group being edited reads as selected, its Save in reach (Jiabubu)
Jiabubu (Discord, #feedback): on Routing, the group being edited looked like the groups above it, and Save was a small text button at the editor's foot, a long scroll down. The editor in the groups list now reads as the selected row: a soft accent tint (4% over the card) and a 1.5px accent ring all round, its corners following the list's when it is first or last. No stripe down one side. Its bar (Remove, Cancel, Save) is sticky at the bottom of the view while the editor's rows scroll by, on the editor's own tint, and sits where it always was once its foot is reached. Cancel and Save are 28px tall at 13px (were 23px at 12px); the web's 44px touch size still wins on a phone. The list clips its overflow instead of hiding it (overflow: clip, with hidden as the fallback), so the bar can stick. Nothing else on the page moves (#1354). Measured, editing the third of four groups (a ten-member group) with its head near the top of a 760px window: Save was at y 1845 (1000 wide) and 3013 (420 wide), out of sight; now at 714 and 694, in sight, in Chromium and WebKit. group-editor-selected.test.cjs, in Chromium and WebKit, desktop and web, 1100/770/420 wide, en/zh/zh-TW/ja/de (and dark in zh): the editor is tinted apart from the other rows and has a ring, both sides alike; scrolled by the reader to its head, Save and Cancel are in the window, uncovered, 28px and 13px or more; scrolled to its foot, the bar follows the last row inside the editor. Broken by hand: with origin/main's routing.css it fails at "light desktop 1100 en: the editor is tinted apart from the other groups"; with only the list's overflow: clip taken out, at "Save is in the window (1353-1381)". Run on mote at this tree (on origin/main |
||
|
|
e44ad72cfd |
gui: a failed status dot is an x, not a red dot alone
coolmantou on Discord (#feedback), who is red-green colour-weak, could barely tell the green status dot from the red one. Under a deuteranopia or protanopia simulation the two are one olive colour, in light and dark. Making the green lighter would not help a greyscale or protan reader, so the failed state now says it by shape (Apple HIG: never colour alone). What changed - app.css: a --x-mark token (an SVG x, used as a mask). Each failed dot keeps its red and its 6-7px box, is drawn through the mask and scaled 1.5 so it reads as heavy as the round dot. Layout is unchanged. Dots: Test models (.tdot.bad), an agent's status (.ag-st.bad .ag-dot), the check-in (.ci-dot.bad), the request ledger (.led tr.bad .st .dot). - routing.css: a try or probe (.rt-req/.rt-probe.bad .to i), a step (.rt-steps li.bad::before), the preview (.ps-dst.bad > i). - library.css: a server that failed (.lib-health.err::before). A ring was not used because "not checked" is already a ring there (#2308). - Not changed: green-only dots with no red pair (gateway, keys, tiles, live), chart markers, routing's animated packets, redact's categorical facet dots. The tray has no status dots of its own. - docs/subsystems/gui-shell.md says it beside "State is shown with a dot". Tests - status-dot-shape.test.cjs (new): for all 9 pairs with the real stylesheets, in chromium and webkit, light and dark, 980 and 420 wide: the good dot has no mask, the failed one has the x mask and the good one's box, and its pixels have ink on the arms and centre and none above the centre. - library-mcp-health.test.cjs: its "a dot, not a stripe" check now expects the x for a failed server and a round dot for the rest. Run at the pushed head (mote, via mote-run) - status-dot-shape + library-mcp-health: 16 pass, 0 fail (chromium and webkit). - go test -run 'Asset|CSS|Budget|Compress|Revalidate' ./internal/gui: ok. - At |
||
|
|
85e37162e9 |
routing: a route group can be held to chosen accounts (duanckham on X)
duanckham has a personal and a company GPT account, one tool and one gateway, and wants a group's GPT models to spend only the company account (or only his own). A second gateway key doesn't fit: his tool talks to one gateway, and a local agent needs no key at all. Group.Accounts holds a group to some accounts or keys of the providers it names, in a gateway key's form and by the key's rule (#905, Identity.AllowsAccount). The asked group narrows the request's identity (access.Identity.HeldToGroup: the strict intersection with the key's own list; "<provider>/\x00" when they share none), so every gate a key's accounts go through holds the group's too: chat, responses, messages, count_tokens, embeddings, images and video, streamed or not. A group reached inside another, as a member or a fallback, is held in planLevel (hold, Member.Via): its candidates on an excluded account are Held rows with Weighed.HeldBy, which the Routing trace tells. Fallback stays within the group's entries; with every allowed account resting or out the group's usual error comes back, and a key and a group that share no account get a 403 naming the group, nothing asked upstream. SaveGroup resolves each entry (ResolveAccount, shared with the key's CleanAccounts); share and import drop them. A group without accounts is as before. GUI: the group editor's Accounts section, a row per member provider with two or more accounts, "Any of its accounts" until some are ticked in the app menu (openPicker multi). Every save sends accounts, since a save replaces the group. Strings in all five languages. Gateway keys stay as they are: Gateway › "Gateway keys are for other computers … added here once Share on local network is on" already says where, and this case needs none. Run (mote, through mote-run), at cafed0067 on origin/main |
||
|
|
3f2faef620 |
gui: the Providers page has its own Hide accounts switch
Routing's Hide accounts (账号打码) also masked the Providers page, where nothing showed it was on or let you turn it off (Discord #feedback, 1566189346665799752). The Providers page now has its own switch beside its search box, placed and drawn like Routing's (.rt-mask moved from routing.css to app.css), and each page follows its own switch: Routing, Usage and the tray panel follow magpie.maskEmails, Providers follows magpie.maskProviders. The user's own choice is kept: when maskProviders was never stored, it is seeded from maskEmails and written at once, so someone who had masking on stays masked on both pages after the update, and someone who turned it off stays unmasked. A switch with a stored choice is not changed by Mask personal data's follow(); turning Mask personal data on still masks both (hideAccounts.set(true, true), in app.js and plugins/redact/page.js). show() asks hideAccounts.page() to re-mask when the page in sight follows the other switch. No new strings: the button reuses Routing's translated label and title. app.js 1,310,438, core under its budget, no raise. Run: - New internal/gui/tests/provider-mask.test.cjs, both engines, all 5 languages, at 1000 and 420 wide, plus the touched window-mask, account-eye, privacy-hides-accounts, mask-emails, plugin-name-unmasked, masking-demo-unblurred: 134/134 on mote. At the rebased head (origin/main |
||
|
|
e1aec53895 |
routing: each session sending at once has its own context window, named by its title (tjhhhh on Discord)
tjhhhh runs several agent sessions at once. The Routing page's context
window card followed whichever request came last, so it jumped from one
session's prompt to another's. The card still tells of the request it
picked. Under it, while two or more sessions are live, a strip now
shows one small block per session (renderCtxSessions):
- keyed as the card's line of prompts is (sessionKey, else the
conversation);
- named by the agent's title for the session (sessionName), else its
folder's last level, never a bare id;
- holding that session's newest reading through context.js's stack bar,
exported as window.ctxStack.
A session is live while a request of it is under way, or while its
newest request is within 15 minutes of the newest overall. At most six
blocks show, newest session first. A block keeps its place while the
sessions take turns, because blocks are ordered by each session's first
request. The block the card tells of is lit (aria-pressed), and a click
on a block picks that session's newest request. The card's footer names
the session by its title too. New words are in every locale in
plugins/routing/i18n.js. The strip reuses the card's tokens: no select,
no coloured border, no gradient.
The strip sits under the card, not over it. Over it, the strip's first
appearance moved the card, and routing-ctx-still ("the cache kept its
place") went red in both engines. It is green at base
|
||
|
|
b52c39b65e |
routing: an account's row names the session it answers
connor_yang (Discord #help) asked that the Routing stage say which
session an account is serving next to its "answering…" / "answered this
request" status. The row now ends "· <title>", one line cut short with
the full title on hover, and only when the agent itself named that
session:
- Claude, Gemini and the other agents: sessions.Titles by agent:id, the
same source the By session list heads use.
- Codex: its own name index (session_index.jsonl) by thread id.
- A Codex request whose parent the server inferred from prompt and
reply fingerprints (parentMatched) shows nothing, since that parent
is a guess. An untitled session shows nothing too.
Cost: no new server path. The titles come from the existing
/api/gateway/session-titles calls that refreshSessionNames already makes
every 15s and on focus. A session id the page hasn't seen is asked for
once (marked asked before the fetch, 300ms debounce, never two calls at
once), and the ask is skipped when a read since then already covered it
(namesDue). The per-second render only reads two maps. The title sits in
its own nowrap span, because the narrow stage (.max560/.max460) wraps
the status.
A Codex names reply silent on a session no longer clears the title
the trace brought. CodexTitles leaves unknown ids out, and returns {}
when the index can't be read, so the old loop turned a failed read into
"no title". With the earlier ask it also raced the trace: routing-sessions'
"title helpers belong to the named parent" went red 3 of 6 runs under
--test-concurrency=4 until this change, then 6 of 6 green.
Run:
- routing-session-title.test.cjs (new): engines x claude/codex x en, zh,
zh-TW, ja, de x 1100/420px = 40 tests. Chromium 20/20 on mote.
WebKit 20/20 on the Linux box (wsl-run, magpie-desktop). On mote even
a bare webkit.launch() timed out at 60s under other sessions' load (21,
67 pw_run processes), so WebKit there tested nothing.
- 16 nearby routing GUI files (answered-still, row-reuse, row-two-lines,
stage-routes, sessions, reroute-title, tick-no-layout, live-patch,
busy, served, js, steady, steady-garbage, session-folder, live-calm,
request-model) in Chromium and WebKit on the Linux box, before the
rebase onto
|
||
|
|
0621e70fb9 |
routing: leave a provider out of the groups magpie finds
chenxiang0010 on Discord asked to keep a provider or a model out of the auto-created routing groups. A model could already be kept out (remove its found group; magpie keeps it removed), but a provider could only be turned off per group or everywhere. Now Routing -> Groups, under "Find groups on their own", has "Leave out a provider..." (app menu, saved when it closes) and `magpie group auto skip <provider>...|none`. The providers chosen (providers.json autoGroupSkip) join no found group; a group the user made or changed keeps them, a found group left with one provider goes away, and a request for it is served by AutoStandIn from a provider still in, and agents on it are reseated (agent.Reseat). A rename carries the id along. en, zh, zh-TW, ja, de. Run at 383947fce (this change on origin/main |
||
|
|
869c4d112d |
routing: the magpies fly under the cards, and a long intent is cut short on its row (penershu on X)
penershu on X (v0.1.2123): with two agents sending at once through jd-auto-balanced, one magpie sat on the hub's "127.0.0.1:3425" with its dot beside it, another on the group's split dot, and the row smart routing picked ran "回答中… · 按意图“Design architecture…”" off the right edge. Cause: - .rt-sky (birds and dots) was z-index 2, over the cards (z 1). Flights cross the hub's box (via(), |
||
|
|
8701eb35ea |
routing: with several routes on the stage, each route's rows hang under its own heading (hoobnn on Discord)
hoobnn: "路由这里,会莫名出现两个没有使用的路由,并且鼠标悬浮,显示错误的 供应商". The screenshot's header read "DeepSeek-V4.1-Flash · 路由组 · 启用 3 个 · 3 个 Agent 同时在发" over five rows: the group's three (Volcengine Ark, a DF Model account, Qwen China) and, between and below them, Pi's zcode account and OpenCode's Kimi Code (China) key. Cause: the stage shows up to four agents at once ( |
||
|
|
e1721d6404 |
routing: a weighted group's editor sorts its members by weight once (Norcleeh)
Norcleeh (Discord #general) asked for a way to order a By weight group's members by weight. The order matters there: it is the fallback's when a model fails. Now the group editor has a "Sort by weight" text button beside Add another model. It shows while the group routes By weight and the order would change. A press puts the named members heaviest first (no weight counts as 1, equal weights keep their order, one switched off is sorted too; a pattern's members stay after them) and draw()s. The button then goes. It is a one-off reorder of the draft, saved with the group's Save; no mode is stored. Its title says the order is the fallback's. Strings in zh, zh-TW, ja and de. The routing plugin's client.js isn't a core script; no budget changed. Run (mote-run, at this head on |
||
|
|
9e33962c05 |
gui: Settings has Reduce motion, stilling magpie as the system's does (#3813)
CupOfBread asked for a switch that turns magpie's motion off to save
resources on the desktop, and linull24 saw the Routing page keep a
phone's browser busy. magpie already stills its animations under the
system's Reduce Motion: 46 @media (prefers-reduced-motion: reduce)
rules across app.css and the plugins' styles, and calm() in the
scripts. Settings -> General now has "Reduce motion" (Off / On) that
does the same without the system setting.
- settings.json keeps reduceMotion; boot.js passes it; a POST that
leaves it out keeps it, as the other prefs.
- theme.js's holdStill(on) sets data-motion="reduce" on <html> and sets
the media of every stylesheet rule written for reduced motion to
"all" (and back when turned off), so the same rules apply and no CSS
is written twice. layout.js calls it before the first paint when the
saved setting is on; applyPrefs calls it on a change.
- calm() is true when data-motion is reduce too, so the scripts'
motion (Routing's stage, Library, Usage) holds still with it.
- routing.css: the reduced-motion rule for the live dot was
.rt-livedot, which lost to .rt-livedot.on's animation; it is now
.rt-livedot.on, so the dot stands still with either setting.
Measured on mote (Chromium 390x844, 4x CPU throttle, live Routing
traffic, CDP Performance over 10s, two runs each): main-thread task time
0.18 and 0.22 s/s with it off, 0.090 and 0.085 s/s on; style recalc
0.021/0.025 off, 0.008/0.011 on.
Tests: reduce-motion.test.cjs (new, both engines): saved on, the
reduced-motion rules apply from the start (a probe's live dot has no
animation, calm() is true); Off restores them and posts false; On again
posts true. TestSettingsReduceMotion: off by default, kept by a POST
that leaves it out, cleared by false, in settings.json and boot.js.
The Settings row is in settings-general's list of rows.
Run on mote at this head (rebased on
|
||
|
|
7dcc0aedc6 |
routing: a group's rules line up without a subgrid, as the requests do since #3731 (#3955)
Each .rt-rule was a subgrid of the rules list with a fit-content(50%) conditions column, the shape gpboyer2's Safari 16 crash stack showed for the request rows (#3731). Now the list is a flex column and each rule is a grid of its own on 16px fit-content(50%) minmax(0, 1fr) auto. Its conditions are at least --rt-condw wide: fitConds takes the property off, reads each rule's conditions width under its own fit-content(50%), and sets the widest, rounded up to 1/64px, on the list. It runs when the rules are drawn, and a frame after the list or a rule's conditions change size (ResizeObserver, disconnected on each redraw so rules drawn before are not held) or a condition is typed into. Under 640px the property is unused (min-width 0), as the layout there was its own before. New test routing-rule-columns: no rule of the rules' CSS says subgrid; in both engines and five languages, every rule's → and its conditions start at one x at 1100, 900 and 700px; at 390px what a rule does is under its conditions and nothing passes the editor's side; an intent typed longer moves every rule's → right, and shorter again back left, still at one x. Run on mote (Playwright 1.62.0, Chromium and WebKit). At the rebased head on origin/main |
||
|
|
a1f0a6109a |
routing: the requests list lines up its rows without a subgrid, so Safari 16 stops crashing on it (#3731)
gpboyer2 found the cause: each .rt-req was a subgrid of .rt-reqs with fit-content() tracks, and Safari 16's grid track sizing recursed on it until the WebContent process died and the page reloaded, again and again under steady traffic. Now .rt-reqs is a flex column and each row is its own grid on var(--rt-cols, var(--rt-tpl)). A hidden .rt-sizer grid at the list's foot holds one probe per row shape (display: contents cells placed by column), and fitCols reads its computed columns into --rt-cols: the fixed ones rounded up to the layout's 1/64px, the flexible one minmax(0, 1fr). A ResizeObserver on the probes' cells, deferred a frame so WebKit logs no "ResizeObserver loop", refits when a cell's width changes. New columns drop the rows' measured heights (listKey carries --rt-cols) but keep the average, and metaFit measures with the columns of the layout it tests. Found on the way and fixed here since the new key needs it: drawList sized the gaps with the average from before it was recomputed. The other subgrids of the same kind (.rt-rule, .sess-bar, .sess-skill, .quota-windows .quota) are #3955. Tests: routing-own-columns.test.cjs (new) fails on the old code (a subgrid in routing.css) and checks, in Chromium and WebKit, en and zh, at 1440, 1100, 940 and 700, that every route has a row and the rows' columns line up. routing-day-window, routing-scroll-end and routing-live-calm read the rows' own columns and skip the sizer. Run at this stack's head 103631319 on main |
||
|
|
ca9b5048e3 |
routing: a request tried on many keys keeps its steps in a box of 200px, so the list below stays where it was (#3764)
A trace tried on 40 keys says a line or two a key, so .rt-steps grew to ~2500px and pushed the request list a screen down; clicking between it and a one-key request moved the list by that much each time (hheei's analysis in #3764). The list now holds at most 200px (eight or so steps) and scrolls in itself; short stories start at its top as before. jayswu's patch (their branch gui/cap-routing-steps-height, ported here since the repo takes no outside PRs). One change to it: a different request's story starts scrolled to the top, and that reset now runs before renderSteps' "nothing changed" return. In the patch it ran after, so two requests whose stories read alike (the same keys refused the same way) kept the first one's scroll. Run at base |
||
|
|
77f860105c |
routing: a flowing wire is drawn in a layer of its own, so WebView2 doesn't redraw every wire each frame (#3164)
On Windows the Routing page with an 800-key group open ran at 31 fps. A flowing wire (stroke-dashoffset animated) sat in the one svg of every wire, 993x36215 px with 803 paths, and Chromium re-rasterized that whole svg on the GPU each frame: CrGpuMain was busy 5s in 5s, 3.6s of it in RasterDecoderImpl::DoRasterCHROMIUM. Hiding the wires svg gave 118 fps, taking the dash animation off the wires 102 fps; WebKit (macOS) was never slow here. Now flowNear draws each flowing wire by a copy in .rt-flows, an svg over the wires with will-change: transform, with the wire's d, --agent and the dashes it worked out, and hides the wire itself (.flown: hidden, no animation). The look is the same; the svg of every wire no longer changes while a request flows. Reduced motion stops the copies too. Real WebView2 (Edg/155, Windows 11, Radeon 8060S), the magpie window at 1281x1128 CSS px, dpr 1.1, a sandbox HOME with two providers of 499 and 299 keys in one group, both folds open, a request every 0.3s through a fake upstream; v0.1.1587's release exe against this commit built with GOOS=windows: steady 15s x3 31 fps, 89-94 frames >40ms -> 114 fps, 4-9 >40ms scroll 12s 58 fps -> 88 fps fold+unfold 4s 41 fps -> 103 fps The same injected by hand into the old page first: 38 -> 48 fps with the copies in a plain svg, 94 fps with will-change, so the layer is what does it. Test: routing-answered-still checks that each flowing wire has a copy with its d, animated, in a will-change layer, the wire itself hidden and still, and that nothing is left once the request is done. Without this change .rt-flows doesn't exist and it times out. Run at this commit (rebased on origin/main |
||
|
|
098ac9696d |
routing: with 200 keys or more only those near sight are in the list (#3164)
With both groups open (800 keys) every update laid out, read and moved every key, longer than a frame in WebKit. From 200 keys on, a run of keys far from sight is now one gap li as tall as they are (place), and a key in it is given the box it would have there, so its wire is drawn as before. Scrolled half a screen on, or when layout finds the view moved, the list is made again around where it is, keeping what is in sight where it was. put() moves only the nodes out of order, so a fold held where it was clicked doesn't move with a re-place. A gap is a new li each time, never one used again for other keys, so app.js's click hold can't keep a gap that now stands for other rows (app.js unchanged). The stage's ResizeObserver lays out in the next frame: layout() reads the rows, and rows coming into sight change #rt's height by a fraction of a pixel, which WebKit reported as a ResizeObserver loop. Run at |
||
|
|
9fc382e66d |
routing: a key off screen is not laid out or painted, so hundreds of open keys keep WebKit's frames (#3164)
With a group's 500 and 300 keys both open, WebKit drew ~40 frames a second on the Routing page: hiding the keys below row 60 alone gave back ~100 frames in 10s, so it painted every row again on each frame a magpie flew. Chromium was at 60 already. A key row now has content-visibility: auto, so one out of sight is skipped. Its height while skipped is contain-intrinsic-size: auto var(--rt-row): the last height it was drawn at, or, never drawn, the content height of a key drawn now, which layout() reads with the boxes it reads already and sets a frame later (set in the stage's own ResizeObserver, WebKit reported a loop). Rows keep their heights, so the wires to them and the list's scroll height are as before. A row a 429 hit (.hit) is drawn whole: its tag stands over its top edge, which the paint containment would cut. A WebKit without content-visibility or checkVisibility draws every row as before. Run at this head (rebased on origin/main |
||
|
|
c888ef2725 |
routing: a rule's hours are kept in the zone they were set in (gaubeebangeel on X)
magpie on a cloud server in UTC read a routing group's rule hours on the
server's clock, so a Beijing user's 09:00-18:00 held at 17:00-02:00
Beijing time, with nothing saying so.
- provider.TimeWindow carries the IANA zone its hours were set in
("zone": "Asia/Shanghai", omitempty). Holds reads From, To and Days in
that zone (time.LoadLocation, cached; Go's embedded tzdata, so Windows
knows them too). A window with no zone, every one saved before this,
stays on magpie's own clock (time.Local) as before. A zone magpie
doesn't know is refused on save (clean); one in a file edited by hand
makes the window never hold, so the rule is as if absent, never always
on and never hours off. Text() adds " (Zone)"; Line() writes tz=.
- GUI: changing a rule's hours or days in the editor saves the browser's
zone (Intl resolvedOptions().timeZone); hours left alone keep theirs.
/api/groups gives magpie's clock (clock: zone, offset in seconds), and
when its offset differs from the hours' zone the Routing page tells the
zone beside them, on the group's rules and in the editor: "Asia/Shanghai
time" (zh "Asia/Shanghai 时间"), or "server time, UTC+0" (zh "服务器时间
UTC+0") for hours with no zone. Nothing is added when the clocks agree.
zh, zh-TW, ja, de.
- CLI and TUI: time=09:00-18:00@Asia/Shanghai or tz=Asia/Shanghai; with
none, this computer's zone ($TZ, time.Local, the /etc/localtime link)
when it has an IANA name, otherwise none (magpie's clock). An unknown
zone is refused with what one looks like; tz= alone needs time= or
days=. Usage text updated.
- docs/subsystems/gateway-routing.md: the zone rules.
Older magpie reading a shared or synced group ignores zone and reads the
hours on its own clock, as before.
Run in a sandbox HOME with pinned Go caches, first at base
|
||
|
|
b5a78fd8b5 |
routing: a group's rules are dragged into order
monkeyin_92 on X: "希望可以上下拖动规则". Rules are checked top first, so
their order matters, and it could only be changed a place at a time from
each rule's ⋯ menu (Move up / Move down).
A rule's number is now its handle, as a model's number is in the same
editor (memberHandle): drag it up or down (the shared dragRows, which
the members, groups and agents use), or focus it and press Alt+↑/↓. The
rules are renumbered at once and the keyboard stays on the moved rule's
handle. The grip beside the number shows only on hover, while dragging,
or from the keyboard; the dragged rule is lifted with a card background
and shadow, no coloured border. Move up and Move down stay under ⋯ and
now go through the same moveRule. Saved as the group's rules in their
new order. "Move rule {n}" in zh, zh-TW, ja and de; the title reuses
"Drag to reorder · Alt+↑/↓ to move".
Run at this head:
- routing-rule-drag.test.cjs (new), chromium and webkit, en, zh, zh-TW,
ja, de: 10 of 10. It checks the handles and their names, the grip hidden
away from the row and shown on hover, a drag of rule 3 above rule 1
with nothing opened by the drag's click, Alt+↓/↑ (past the end too)
with focus kept, ⋯ Move down, the page not moved, and the saved rules'
order with their conditions. Red on the parent (no .rt-rhandle): 10 of
10 in the parent's full run.
- GUI: every routing-*.test.cjs plus i18n-keys, click-scroll and
group-member-drag, both engines: 1321 pass, 55 red, all in files red the
same on origin/main
|
||
|
|
f99d27abc2 |
routing: a rule names several models, tried in order
monkeyin_92 on X: "can a rule take several models? Otherwise one rule
with several models is several rules." A rule now takes more than one
model (Rule.More after Rule.Use; `more` in the group's JSON, use=a,b
typed). They go first in that order: when the first fails or rests the
rule's next takes the request, ahead of the models the later matching
rules name and the group's others.
Every reader of Rule.Use goes through Uses/SetUses/MapUses/Without/Names
in grouprule.go:
- cleanRules: each must be the group's, each named once; a pause names one.
- gateway: ruleFor's turn hold, tool rounds and outgrown turns, compaction
(the rule's first that takes the summary, the others in Small),
ruleMembers/ruleOver/applyRule, nestedRules and ruleLed (the one a
nested group's turn stays on), modelRuled, ruleEffort (useEffort asked
of each), ThenUses (leaves out all of the rule's own). RuleHit.More is
in the trace; Instead from More has Unready false, one from a later
rule Unready true, as before.
- ruledEntry: what the group takes is what every one of them takes.
- provider rename, auto/ refs, groupfast, a member's removal (a rule
goes with its last), ShareGroup and its import (one this magpie hasn't
is left out of the rule).
- CLI `group rule add use=a,b` and its listing; `group models-=` keeps a
rule's other models. The TUI shows them joined and keeps the rule when
one is deleted.
- GUI (plugins/routing): a chip per model, a + for the next one, an ×
on each while there is more than one, a chip picks another in its place
(app menu, no native select); the card's tooltip and the trace's why
("…so c/mini, which the rule names after it, goes first"), nested too;
en, zh, zh-TW, ja, de.
Old data: a rule of one model writes no `more`, so groups saved before
read and save unchanged (TestRuleMoreOnDisk). An older magpie reads `use`
alone: its requests go to the first model, the others are plain group
members in group order; if it saves the group, `more` is dropped.
Tests: TestRuleSeveralModelsInOrder, TestRuleEffortReachesTheRulesNextModel,
TestRuleCompactPassesOverTheRulesSmallModel (gateway); TestCleanRulesSeveralModels,
TestRuleMoreOnDisk, TestRuleWithout, TestParseRuleSeveralModels,
TestThenUsesLeavesOutTheRulesOwn, TestRuledEntrySeveralModels,
TestSharedGroupRuleSeveralModels, TestRuleMoreRenamedAndKept (provider);
TestGroupRuleSeveralModelsCmd (cli); TestGroupTakeOutKeepsARulesOtherModels
(tui); routing-rule-models.test.cjs. Broken by hand: ruleMembers on Use
alone turns the first two gateway tests red.
Run at this head:
- gofmt -l clean; go vet -tags nogui clean with GOOS=linux and GOOS=windows
for provider, gateway, cli, tui.
- go test -tags nogui -timeout 45m: internal/provider, internal/cli,
internal/tui ok; internal/gateway ok (384s); the new gateway tests
again after; internal/gui budgets ok.
- GUI: every routing-*.test.cjs plus i18n-keys, click-scroll and
group-member-drag, chromium and webkit (en, zh, zh-TW, ja, de where the
file has them): 1319 pass, 57 red. routing-rule-models passes in both.
The reds are in files that are red the same on origin/main
|