e6bed2f0638cb4e2bfbb96f3ba001600718fd600
88
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
e00fbdbbc7 |
usage: times and days follow the viewer's time zone, not the server's (Outvi V, Discord)
Outvi V reads a remote magpie through `magpie web`. The Usage page
bucketed calls by the server's days and hours, so a call at 9:00 in
UTC+8 showed under 1:00.
What changed:
- The Usage page (plugins/usage/page.js) names its browser's IANA zone
in ?tz= on /api/usage, /api/usage/requests, /api/usage/heatmap, the
CSV link and the export.
- usage.Zone turns the name into one cached *time.Location per name, so
a Filter holding it stays a comparable cache key. An empty or unknown
name, or a zone that keeps this computer's clock, is time.Local, so
the desktop page, the tray and the TUI see no change and share caches.
- Filter.Zone carries the zone. Today/7d/30d, the chart's hour and day
buckets and labels, the Day filter and the heatmap's days are all
read in it (Clock().In(zone)). The summary cache is keyed by period
and zone, and the request-page cache by the reader's date.
- Shared days from other computers are read with a 2-day margin, not
1, since two zones can be 26h apart.
- Limit and quota resets are unchanged. The gateway's
/v1/magpie/usage stays on the computer's zone.
Run at
|
||
|
|
e435b88670 |
usage: nothing under the Requests table's scrollbar at the window's foot
碳碳双键 on Discord #general (10-23, macOS app): on Usage → Requests a wide table showed a strip of the page under its horizontal scrollbar, between the bar and the bottom of the window. Cause: the bar under the table (#ledHScroll, #799) is position: sticky, bottom: 0 inside the view. A sticky box keeps clear of its scroller's padding in both engines, so it stood the view's bottom padding (8px in the window, 4px in the panel, 12px in a phone browser) above the view's visible bottom, and the table's card and cells showed through the strip under it. Measured on |
||
|
|
ed71fa774d |
routing: the last request's story shrinks back on a busy gateway too (shensmart on Discord)
shensmart on Discord (a remote magpie, the page in a local browser): the room under "How the last request was routed" grew with use and, once stretched, never shrank back. Cause (internal/gui/assets/plugins/routing/client.js, holdStory): the story is held at the tallest of the last STORY_HELD requests so the page doesn't jump between requests (dumplings' jitter, routing-ctx-still), and |
||
|
|
398803e3f5 |
gateway: a model slow to start again and again rests on its account (小八)
小八 on Discord (2026-10-23): a WorkBuddy plugin account answered magpie's
own 504 "no first token in 30s" 58 times on kimi-k3-1 and glm-5.3 (the
vendor's per-model token limit, which it never names, it just stalls).
The group went on each time, then asked the same account first on the
next request: 15 slow starts in 17 minutes in one session.
Cause: gateway.go's hw.slow branch (the group's FirstToken let a member
go) never rested anything, by design ("a long prompt being slow to start
anywhere"), and nothing counted slow starts. So every request waited out
the whole FirstToken on the stalled member before falling back.
Now restSlow (routing.go) counts slow starts per restID (provider,
account or key, model). Once rests nothing, as before. The second in a
row, within slowForget (30m) of the last, rests that model on that
account: 1 minute, doubling each time after, capped by the provider's
RestCapOr(longestRetry), never for a provider whose rest cap is off. An
answer clears the count (servedCandidate). A client-cancelled request
never reaches the slow branch, so it counts nothing. A longer rest
already there is kept. The rest carries Rest.Model, so the Routing page
shows it on that model's rows only. The Routing story of a rested slow
try says so, and the group editor's slow-to-start hint no longer says
"It doesn't rest" (en, zh, zh-TW, ja, de).
Tests: TestSlowStartsRestTheModelOnItsAccount (once: no rest; an answer
in between restarts the count; twice: the model rests on k1 with Key
a#k1/m, Model m, under a minute; k1's whole key and k2/m don't rest; the
next request asks k2/m first; a/n still goes to k1; a third slow start
backs off longer; an answer ends it). TestCanceledSlowStartRestsNothing
(three client cancels during the first-token wait: no rest, no count).
routing-went-on.test.cjs gains a rested slow try in five languages;
group-first-token.test.cjs's i18n list has the new strings.
Broken by hand: restSlow's result ignored in gateway.go -> the first test
red at "twice in a row" (Rest nil); servedCandidate not clearing
routed.slow -> red at "an answer in between starts the count again";
restSlow called in the cancel branch -> the cancel test red at "cancel
2: k1/m wasn't asked (rested?)". All restored, green.
Run at the worktree on base
|
||
|
|
032d88c132 |
gui: the Japanese for a WSL distro that isn't running names it once
|
||
|
|
4f6498f822 |
routing, usage: an account renamed in magpie reads by its new name (magpie-community/plugins#310, molvqingtai)
molvqingtai renamed a Kiro (plugin) account from "example@gmail.com (foo)" to "example@gmail.com (bar)", and the Routing page kept saying "(foo)" on every request made after. Cause: the Routing page never looked up the user's name at all. A trace's `who` is the vendor's account name (Weighed.Who), and plugins/routing/client.js showed it as it was. Usage records (ProviderAccount) keep the vendor's name the same way, and the Usage page's Accounts, the request log's Account filter, `magpie usage`, a gateway key's accounts (AccountNames, /api/caller-keys) and Routing's "Several accounts" pools (onOf) all showed it raw too. This affected built-in and plugin providers alike. Records still keep the vendor's name. It is the key the user's name is stored under (providers.json AccountNames, in lower case), so it stays the identity: Routing still groups and ranks by `who`. The name is looked up when it is shown: provider.AccountShown / AccountShownOf / AccountRef.Shown in Go, and userShown (accountNameOf over /api/providers' accountNames) on the Routing page. So requests from before the rename read by the current name too, and a cleared name goes back to the vendor's. A key's name and an unnamed account read as before. Already right before this change: quota cards and the menu bar (Alias), `magpie accounts`, and the editor's account row. Record for this push: 13 commits on origin/main |
||
|
|
0455b92792 |
routing: the last request's story shrinks back after a long one (夜松云 on Discord)
夜松云 on Discord: on the Routing page, live, the "How the last request
was routed" box grew when a request was handed on through many members
and never shrank back.
What changed (internal/gui/assets/plugins/routing/client.js, holdStory):
the box was held at the tallest height seen since the reader began
following live. It is now held at the tallest of the last three answered
requests (STORY_HELD), each kept by its id. So the box still doesn't jump
from one request to the next (dumplings' jitter, routing-ctx-still), and
it shrinks back once three shorter ones have come after a long one. A
ResizeObserver change (a font coming in) measures it again as it is.
Guarded by internal/gui/tests/routing-story-shrinks.test.cjs: a request
handed on four times, then short ones. The box keeps its height for the
next two and shrinks at the third. en at 1100px and zh at 420px, both
engines.
Broken by hand: client.js put back to its base gives 0/6 ("the box shrank
back after the long request: 247.5 vs 247.5 (min-height 247.5px)").
Record for this push: 13 commits on origin/main
|
||
|
|
f050818f71 |
usage: every request on the Requests tab says its speed, or why it has none (夜松云 on Discord)
夜松云 on Discord: the Requests tab's Speed column was blank for some rows
and not others, with nothing saying why.
What changed (internal/gui/assets/plugins/usage/page.js, i18n.js):
- A gateway call with no speed of its own now tells the least it wrote at,
as a "≥" floor, the way a session file's call already did: one that
reasoned with no first text recorded (a tool call after hidden
reasoning) its answer tokens over the time after its first token,
unless the content came in a burst; else one not streamed or not timed,
its output over its whole time, by the same 1,000-token rule. The
tooltip says which floor it is and why it is only a floor. The
request's detail sheet (the other caller of ledFloorSpeed) shows the
same floor. The period's speed KPI is unchanged: it never counts a
gateway floor.
- A dash that is left always has a tooltip saying why (ledNoSpeed_):
failed, no duration, no output, not streamed / no first token, all
reasoning, too little after the first token, or let go in one burst.
- Eight new strings with zh, zh-TW, ja and de.
- reasoning-speed and usage-session-speed now expect the floor on the
rows that showed a dash before (reasoning then tool calls only: ≥100;
not streamed: ≥500).
Guarded by internal/gui/tests/usage-speed-every-row.test.cjs (rows shaped
as real usage.jsonl gateway rows, en and zh, both engines).
Broken by hand:
- page.js put back to its base: usage-speed-every-row 0/6 pass ("row 2's
dash says why").
- Only the gateway floors off (ledFloor_ returns null for a gateway row):
0/3 in Chromium.
Record for this push: 13 commits on origin/main
|
||
|
|
c417b1f4e3 |
library: a skill removed from its source is said so, and every such skill goes in one click, asked first
スライム on Discord (#help, 10-22): taste-skills took some of its skills
out, Update all reported each of them as a failure, and the only way
out was to delete them one by one.
An update or a check that reads the source whole and finds the skill's
folder (or its SKILL.md) gone now calls it removed upstream, not a
failure. GitHub tarballs and other git repositories both work this way.
- UpdateSkill returns *GoneError.
- UpdateSkills and UpdateSomeSkills list it in Result.Gone, not
Unupdated.
- A check gives status "gone".
- Each marks Skill.Gone. The mark is cleared when a check or an update
finds the skill there again.
- A fetch that failed, a skill left out of a fetch as too big, and a
folder that can't be read stay unknown, never gone (goneFrom).
Nothing is deleted by itself. RemoveGoneSkills takes the named skills
out, or every marked one when none are named, through RemoveSkills, so
the folders go to the backups. A skill found in its source again is
kept and said so.
- GUI: a "Removed upstream" tag replaces Update available and the
update icon. Update all says gone skills apart from failures. "Clean
up N" sits in the group heading, or in the bar when there is one
group, and opens a sheet naming each skill. One changed here carries
"Changed here". Strings are in en, zh, zh-TW, ja and de.
- CLI: `magpie library skill rm --gone [--yes]` asks at a terminal and
refuses without --yes otherwise. It names the ones changed here.
update and status print the hint.
- TUI: the row says "removed from <repo> · d takes it out".
- API: POST /api/library/skills/remove-gone {names}.
- Docs: the Skill updates row and Verification in
docs/subsystems/library.md.
Record for this push: 13 commits on origin/main
|
||
|
|
c2636b7b5b |
library: an MCP command given to agents in WSL is checked in their distro
loong on Discord, Windows host with agents in WSL: a stdio server whose
command is a WSL program (`node /home/loong/tools/xxx.js`), given only to
WSL agents, showed "exited (1) … Node.js v24.9.0" on the Library's MCP
page. The check started it on Windows, where his agents never do; a
sibling written as `wsl -d Ubuntu … node …` checked fine.
What changed:
- checkSides (mcp_check_wsl.go) reads each agent id's `@wsl:<distro>`.
No WSL agent, not Windows, a Windows path for the command
(windowsPath: magpie's own image server, `C:/x/npx.cmd`) or Settings'
Detect agents in WSL off: this computer, as before. Otherwise each
distro is a side, after this computer when an agent here has it too.
- In a distro the command is found as the agents' shell finds it
(new wslrun.In: the same login-then-interactive probe Find uses, so
nvm's node is found; cached for findAge) and started through
wslrun.Tool.Command, the existing `wsl.exe -d D --exec /usr/bin/env
PATH=… MAGPIE_WSL_RUN=… <path> args` path, so no new quoting. Its
env goes over WSLENV (Tool.Env); its Cancel stops the run inside the
distro.
- A distro that isn't running is never started for a check: Why
"wsldown", naming it, painted as not checked (ring), like novar.
Beside a side that was checked it is left out.
- Mixed: each side in turn, the first failure ends it. ServerHealth
gains Checked (where it started, "" for this computer); the row says
" · WSL Ubuntu" / " · Windows" on a failure, the tooltip "Failed in" /
"Checked in". New strings in zh, zh-TW, ja, de.
- healthKey (Go and client.js) includes the sides, so agents moving into
WSL is a check anew.
- docs/subsystems/library.md says all this.
Tests:
- TestCheckWSLOnlyServerInItsDistro: ok in Ubuntu with the exact wsl.exe
argv; a stopped Arch is wsldown with no probe and no run; a command
the distro lacks is notfound there.
- TestCheckWindowsServerHere: a Windows-only server checked here, WSL
never asked; Windows-path commands stay here.
- TestCheckMixedServerEachSide: ok in both; WSL exit named Ubuntu's;
Windows failure stops before WSL; stopped distro = checked here only;
healthKey differs when agents move into WSL.
All force wslrun.On and fake wsl.exe (Run) and the distro run
(wslCommand runs this test binary as the fake server).
- library-mcp-health-wsl.test.cjs: chromium + webkit, en/zh/zh-TW/ja/de.
Broken by hand, each red:
- checkSides always this computer: WSLOnly and Mixed red.
- windowsPath exemption removed: WindowsServerHere red.
- mixed drops this computer: Mixed red.
- healthKey without sides: Mixed red.
- stopped distro reported as a failure: WSLOnly and Mixed red.
- client.js without the " · <place>" on a failure: the GUI test 12 of 12 red.
Run:
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows ok.
- GUI: the 94 library-*/mcp-*/i18n-* files, both engines: 780 of 783;
library-loading (webkit) and library-pick-remove (chromium zh-TW) red at
--test-concurrency=4, load ~45, pass alone 3 of 3; filed #3300, #3299.
- Full suite at 3831de1a3 (base
|
||
|
|
8c68b6802a |
gui: time to first token reads 首字耗时 in Chinese, not 首响 (Outvi V)
Outvi V on Discord: "首响 2.7 秒" makes a reader stop and decode it.
The rest of the GUI already says 首字 for the first token (首字平均,
厂商首字等待, 没有首字时间), so 首响 was the odd one out. The label
(First token, TTFT) now reads 首字耗时 / 首字耗時 beside 耗时, the
Routing step reads "{ms} 后出首字", and the other mentions say 首字. zh
and zh-TW both; ja, de and en are unchanged.
routing-request-metrics checked that 首字 was gone from Routing's steps;
that guarded a since-removed "first text in {ms}" string (
|
||
|
|
3a213e1dc1 |
routing: a waiting row's dot keeps its whole glow (#2553, dumplings)
The Routing request row's target cell (.rt-req .to) clips with
overflow:hidden, and the waiting dot's 6px glow sat flush against its
left edge, so the glow was cut on the left (and a pixel above and
below). The cell now has 6px of padding on its left and 1px above and
below, given back with a negative margin, so the glow fits inside the
clip and nothing in the row moves.
Run at
|
||
|
|
39e5964353 |
routing: an error that may pass reads 暂时性错误 in Chinese, not 会过去的错误 (Outvi V)
The group's "Every member busy" hint and the two Routing lines that say a group or a lone member is asked again called the error "会过去的那种", "以会过去的错误失败了" and "此类失败可能很快恢复": hard to read, and three words for one thing. zh now says 暂时性错误 in all three, zh-TW 暫時性錯誤. ja already said 一時的なエラー / 一時的な失敗 and stays; de's lone-member line said "ein Fehler, der vorübergehen kann" beside "vorübergehender Fehler" in the other two, and now says the latter too. English is unchanged. git grep for "may pass" finds no other string, in Go or the GUI, with this term. group-patience.test.cjs checks the three strings name 暂时性错误 (zh) and 暫時性錯誤 (zh-TW). With the old i18n.js put back it fails, listing the three zh strings; with the change, 4 of 4 pass (Chromium, WebKit, en and zh). Not tried: the strings in the real app; only Playwright's Chromium and WebKit. Run for this batch of seven commits (devin, routing zh, qoder, masked words any case, Long conversations, Claude subagents, user-select), in a worktree, sandbox HOME, never against live configs: - At e352cc823 (tree ea497c9f5, on origin/main |
||
|
|
b00c82acfa |
masking: each kind is masked, sent with a warning or held back; a Never mask list and Try it (#1977)
Settings › Privacy gets two sections under What to mask:
- When a value is found: Mask, Warn or Block per kind (redactActions;
a kind left out is masked). Warn sends the value as written and records
it with a placeholder nobody remembers, not counted as masked. Block
masks it as before and the gateway answers 400 naming the kind and the
value's hint, never the value, with nothing sent (maskBlocked); the
record is kept as Blocked. The secret kinds come first, the personal
ones behind Show all kinds. A Never mask list (redactAllow) lets a whole
value go as written in any case; a longer value it is part of is masked.
- Try it: POST /api/masking/preview masks a text as a request would
(redact.Preview) and remembers nothing: no placeholder stands for it
afterwards and its values aren't masked later as seen before. The page
shows the vendor's text, what was found and what would be done, and
keeps the text in no storage.
The masking card counts requests held back and values sent as written; a
call whose values only went as written gets an amber badge on Recent calls
and the Routing log. zh, zh-TW, ja and de throughout. Docs: gateway-routing
and gui-shell.
Broken by hand: the new GUI badge assertion fails on the old maskedBadge
(no .warn badge drawn); TestSettingsSaveKeepsWhatItDoesNotSend went red
until the two settings were in its fixture; "{n} held back" turned
i18n-keys red against the routing plugin's "{n} held" and was renamed.
Run at this tree (base origin/main
|
||
|
|
b3f5953495 |
routing: an open group's heading looks as every editor's does, not as the Models fold chip
The owner, 10-21: on an opened routing group the heading's space above
differed from below, and its line curved at the ends. The heading had
the class .fold to fold back into its row, and .fold is the Models
head's chip: padding 3px 6px 3px 4px, a 6px radius, the faint colour and
a pill background on hover. On the heading that gave 3px above against
8px below, rounded ends on its bottom line, a dimmed name and a box over
it on hover. It now has its own class (folds), which keeps the pointer
and adds a focus ring; the layout is .editor .ehead's, as on every
other editor.
Run on origin/main
|
||
|
|
0eb5cbe81a |
routing: the live view and Usage's Requested name a found group auto/<model>, not group/auto-<model> (未寒 on Discord)
Reported: 未寒 picked auto/claude-opus-5-5, and the Routing live view and
Usage's Requested column named it group/auto-claude-opus-5-5, an internal
id that agents never see.
Changed:
- internal/gateway/trace.go: GroupRef and SubGroup carry Ref
(Group.Ref(), the id agents pick the group by).
- internal/gui/trace.go: publicRoute rewrites a route's Model,
For.Model, Subagent.Asked/To and the group's and subs' Ref through
provider.PublicRef (memoised per answer). It copies the pointers
before writing, so the gateway's trace is left as it was.
- internal/gui/context.go: the Context page's model too.
- internal/usageapi/usageapi.go: the ledger page's Requested.
- routing/client.js: useName falls back to a sub's ref.
Test: TestRoutesNameFoundGroupsByTheirPublicID
(internal/gui/trace_publicref_test.go). Broken by hand, each one red:
- publicRoute made a no-op: red on model, group, subagent, For, Subs
and route.
- usageapi mapping removed: `the ledger's Requested:
["group/auto-claude-opus-5-5" "group/mine"]`.
- contextRoutes mapping removed: `the Context page's model:
"group/auto-claude-opus-5-5:high"`.
- Ref dropped from gateway/trace.go alone stays green, as expected:
publicRoute fills an empty Ref.
Not covered: the ledger's text search (usage.Filter.Query) still matches
the stored group/auto-… form, not the shown auto/… (package usage can't
import provider). client.js's ref fallback has no GUI test of its own.
Run, go1.26.8 darwin/arm64, sandbox HOME, private GOCACHE:
At this stack on origin/main
|
||
|
|
df6bd3efec |
routing: out of sight the page stops asking for the trace, and a waiting trace read gathers a burst of changes into one answer
The Routing page (and the tray panel's Routing tab) read /api/gateway/trace in a loop for as long as magpie ran, in sight or not. The read was already a long-poll, but each change woke it: a request's way is told in a burst (begun, a try sent, answered, its usage), so under traffic every open page was answered 4-8 times a second, hidden pages included, for nothing they drew. Server (internal/gateway/trace.go): once a change wakes a waiting Trace, it gathers for traceGather (250ms) before answering, so a burst is one answer; a read with nothing new still blocks until a change or the 25s wait. Every answer now also lists the ids of all the routes the trace keeps (TraceState.IDs, "ids"), changed or not; OwnerTrace passes them through from another magpie serving the gateway. Client (plugins/routing/client.js): after its first answer, poll() asks only while the page or the panel's Routing tab is in sight (document not hidden, and the view shown or the panel's tab picked). Out of sight it parks; start() (visibilitychange, focus, the view's hidden attribute) and panelRoutingShown resume it. The first answer after a resume is a catch-up: what came meanwhile is listed, and only the requests still under way fly (stage and panel), as #302 asks. A route last heard of as under way that is missing from "ids" (it ended and was trimmed while the page was away) is dropped, so it can't show as live forever. An answer with no "ids" (an older magpie) leaves the routes as before. Measured: - Hidden page, 2s with a request every 80ms (routing-hidden-stage, panel-routing-hidden): before, the trace was read 24-25 times in 2s by each of the main window (another page picked, or the window hidden) and the hidden tray panel; after, 0 times. - A burst of 4 changes 20ms apart (TestTraceWaitHearsABurstOnce): before, read in 4 answers; after, 1. Tests: - TestTraceWaitHearsABurstOnce (gateway, new): a waiting read answers a burst once, with all of it and the route's id in IDs. Broken by hand: no gather -> "a burst of 4 changes was read in 4 answers, want 1"; no ids -> "ids [], want [<id>]". - routing-hidden-stage and panel-routing-hidden now assert the page reads the trace at most once out of sight (was: at least 20), and shows the newest request once back. The mock is a clock-driven gateway (every change since `after`, at once). With the old client.js all 12 went red: "the trace was read 24/25 times out of sight", "... while hidden". - routing-busy and routing-flood's mocks answered one route per read; the gateway answers every change since `after`, so they do too now. routing-purpose-state sent one update while another page was shown and required a new read to start out there; that send no longer waits for one. Run at this commit's tree (go1.26.8 darwin/arm64, sandbox HOME): gofmt -l .: nothing GOOS=linux go vet -tags nogui ./...: ok GOOS=windows go vet -tags nogui ./...: ok go test -tags nogui ./internal/gateway ./internal/gui: ok go test -tags nogui -race -timeout 45m ./internal/gateway ./internal/gui: ok (gateway 1598s, gui 348s) set -o pipefail; go test -tags nogui -timeout 45m ./...: ok, every package (66 ok, 20 with no test files) GUI, playwright 1.62.0, chromium and webkit, every routing*.test.cjs and panel-routing*.test.cjs (97 files, 1204 tests, concurrency 4): 1203 pass, 1 red: routing-rule-remove "chromium en 390: a rule's ... is there to remove it" (routing-rule-remove.test.cjs:158, "1 !== 0", the rule count read right after a keyboard Enter). Its trace mock never answers a wait, so its polling is the same before and after this change; alone it passed 3 runs of 3 (60/60). The whole GUI suite (822 files) was still running when this was written. |
||
|
|
f21dd99f5a |
privacy: every masking is recorded, and Settings › Privacy shows it
What was masked is now kept, so the user can see it. Settings › Privacy opens on a summary card: how many values were kept from vendors over 1, 7 or 30 days, by kind, by finder (rules, your words, the local model, known values) and by where they went, with a day strip. The page is grouped into What to mask, How it's found (rules and the local model are layers, not a toggle: the model adds names and addresses rules can't see) and Sharing. A records view lists each masked request: its kinds, finders, placeholders and, while magpie runs, the line around each value. Gateway › Recent calls and the Routing log carry a masked-N badge that opens the record. Originals never go to disk. internal/maskrec writes day files under ~/.config/magpie/masking (0600, 30 days, 100MB at most) holding kinds, finders, placeholders, a first character or key prefix and a length. The lines around values are kept in memory for the last 400 records only, and /api/masking/value answers only while the masker remembers a placeholder. Nothing is written under MAGPIE_TEST_SANDBOX. A masker says what it masked through gwmw.Teller (JSONHits, TextHits, Value); a plugin masker that doesn't is counted only, so older redact plugins keep working. Every route that masks notes it: chat, Responses, Codex backend and search, embeddings, images, video, transcription, decide and the search MCP query. Masking still fails closed: a masker that panics on any path refuses the request (TestMaskingOnAndOff's fake now panics on JSONHits and TextHits too, since the gateway asks a Teller through those). app.js grows to 1,314,432 bytes, so its budget rises to 1,335,000 and the core's to 1,528,800 (+1.5%): Settings is the core's own page. Run at this head (rebased on origin/main |
||
|
|
a4f9f0b96e |
routing: a request of an agent the stage leaves out is listed, not flown
The stage draws at most four agents (staged's slice(-4)), but poll plays every request under way. A fifth agent's request reached play with no drawn agent, and `tick(A.node)` threw "Cannot read properties of undefined (reading 'node')" for each one: about 85 a minute under mixed traffic, found while measuring the hidden-page growth (14f57e028). play's finally cleaned up after it, so nothing was kept, but every such request was an uncaught error. play now returns before making its dot when the agent isn't on the stage, and lets go of its playing mark. Test: routing-fifth-agent.test.cjs, six agents taking turns at a request every 80 ms, chromium and webkit, en and zh. Without the change 4 of 4 red with the error above (20+ times each run); with it 4 of 4 green. routing-fifth-agent, routing-hidden-stage and routing-idle-frame together: 21 pass, 0 fail. |
||
|
|
e8ab1333be |
routing: out of sight, the page builds nothing for each request (#2515, #2513)
The Routing plugin's poll called sync() and empty() on every trace update, and loadDays, the session-name refresh and "magpie-costs-changed" called renderHist(), whether or not the page was in sight. So on every page, in the tray panel and in a hidden window, each request put up the Routing stage again (agent nodes, account rows, wires) and its request list. In a hidden window no frame is drawn and the document timeline stands still, so the entrance and live animations (rtin on li.new, rtlive on the live dot, rttick) on each replaced node stayed on it and held the node: the same class as |
||
|
|
9d78a95ef8 |
routing: a flight's arc is laid again only when its ends move, and account names are read from answers without Object.entries (#1481)
Two smaller sources of the Routing page's steady garbage were left once the rows were kept. Both were measured with CDP sampled allocation at one request a second: - via's j laid the arc through magpie on every frame of a flight: a new path string and its control points sixty times a second, though its ends had not moved. It now keeps the ends it laid and returns when they are the same. That path was 10-13 MB/min and is now ~5. - noteAccounts walks every API answer (Routing's trace once a second) to learn account names for Hide accounts. Object.entries made an array for each object and one for each key, ~7-8 MB/min on Routing. It now walks with for...in and Object.hasOwn, so the same keys are visited. Routing ~100 -> ~86 MB/min (from ~149 before the previous commit). As with the previous commit, the WebKit WebContent footprint did not change in a 12-minute A/B (119 -> 260 MB before, 117 -> 257 MB after). Test: routing-steady-garbage.test.cjs, in chromium and webkit, en and zh. It counts the arc's d writes against the frames drawn while a request flies, and counts Object.entries calls while noteAccounts reads 50 routes. It also checks that all 50 accounts are still found. On HEAD's client.js the arc was laid 32 of 41 frames, and on HEAD's app.js Object.entries ran 201 times: both red. Run: the 117 GUI files these changes reach (routing-*, panel-routing*, and every file that drives the Routing page or noteAccounts), chromium and webkit, their languages and widths, at concurrency 4 on a machine at load average 500-860 from other sessions: 1520 tests, 1402 pass, 118 fail. Of the 118, 74 are page.goto timeouts and most of the rest locator timeouts. The 37 red files were run again at concurrency 2: 726 tests, 45 fail. The four files red each time were run with HEAD's app.js and client.js (these changes taken out) and are red there the same way: group-new-head (4 of 4), routing-bodies (10 of 10), routing-keys-fold (8) and routing-model-rest (load-dependent, 4 to 12). On origin/main d9c6a60d8's GUI tree routing-bodies and routing-keys-fold are red too; group-new-head passes there and goes red with 4b000ecc2 (its rowClock throws "Invalid time value" on a route with no time), which is on this branch and not part of this change. routing-request-metrics fails waiting for the metric menu's Cost item on this tree (3 of 4 alone), on HEAD (4 of 4) and on origin/main (2 of 4). The other reds were page.goto or locator timeouts under this load. The two new files passed 4 of 4 each in the full run. No Go changed. Not tried: real WebView2 on Windows, and the real macOS app. |
||
|
|
da058fc995 |
routing: a request's row is worked out once for each route the trace sends, not again on every update (#1481)
A trace update replaces only the routes that changed (poll's routes.set), yet every update worked out every row in sight again: outcome, requestMetrics with tokenBreakdown, reqTitle and the JSON signature. That made the Routing page the one view whose JS garbage was an order above the others. Measured with CDP sampled allocation (collected objects included) on a sandbox magpie at one request a second, 30s per view: Agents 10, Providers 12.7, Usage 9.3, Sessions 7, Library 8.8, Plugins 10.4 MB/min, and Routing 143-157 MB/min. Chromium's post-GC heap stayed near 10 MB throughout, so this is churn, not a leak: it costs collector work and gives the engines' allocators more to hold on to. rowSays keeps what a row says in a WeakMap by route object. It is worked out again only for a new route, or when the language, the metrics shown, the agent's name or icon, or the cost's wording (currency) changes. The selection stays outside it. Measured: Routing ~149 -> ~100 MB/min with this alone. What this does not fix: the WebKit WebContent footprint. A 12-minute A/B on Playwright's WebKit (footprint -p, one request a second, Routing open) went 119 -> 260 MB before these changes and 117 -> 257 MB after both commits. Agents in the same run grew ~4 MB/min, Routing ~8 MB/min, and nearly all of it is in footprint's "WebKit malloc" category, not the JS heap (Chromium's heap and DOM node counts stay flat). Its cause is still unknown. Readings near 1 GB taken earlier were inflated by the method (a 400 MB marker array used to find the pid) and are not quoted here. Test: routing-row-reuse.test.cjs counts the token breakdowns worked out while three requests come in over forty listed, in chromium and webkit, en and zh. It also checks that a request answered after it was under way redraws its row, and that a new language redraws the rows. On HEAD's client.js it is red: 295 breakdowns where now there are at most a few. Run: the 117 GUI files these changes reach (routing-*, panel-routing*, and every file that drives the Routing page or noteAccounts), chromium and webkit, their languages and widths, at concurrency 4 on a machine at load average 500-860 from other sessions: 1520 tests, 1402 pass, 118 fail. Of the 118, 74 are page.goto timeouts and most of the rest locator timeouts. The 37 red files were run again at concurrency 2: 726 tests, 45 fail. The four files red each time were run with HEAD's app.js and client.js (these changes taken out) and are red there the same way: group-new-head (4 of 4), routing-bodies (10 of 10), routing-keys-fold (8) and routing-model-rest (load-dependent, 4 to 12). On origin/main d9c6a60d8's GUI tree routing-bodies and routing-keys-fold are red too; group-new-head passes there and goes red with 4b000ecc2 (its rowClock throws "Invalid time value" on a route with no time), which is on this branch and not part of this change. routing-request-metrics fails waiting for the metric menu's Cost item on this tree (3 of 4 alone), on HEAD (4 of 4) and on origin/main (2 of 4). The other reds were page.goto or locator timeouts under this load. The two new files passed 4 of 4 each in the full run. No Go changed. Not tried: real WebView2 on Windows, and the real macOS app's WebContent. The numbers are from Playwright's WebKit build and Chromium. |
||
|
|
92cb1f03a5 |
routing: a request whose time isn't a date draws its row with no time, not an error
28e3378c3 (#2524) formats a row's time with one Intl.DateTimeFormat. Its
format throws a RangeError on an invalid date, where the old
toLocaleTimeString said "Invalid Date", so one such request threw out of
drawList and the list wasn't drawn. group-new-head's fixture gives its
requests `at`, not `time`, and went red in all 4 cases on 28e3378c3
("Invalid time value" twice, from rowClock ← reqRow ← drawList); it is
green on origin/main
|
||
|
|
a8224019af |
routing: a day of thousands of requests draws only the rows in sight, and its numbers are measured again on a new width only (#2524)
UNscientific-9 (#2524): picking a day on Routing's request list froze the page for seconds with thousands of rows. renderLog built a row for every request of the day (~20 elements each, up to 2,000 a day) and put the new ones in among the old row by row, so both days' rows were in at once. Beside that, metaFit was run by a ResizeObserver on the column's every change of size; the meta-under mark it sets changes the column's height, which measured every row's numbers again (the reporter saw 8 runs in 8s, ~200ms each). Now: - A list of 300 or more items is windowed: only the rows in and near sight are drawn, between two aria-hidden gaps as tall as the rows above and below. A drawn row's height is measured and kept; one never drawn counts as the average. Scrolling or a resize draws the rows then in sight, once a frame, and the first row in sight stays where it was. - The columns stay as wide as before: for each shape of row not drawn (its time's digits, model and kind, its numbers), one unseen, inert zero-height probe row stays in the grid, so the auto columns size by it. The digits are tabular, so a probe stands for its shape. - A list made mostly anew (another day) is put in with one replaceChildren, not row by row among the old ones. - metaFit runs on a change of the column's width only. When it moves the numbers under or back, the list is drawn again for the new heights. - A row's clock uses one cached Intl.DateTimeFormat. Under 300 items the list is drawn whole, as before. Not done here, from the reporter's list: drawAll still runs renderHist on a static day at each poll. Measured with a live request arriving every 250ms while a 2,000-row day was shown (scratchpad dayidle.cjs, chromium, 4s): frame callbacks 330 / 211 ms total / 9 ms longest before, 90 / 52 ms / 4 ms after. A guard there would have to know every input of renderHist (now(), lifted rests, names), so it was left out. Trimming prompt.parts from the payload is on the server, not here. The renderer crash on repeated switches was not reproduced. Measured (scratchpad dswitch.cjs, 2,000 rows a day, 1280x900, five day switches each, wall ms / longest block ms, load average ~220-290): - chromium before: 379/304 454/374 452/374 474/389 427/376, rows=2000, ~39,740 elements - chromium after: 56/22 61/20 56/19 74/21 410/17, rows 17-21, ~1,520- 1,600 elements (the 410 is wall time under load; its longest block 17) - webkit before: 565/461 624/493 639/526 625/516 616/516, rows=2000 - webkit after: 117/37 95/25 93/30 128/26 138/25, rows 17-21 - same grid columns and list height after as before, in both engines: chromium "89.4375px 94.1875px 661.078px 181.297px", scrollHeight 61602; webkit "89.4375px 94.1875px 641.078125px 181.296875px", 61602 Run: - tests/routing-day-window.test.cjs (new), chromium and webkit, en zh zh-TW ja de, 1280px and 420px: 30 tests, 30 pass. It picks a 2,000-row day, checks the rows drawn are bounded and the list is as tall as all of them, scrolls to a wide model far down (columns unchanged, not cut), holds a row still across frames mid-list, reaches the last row and picks it, switches day, and goes By session to the list's foot. The second test grows the column taller three times and counts reads of the numbers' boxes: 0, and >0 on a new width. - Same test on the old assets (MAGPIE_ROUTING_ASSETS, the routing client.js/css before this change), chromium en: 3 fail, "a day of 2000 put 2000 rows in the list" (both widths) and the measure test (12000 reads, not 0). - Broken by hand: WIN_MIN 300 -> 300000 fails "a day of 2000 put 2000 rows in the list"; the width guard taken out fails "156 !== 0" in both engines. Both restored. - tests/routing-sessions.test.cjs: its 2,001-request history test now scrolls to a session's group instead of expecting all 2,001 rows in the DOM. 8 pass, 0 fail (chromium and webkit, en and zh). - routing-*.test.cjs, panel-routing*.test.cjs and every other GUI file that reads the request list (claude-auth-status, claude-subagent-tag, dates-gui-lang, click-scroll, codex-subagent-model, codex-credits, desktop-subagent-model, key-nourl, phone-rows, reasoning-speed, remote-group-served, purpose-filter, search-instead, rest-try-now, search-mcp, vision-mcp), both engines, every language, concurrency 4: 1412 tests, 1390 pass, 22 fail. 18 of those are routing-bodies, routing-keys-fold, routing-model-rest, routing-request-metrics and routing-wb-restricted, which fail the same way on the old assets (#2658, #2559). The other 4 (rest-try-now chromium en 1100 and ja 420, routing-log-icons webkit zh, routing-time-went chromium de) pass when their files run alone: 64 tests, 64 pass. Not tried: WebKitGTK and the Windows WebView2 app (where the reporter's seconds-long freeze was on Windows); the numbers above are Playwright's Chromium and WebKit on macOS. |
||
|
|
ac3a2a3df5 |
routing: the page asks for frames only while its stage moves, and the live dot pulses only while a request is under way (#2827)
zhang-4411 (#2827): under xrdp/X11 with no GPU the Routing page's web process took 459%-830% CPU. Beside compositing (27353a952), the page itself drew on every frame while nothing moved: its frame loop asked for the next frame forever once Routing was shown, and the live dot's rtlive pulse ran with no request under way. On llvmpipe each of those frames is rasterised on the CPU. Now the loop stops once nothing on the stage moves and is kicked again by what makes something move (a request arriving, a replay, the page shown again). The dot pulses (.rt-livedot.on) only while a request is live. With no request, the page asks for no frames. Measured in the GUI harness (scratchpad measure.cjs, 4s windows, Playwright on macOS, load average ~200): - chromium, Routing idle: before 70 ms CPU/s, 60.3 rAF/s, 1 running animation (rtlive); after 4 ms CPU/s, 0 rAF/s, 0 animations - webkit, Routing idle: before 62 rAF/s, 1 animation; after 0 rAF/s, 0 animations (WebKit's per-process CPU reading was negative under this load, so only frames are given) - Routing busy (requests moving) is unchanged: chromium 176 -> 186 ms CPU/s, ~64 rAF/s both Run: - tests/routing-idle-frame.test.cjs (webkit, en and zh, as the file runs): 9 pass 0 fail. It now also counts the frames asked for with nothing moving and checks the dot's animation; MAGPIE_ROUTING_ASSETS points it at an older asset tree. - Same test on the old assets (9fd80b212's, MAGPIE_ROUTING_ASSETS): FAIL "the Routing loop kept asking for frames with nothing on its stage moving (26 frames in 400ms)". - Broken by hand (animation back on .rt-livedot): FAIL "the live dot pulsed with no request under way". Restored. - Routing GUI files, chromium and webkit, every language: 1104 tests, 1086 pass, 18 fail. Every one of those 18 fails the same way on the old assets in the same run (base 22 fail, new 20 fail on the reruns): routing-bodies "opens to its request and response", and under load routing-model-rest, routing-keys-fold, routing-request-metrics and routing-wb-restricted. All are in #2658 (and #2559). The one red only on the new side, routing-wb-restricted zh-TW 420px, passes rerun alone in both engines. Not tried: WebKitGTK, xrdp or llvmpipe. Playwright's WebKit is not WebKitGTK, so the CPU the reporter sees is not measured here. |
||
|
|
67f8dbb16c |
routing: the hidden tray panel no longer draws its Routing tab for every request (#2515)
The tray panel is hidden nearly all the time, yet renderPanel put up a
new head, stage and row list for every trace update (about 200 a minute
under 1 request a second), whichever tab was picked. A hidden page draws
no frames, so the infinite CSS animations on what each draw replaced
(.rt-livedot in the head, .pr-req.wait .pr-to > i on a waiting row,
.ps-dst.wait > i on the stage) were never dropped from the document's
timeline, and each held its detached tab, rows and all.
On the Windows box (WebView2, where a hidden panel reports
visibilityState "hidden"), magpie-gm sandbox, base build
|
||
|
|
75e769a9f9 |
routing: Free first spends the models that cost nothing before the ones that spend (#3054)
A provider or group can be routed `free`. Seats whose model the vendor serves at no cost to the allowance or credits go first, in listed order. The rest follow, also in listed order. Free means the vendor's own catalog.Model.Free word, or else a $0 list price on every count (provider.FreeModel). A pool with no free model behaves as In order. routes.Seat gains Free and Strategy gains ByFree. weighRouted works Free out only for a strategy that weighs by it, so other routings never read a model list for it. It is wired through every list a routing appears in: - both save whitelists; - plugins/rotation's Builtin; - app.js's ROUTINGS (appScriptBudget 1,269,000 → 1,271,000 for the description) and the Routing page's options, hints and trace text; - zh-TW, ja and de strings; - the TUI's routings; - the CLI's aliases (free, free-first). Written by keeuu (issue #3054, three commits), squashed onto |
||
|
|
588f87a126 |
gui: the Routing page measures a path again only when it moves (yg6888 on X: "打开页面很卡")
yg6888 on X: the Routing page lags, with 29 accounts in a group, nested
sub-groups and three agents sending at once.
Cause: every frame posed every flight, and each pose measured the paths
it flies along and the wire ends it meets with getTotalLength and
getPointAtLength, again on every frame. Each render also re-set every
via's "d" and formatted every row's token counts with a new
Intl.NumberFormat (toLocaleString).
Fix:
- measure() keeps a path's length in a WeakMap and measures again only
when its "d" changes.
- tip() keeps its result.
- A via's "d" is set only when it changed.
- pointAt() reads points measured every 8 px along a path, cached per
"d", and interpolates between them. The chord is off by under a
pixel.
- ledNum uses one Intl.NumberFormat per language.
- metaFit runs only when rows were redrawn.
Numbers: CPU profile of the page for 40 s under a busy sandbox gateway,
machine load ~250:
main thread rAF calls per call getPointAtLength getTotalLength ledNum
before 28.0 s 4047 6.9 ms 5.58 s 5.04 s 1.13 s
after 15.9 s 3635 4.4 ms 1.50 s 0.50 s 0
The GUI test counts per frame: ~15 lengths and ~27 points before, ~4
lengths and 13-16 points after. Paths still move during the rows' FLIP
slide and the agent tick, and they are measured again then.
renderHist's own time (~1.8 s) and getBoundingClientRect (~1.2 s) are
not changed here.
Test: routing-busy-frames.test.cjs, in Chromium and WebKit, en/zh/de.
It pumps three agents' requests and asserts fewer than 8 lengths a
frame, fewer than 200 formats, and token titles grouped in the page's
language. Red on the old client.js and app.js. Example green:
"chromium en 382 frames, 1519 lengths, 4864 points, 0 formats".
Run record, the three commits on origin/main
|
||
|
|
7916045591 |
library: RTK's tag for Grok Build and Grok App gives their own reason and rtk-ai/rtk#2136, not DeepSeek Harness's (新v学员 on Discord)
Every agent RTK has no hook for got dsh's tooltip on the RTK tab: "{agent}'s
hooks can only allow or deny a command, not change it" with
rtk-ai/rtk#3847 ("FR: Support DSH"). For Grok Build that is wrong twice:
the issue is dsh's, and Grok's PreToolUse hooks can rewrite a command
(updatedInput, shown on rtk-ai/rtk#1890). What holds is that rtk init has
no Grok agent (src/hooks/init in rtk v1.0.1 has none), and
rtk-ai/rtk#2136 is the open request for Grok Build (#4513 was closed as
its duplicate). Each link was checked with gh issue view; the others in
rtk.go (#3847, #3934, #4311, #3898, #4187, #3404) are right.
rtkNoHookWhy in plugins/library/client.js gives each agent its own reason:
dsh keeps its text and #3847, Grok Build and Grok App cite #2136 (Grok App
runs Grok Build), and an agent with no entry gets a reason with no link.
New strings in zh, zh-TW, ja and de. rtk.go's grok and grok-app reasons,
which the CLI shows, cite #2136 too.
TestRTKNoHookIssuesAreEachAgents fails when an rtkNoHook agent has no page
reason (or the reverse), when the page and rtk.go cite different issues,
when two agents cite the same issues without a reason in sharedRTKIssues,
or when the fallback carries a link. library-rtk-nohook.test.cjs checks
Grok Build's tag says #2136 and never #3847, DeepSeek or "hook".
Run in a worktree rebased on origin/main
|
||
|
|
e5b57794e2 |
routing: a rule's agent picker lists agents heard from and takes a typed User-Agent name (raikyou on Discord)
A rule can match a client magpie doesn't know, such as SillyTavern or someone's own app with its own User-Agent. The gateway already names such a client by its User-Agent's product name (usage.AgentOf), and a rule compares agents in lower case (cleanRules, MatchesBesidesIntent, Pauses). Until now the editor's agent picker listed only the agents magpie knows. The picker now lists the agents magpie knows, then the agents /api/usage?period=30d heard from that it doesn't know, leaving out "other" and magpie. The note on those reads "heard from in the last 30 days". The usage call is made once per editor and reads the cached SummarizeTop. A name typed in the filter is read the way the gateway reads a User-Agent: the text before the first "/", space or comma, in lower case. "MyApp/2.0 (Linux)" is myapp. A typed name that is already an agent's id is that agent. The picked name shows in the chip as the others do and is saved in agents:[…]. app.js's openPicker gains field.placeholder and field.typed for this; other pickers are unchanged. zh label: 筛选,或输入 Agent 名称… (notes: User-Agent 开头的名称, 近 30 天有请求). Strings are added in en, zh, zh-TW, ja and de. No backend change. The TUI takes rules as text (agents=…), so it already accepts any name. A typed alias of a known agent (claude-cli) isn't mapped to its id in the picker. Only an exact id is. Run at |
||
|
|
81a24cf8fe |
groups: a found group is listed as auto/<model id as the vendor spells it>
ZeroClover asked on X: Auto Group ids group/auto-<slug> can't be looked
up on models.dev. A found group is now listed and written as
auto/<model>, e.g. auto/claude-opus-5.5: /v1/models, the catalog, agent
configs, the GUI's Routing page and the CLI. Context and output limits
come from the model's metadata as before.
What stays the same:
- The internal id is still group/auto-<slug> (Group.Ref() gives the
public one). Every old form is still accepted as input forever:
provider.CanonicalRef turns auto/<model>[:level][[1m]] into it at the
gateway (validateModel), keys, stats, affinity and usage, so both ids
route to the same group and count as one.
- A key's model list allows a model by either id, group/* included
(allows() in key_models.go).
- Hand-made groups stay group/<id>.
- A provider whose stored id is "auto" keeps its models: while one
exists, found groups are listed by their old id (AutoRefsOn) and
auto/<x> means that provider's model. Documented in
docs/subsystems/gateway-routing.md.
Agent configs: SyncCatalog rewrites a field that holds a found group's
old id (renameFoundGroups), but only while the value is still what
applied.json says magpie wrote; a value the user set stays. A pick by
the old id written now is written as auto/<model> (Apply). Hidden,
picked and ordered model lists saved by the old id hold for the new one
(visible.go), and a bare model id still reaches its found group (bare.go).
Claude Code is given a dotted Claude version dashed (ClaudeSpelled), so
auto/claude-sonnet-4.5 sits in its settings as auto/claude-sonnet-4-5.
That routes to the same group, but with found groups off nothing reads
it back dotted, and Reseat took the field for changed and left the agent
on a group that was gone. Reseat now compares a group pick by its
canonical id (samePick). The old ids had no dots, so this is new with
auto/<model>.
Run at this tree (sandbox HOME, caches pinned):
- gofmt -l: clean. go vet ./...: clean on darwin, GOOS=linux -tags
nogui, GOOS=windows.
- go test -p 4 -timeout 45m ./...: every package ok except agent and
gateway, whose failures were the tests' expected ids (updated here)
and two regressions now fixed (bare ids; desktop models hiding groups
by prefix). Every failing test passes on rerun. Load average was
~210-290 from other sessions throughout.
- Reruns: provider, cli, codexcat ok. internal/gui: only
TestSetAnswersWhileDevinAndProvidersHang fails (set slow/slow-1 took
10.19s), and it fails the same in a git-archive export of
|
||
|
|
ef655acb40 |
gateway, gui: a console shows the routing of the magpie that serves the gateway (#2606, fatcutegg)
fatcutegg's patch (fatcutegg/magpie 40ceb22df). The routing trace is held
by the process that serves the gateway. A second magpie on this computer
(`magpie web`, or the app while a launchd `magpie serve` holds the port)
showed none of it. Now its console reads the serving magpie's
GET /v1/magpie/trace (and /v1/magpie/concurrency for the lanes) over
loopback, and plays that trace as its own. The heading names which magpie
is routing ("serve (pid N) is routing").
Reviewed as a community change. A trace names accounts and emails, session
ids, a folder's last two parts and error text. It holds no prompt text and
no key. The endpoint answers local(r) alone: a request from another address
gets 403, and so does a loopback request carrying a proxy or Tailscale
header, or a LAN request while the gateway is shared, whatever key it holds.
lanGuard and corsGuard stop rebinding Hosts, Origin: null and *.localhost
first, as on every route.
Changed on top of the patch:
- A gateway key held to a budget, models or accounts is refused with
KeyHeldCode (refuseHeld), as concurrency and quotas refuse it.
- The console reads loopback alone (ownerURL). A non-loopback MAGPIE_ADDR is
never asked, and 0.0.0.0, :port, [::] and localhost are read at
127.0.0.1.
- OwnerTrace lets a hung magpie go at wait+5s (was +20s). OwnerLanes waits
700ms like ServedBy (was 2s) and is asked only when a magpie answers.
- `/` tells pid and serves to a loopback request alone. A plain `magpie`
that opens the TUI reports itself as "tui".
- Takeover: in the real two-instance run, after B took the gateway over the
hub still read "serve (pid A) is routing", from the providers state. Now
the trace carries `by` (pid, serves), and the page names the router from
it. When `by` changes, the page drops its routes and reads the new
magpie's whole trace, so route ids from two magpies never mix. The
label's full text is in its title, because the node cuts it with an
ellipsis.
- Trace's doc comment, which the patch had orphaned, is back on it. Docs
(gateway-routing.md, gui-shell.md) say all of the above. Issue
references are #2606 (were #110).
- Tests: a proxy-header subtest, TestOwnerReadOnLoopbackAlone, the trace
added to TestHeldKeyToldNoAccounts, and `by` / pid / serves asserted in
both packages' peer tests.
Run:
- Each guarantee broken by hand, and its test went red: refuseHeld removed,
ownerURL returning MAGPIE_ADDR, local(r) replaced by a RemoteAddr check,
pid/serves dropped from the answer, `by` dropped in OwnerTrace, and the
console's OwnerTrace fallback turned off.
- A real sandbox (own HOME, ports 3591-3593, fake upstream on 3564):
- A `magpie serve`, B `magpie web`. B's Routing page played A's routes
live (the long poll counted 3 requests through A).
- Probes of A's /v1/magpie/trace. 200 from plain loopback. 403 for
evil Origin, Origin: null, evil.localhost, a rebound Host with and
without Origin, x.localhost Host, X-Forwarded-For and
Tailscale-User-Login.
- A LAN-shared instance answered 403 from 10.0.0.111 even with a valid
key, and gave no pid on `/`.
- Killed A: B took over in ~11s. The hub dropped the "is routing" label,
and the next request through B showed as a fresh trace (1 request).
- Chromium and WebKit screenshots at 1280 and 390 wide, in en, zh and ja.
No horizontal scroll.
- gofmt -l clean. go vet darwin, GOOS=linux -tags nogui and GOOS=windows
pass, and all three builds pass.
- go test -timeout 45m ./... at this tree (sandbox HOME, load 250-400):
every package ok except four.
- agent, gateway and library hit 45m in TestClaudeTierPickedAsTheMainModelStays,
TestQueuedStreamKeptAliveOnceSentToItsVendor and TestWellKnownKitGrouped.
- plugin failed TestGatewayHookMixedPiPackage (#2865).
- Rerun alone with -p 1: plugin ok (464s). gateway finished in 45m with
one red, TestRequestBuildsProvidersOnce, a 900ms/1s timing window under
load. It is 8/8 green alone here and on origin/main
|
||
|
|
b0b0764210 |
gui: a routing rule's ⋯ is always shown, and a rule Save refuses for having no condition says so under it, with how to add one or remove it (ppBruce on Discord)
ppBruce (v0.1.1290): in a routing group's editor "once a rule is added there is no delete button, and a rule with empty conditions can't be saved". Two causes: - The rule's ⋯, the only way to Remove rule (and move a rule), was opacity 0 unless the row was hovered or focused ( |
||
|
|
a77ecbf8a1 |
gui: models of one provider named alike say what tells them apart (sunset on Discord)
sunset (#feedback, 10-19): with the Our Free Model plugin the provider editor's chips read "DeepSeek-V4.1-Flash · x0.1" three times over; the ids (buddy/…, cline/…, kilo/…) told them apart only in the tooltip. modelTells(items, label, id, key) finds, among the models of one list (and one group, for a picker), those that would show the same label, and gives each the part of its id that tells it from the others: the segments left after the ones all of them share at the front and back are taken off, the whole id when that isn't enough or is empty. A label no other model has gets nothing, so every list that was fine is drawn exactly as before. The tell is quiet secondary text after the name (.mtell, muted, never the accent of a pick); where only plain text fits it is " · tell". No new control. Where: the provider editor's model chips, the detect sheet's chips, an account's model chips, the fallback list and its suggestions, every openPicker list (agents' model menus, Settings' model pickers, Routing's member and classifier pickers; worked out per group, so one name under two providers says nothing), and the Routing page's member names and labels (routing/client.js). Routing keys its groups by the model's provider, or its provider's name where a list carries only that, so one name under two providers says nothing there either. Run (tree at 818007045 on |
||
|
|
f73378365f |
gui: a filter a click set on Usage's Requests goes when they are left (TJHHHH on Discord)
TJHHHH: after a jump to Codex's requests on the Usage page, every later
visit listed only Codex's. The Requests' filters are module state in
plugins/usage/page.js and nothing ever reset them, so a click on Codex in
the ranking split by agent stuck for the app's lifetime.
Now a filter a click lent the Requests (a ranking click on an agent,
provider, model or gateway key, a chart day, the address's ?agent= and
the like, a route from Routing) is remembered in ledLent and given back
by ledLeave when the reader leaves the Requests: for another Usage tab
(renderUsageTab), or another page through a new page hook, `leave`, that
show() calls on the page it leaves. A filter picked in its own menu or
typed in the search stays, as a menu choice does in a Mac app. A route's
saved filters keep their lent marks, and leaving with a route on gives
back the route too. Docs: plugin-runtime.md's Usage hooks.
Siblings judged and left: the tray panel's Usage tab ranking (its own
view, not the page's Requests), the Sessions reveal (per agent, no "all"), the KPI
failed/retried jumps (shown in the status segment, read as own picks).
Test: tests/usage-ledger-leave.test.cjs, chromium and webkit, en zh
zh-TW ja de: ranking click leaves for a page and for a tab, menu pick
stays, ?agent= goes, a route goes. On the old app.js/page.js/client.js
it is red, 20 of 25 in chromium ("back from another page: last asked
period=today&agent=codex"); only the menu-pick case passes there.
Green with the fix, in both engines.
Run at
|
||
|
|
b749cffbb1 |
gateway: a reply asked past what the window leaves is asked again for what it leaves, not failed as too long (molvqingtai, da34, Jeremy.Zhou on Discord)
DeepSeek counts the reply asked for (max_tokens) in its 1M window with the prompt: "maximum context length is 1000000 tokens. However, you requested N tokens (P in the messages, C in the completion)". Since |
||
|
|
9fd80b2128 |
library: skills install from any git repository, GitLab and a company's own among them (sunset on Discord)
ProbeSkills took only a GitHub source or a folder. It now also takes any
git repository's address: https/http on gitlab.com or a self-hosted
server (any depth of groups), a GitLab or Gitea page of a folder
(/-/tree/<ref>/<path>, /-/blob/..., /src/branch/...), ssh://,
git@host:group/repo.git, a bare host.name/group/repo, and file://.
Such a source is kind "git" (gitSource, skillgit.go).
It is fetched with the user's own git (proc.FindTool), so their
credential helpers and SSH keys reach an intranet host: git init, then
fetch --depth 1 --no-tags -- <url> <ref|HEAD>, checkout FETCH_HEAD into
a magpie-skill-* folder, .git removed; the same keepProbe/maxFetch path
GitHub's tarball takes.
What the user typed is data: an address starting with - and any
transport:: address (ext::, fd::, file::) are refused before git runs;
the address follows --; git runs with protocol.ext.allow=never and
core.symlinks=false, no shell, GIT_TERMINAL_PROMPT=0, and ssh -o
BatchMode=yes unless the user set their own SSH command (GIT_SSH,
GIT_SSH_COMMAND, core.sshCommand), so a sign-in it can't make fails
instead of waiting. An address with a password or token in it is
refused: library.json is shown and backed up. Git missing, a sign-in
refused, an unknown host key, a missing branch and an unreachable host
each say so plainly (gitError).
Updates: Commit keeps the repository head the skill was fetched at. A
check runs git ls-remote; another head is fetched (once per repository
and ref) and the skill's folder hashed, so a commit elsewhere in the
repository leaves it current and moves Commit on. UpdateSkill and the
edited-skill refusal work as for GitHub; EditedError and the page's
Changed here / Update / replace question name the repository instead of
GitHub. findNew, Group again, icons and the market stay GitHub's only
(documented).
Page, TUI and docs: the add box's placeholder in en/zh/zh-TW/ja/de
(zh: owner/repo、GitHub 或 GitLab 链接、任意 git 仓库地址,或本机上的文件夹),
a git skill's source shown as a link (https) or text (SSH), its own
Update and Check for updates; the TUI's prompt; library.md's Skills and
Skill updates rows. GIT_SSH/GIT_SSH_COMMAND are listed in agentenv's
notAnAgent (TestFolderVarsAreListed).
Tests (fail on the old code: gitSource/gitPath don't exist there, and
skill-git-source.test.cjs fails on the old assets' placeholder, checked
by stashing client.js/i18n.js): TestGitSourceReads,
TestInstallFromGitRepo (a local bare repo over file://: probe, install,
check finds an update, update, a commit elsewhere stays current, an
edit here is refused naming the repo), TestGitTreeURLInstallsFolder,
TestGitMissingSaysSo, TestGitSignInRefusedSaysSo (a local httptest 401,
GIT_CONFIG_NOSYSTEM so no Keychain), TestGitRefusesOptionsAndTransports,
TestGitErrorsSaid. No test reaches the network.
Run (worktree at origin/main
|
||
|
|
b9f790d37b |
plugins: panels in magpie's pages, a page that replaces a built-in one, titles in the window's language, and a look that matches
P5 of the plugin runtime (docs/subsystems/plugin-runtime.md):
- Panels (magpie.panels): a plugin draws a frame into a slot of a
built-in page (a provider's editor, Settings, Usage); magpie.context
says where it is, and the frame is as tall as what it draws.
- A page can replace a built-in one (magpie.page.replaces); show() opens
it in that page's place, and the sidebar row goes to it.
- page.titles and a panel's titles name it in the window's language
({"zh": …}); a malformed map is dropped, the title kept
(TestWindowTitles).
- main's #2501 already names wails:// in the policy of a page in the
desktop window (through ownWindow), which is why the usage page drew as
bare HTML from v0.1.1259. TestPluginPageLoadsItsFilesInTheWindow loads
a page through ownWindow in a real WKWebView, which Playwright on http
can't; the subsystem page says how.
- The bridge adds magpie's look for what a page leaves unstyled, every
rule in :where() so any rule of the page's wins, and the theme's
colours as --magpie-* variables.
One commit: the panels, the replacing pages and the titles share hunks
in page.go, pluginpage.go, pluginpages.js and the docs, and couldn't be
split cleanly.
Run:
- Full: this series (P5, the Plugins dot, the probe test, P6, and a
built-ins-on commit since dropped for main's own
|
||
|
|
5a2414acdd |
plugins: every built-in plugin starts on, a new install's too
The owner (10-17): "所有的内置插件默认都应该是开启的", "尤其对新用户来说…… 不然新用户都不知道有哪些功能". Since |
||
|
|
717b69f78a |
routing: a conversation held to its native compaction's account says so, not "the only account on" (#2639)
A turn carrying a native compaction goes only to the account that
sealed it, so the route's order has one account, and Routing's first
line read "{who} is the only account on for {model}". On #2639 that
read as the other account not serving the model. The route now names
the sealer (Route.Compaction, compactionWho), and Routing says the
conversation stays on it because only it can read the compaction, and
that a new conversation uses the others. Translated in zh, zh-TW, ja
and de.
Run on origin/main
|
||
|
|
04e8aa8f10 |
library: typing with an input method no longer moves the page (#2636)
In Library -> Instructions, typing Chinese through an input method made the
page jump up or down while a word was composed. The cause: the textarea's
autosize set height:auto to measure scrollHeight, so the page went short for
a moment and the browser clamped the view's scrollTop. Putting the height
back doesn't undo a clamp. app.js's scroll guard took the clamp for a scroll
the reader didn't make, and its scrollIntoView({block:"nearest"}) pulled a
textarea taller than the view to one of its edges. Every composition step is
an input, so this happened on every keystroke.
autosize (the only one in the GUI, used by a set's text, an agent's own
text, a skill's description and subagent boxes) now holds the textarea's
parent at its height while measuring, so the page never goes short.
What was run:
- New internal/gui/tests/library-ime-scroll.test.cjs covers en/zh, 980/560px,
a Default set's text and Cline's own text. Chromium composes through CDP
Input.imeSetComposition/insertText. WebKit gets synthetic
composition events and inputs.
- With the fix: 9/9 in both engines, before and after rebasing onto
|
||
|
|
17557132cb |
gui: in a narrow window the title bar's tools show their icons, then the title gives way; nothing lies over it (#2625, linusxiong)
Beside the sidebar, Library's, Plugins' and Settings' heads sit in the
title bar after the breadcrumb, between --tools-l (the crumb's right +
16) and the window's buttons, laid out flex-end. When the tools needed
more than that room they ran on to the left, over the crumb: at about
650pt with the sidebar, Library -> MCP servers had 「发现」 over
「MCP 服务器」's last character. The crumb never gave way to them.
app.js tools() now shares the room out, laying out and reading each
step in its one frame, the next only if the tools still run over:
1. the crumb whole (its natural width from its parts, the last one's
scrollWidth) and the tools with their words;
2. body.tools-tight: Library's Discover / Library folder / Backups and
Plugins' "Mirrors in China" show their icon (or switch) alone. Each
keeps its name as aria-label (a hidden span leaves the accessible
name) and its tooltip as before (the folder's path, the backups'
note and path, Discover's and the mirrors' sentences);
3. --crumb-max: the crumb drops its leading parts ("Work /"), a part
and its slash at a time, and last cuts the page's name at its end.
In the side-nav head the Library buttons and the mirror switch are
flex: none and Plugins' search keeps 120px, so what doesn't fit shows
as running over rather than shrinking out of sight. The views'
MutationObserver also asks tools() again, as a tab's own tools change
(Discover only on MCP servers and Skills) without the crumb resizing.
title-bar-tools.test.cjs (new): every Library tab, Plugins' three and
Settings, sidebar picked, window mode, at 560 (the window's least),
650, 760, 900, 1024 and 1280px, in zh, zh-TW, ja, de and en, Chromium
and WebKit. No tool lies over the shown title or another tool or out
of the bar, no label is cut, an icon-only tool has aria-label and
title, only leading crumb parts go and the page's name shows, whole
from 650px. Against the old assets (MAGPIE_GUI_ASSETS) it fails in all
five languages at 560px Library Instructions ("a tool lies over the
title"); with the change Chromium 5/5 and WebKit 5/5. Looked at
screenshots of zh Library MCP servers and Plugins Discover at 560, 650
and 760px.
docs/subsystems/gui-shell.md says how the title bar gives way.
Run with both #2623's and #2625's changes, on
|
||
|
|
333c167575 |
routing: a rule can set the reasoning its model is asked for (#2633)
dengtongcai asked for a routing rule that picks both the model and the reasoning it is asked for (a quick question goes to a cheap model at low). A rule now has an output field, useEffort (low|medium|high|xhigh|max). When the rule matches, its member is asked for that effort. A member's own fixed effort still wins. Otherwise the rule beats the model's suffix, the turn's pick and the agent's pick. The existing effort condition is unchanged. - The value is fitted to the model's levels (max -> high on a model that tops out at high). A model with no Efforts is sent what the agent asked, untouched. Unset changes nothing. Failover members are not affected. - The trace records it: Rule.UseEffort and the try's RuleEffort (the second Try construction in the candidate loop was missing it). - Saving a group rejects an unknown value or one on a pause (cleanRules). The CLI takes use-effort=; the TUI and CLI lists show " at <effort>". - GUI: a chip after the rule's model, picked from the app menu (pickFrom, no native select), set/changed from the rule's menu. A pause clears it. Strings in zh, zh-TW, ja, de. - A Gemini-protocol client is left unchanged, as with every effort magpie sets. - Docs: docs/subsystems/gateway-routing.md; site docs intent and start (en, zh, ja). What was run, at d4c03a2c5 (rebased on |
||
|
|
a4fa7bbd8c |
gui: "Waiting for a request" is a core word, and app.js's comment no longer says "New group" (#2586)
i18n-keys' "a plugin's words are its own" was red on main |
||
|
|
2c72563dd1 |
usage: Requests splits and filters by gateway key, with "No gateway key" for the calls none made (#2521)
MauriceCarlo asked for two things on Usage → Requests. 1. The gateway-key filter should show even when one key has calls. The picker hides itself under two options, and with one key it had one, so calls made with that key couldn't be told from calls made with no key. A "No gateway key" choice (callerKey=none) now sits beside the keys whenever the period has calls with no key, or it is the current pick. A single key's picker therefore shows and separates the two. The hidden condition itself is left to #2499, which another session has. 2. The trend chart and the ranking can split by gateway key. LED_SPLITS gains "Gateway key". It's offered only while the period has a key's calls, and it falls back to Model otherwise. A click on a rank row picks that key, or none, and a second click lets go, as the other splits do. Server: - usage.Dimensions gains "callerKey". A row's key is its CallerKeyID, or NoCallerKey ("none") when it has none, and the filter takes "none" as calls without a key. - Filter.Without(d) is the one place that clears a dimension's own pick, so the by-split lists every value. RequestPage's fast and slow paths both use it now; they each had their own switch. - usageapi names the split's shares from the key labels: "No gateway key" for none, the ID if a key was deleted. - OwnPage keeps a held key's view to its own share in by and in the chart's split, so one key never learns another's name or numbers. The series was already only its own rows. - docs/reference.md documents callerKey=none and by.callerKey. "No gateway key" goes into the core i18n.js. The gateway keys page says "No gateway keys yet", and i18n-keys' "a plugin's words are its own" matches on substrings. Tests: - TestCallerKeySplitAndNone runs the fast and the slow path over {}, one key, none, and none+an agent, and checks by.callerKey. Broken by hand, it goes red: once with the none clause in the filter removed, and once with Without's callerKey case removed. - TestUsageOverGateway: on loopback the split names both keys. A held key's by.callerKey is only its own. With the OwnPage scrub skipped, it goes red (another key's name leaked). - usage-ledger-key-split is new, in both engines, all five languages, and 1400 and 760 px. It checks: - the picker's options with the none choice; - filtering on none; - the split's rows, and a click picking and letting go; - no sideways scroll; - that a period with no key's calls shows neither the picker nor the pill. 32/32 pass. With the none option removed by hand, 11 go red. Run on origin/main |
||
|
|
dc1a9cde27 |
gui: Usage → Requests lists the first token's time in a column of its own (#2522)
tianxia3111 asked to compare time to first token down the request list (首字时间). Until now it showed only inside a row's details and the Duration tooltip. A "TTFT" column (zh 首响, zh-TW 首響, the word the row details and Routing already use) now sits before Duration. Its header tooltip reads "Time to first token". A row told from a session file's times gets "≈", like Duration does. A row with none (not streamed, or failed before a token) shows a faint dash, not 0 ms. Narrow windows: ledFit used to have two stages, tight (Sent, Effort, cache) and tighter (the price reference, shorter names). The new column pushed the reporter-sized 975px window of #860 into tighter, so the price reference went. A stage between them, tight2, now hides only the TTFT column (LED_COLS opt level 2 → .lc-opt2). The hint then says the first token is in each row's details too. "TTFT" and "Time to first token" go into the core i18n.js, not the plugin's. Other code says those words too, and i18n-keys' "a plugin's words are its own" would fail otherwise. Tests: - usage-ledger-ttft is new: the header and its tooltip, the value and the dash, the ≈, and the column leaving at a narrow width with the hint. It runs in both engines and all five languages, 12/12. - usage-ledger's column lists and usage-speed's narrow hint are updated, and usage-ledger-detail finds Duration by its class. - The staged tree alone (index checked out): i18n-keys, usage-ledger-ttft, usage-ledger, usage-speed and usage-ledger-detail all pass, 61/61. Run on origin/main |
||
|
|
78827954fb |
routing: with routing groups off, the Routing page says so and turns them on (bigbenniu on X)
bigbenniu on X: on a new install the Routing page had nothing past its
requests, no New group and no word of where it had gone. A new install's
Essentials preset leaves the "groups" built-in off, and everything marked
data-feature="groups" was hidden without a trace.
Now an element can be marked data-feature-off="<id>", the other way
round: featureStyle shows it only while that feature is off. Where the
routing groups were, the Routing page shows such a note: routing groups
are off in Plugins › Built-in, the groups magpie finds still route, your
own can't be made or changed here; and a "Turn on routing groups" button
that posts plugins/builtin {id:"groups",on:true}, applies the answer and
reloads the groups. It sits after the groups' own rows, so their order
(group-found-off's check) is as it was. Strings in zh, zh-TW, ja and de.
Run:
- internal/gui/tests/routing-groups-off.test.cjs (new), Chromium and
WebKit, en and zh, 900 and 420px: groups off shows the note and its
button, New group and the groups hidden, the note fits the window;
the click posts {id:"groups",on:true}, the note goes, the groups and
New group come back, the status says so; groups on shows no note;
every new string in zh, zh-TW, ja and de. 18/18 with group-found-off.
Red by hand two ways: without the note's data-feature-off (6 of 7
red in Chromium), and without featureStyle's data-feature-off rule
(6 of 7 red). Screenshots looked at, zh 900 and 420.
- 119 GUI files (routing*, group*, panel-routing*, builtins, *-off*):
all pass but routing-bodies (10) and routing-keys-fold (5), which
fail the same 15 on a fresh origin/main
|
||
|
|
fa5295d011 |
panel: a Manual routing group's model is switched from the tray panel (#2489)
Jerell.OvO asked on Discord (#general) to change a Manual group's model
from the tray's dropdown. Until now that worked only on the group's card
on the Routing page or with `magpie group pick <id> <model>`.
- provider.PickGroup(id, pick) sets a Manual group's Pick and nothing
else. It refuses a group that doesn't route by hand, a model not in
the group, and an unknown or hidden group.
- POST /api/groups/pick {id, pick} calls it and answers with the groups'
state. The panel doesn't send the whole group back the way the card's
save does, so a stale panel copy can't overwrite an edit made on the
Routing page in the meantime.
- Tray panel, Routing tab: under today's totals, one row per Manual group
of two or more members that is on. The row has the group's name and its
picked member as a sess-pick button. The button opens the app's menu
(openProtoMenu, no native select), headed "Model every request goes
to". It lists the members with the card's notes ("fast", the provider,
and "no provider serves it now" for one not ready), and the picked
member is ticked. Picking the ticked one posts nothing. No new layout,
no left border.
- The tab reads the groups again when it is shown, and loadGroups redraws
the panel. A pick made on the Routing page or from the CLI shows here.
- New string in zh, zh-TW, ja, de.
Tests:
- TestPickGroup (provider): switches and routes to the new member, keeps
the rest of the group, refuses the three cases and changes nothing
then. Red with the `g.Pick = pick` line removed.
- TestGroupsPick (gui): /api/groups/pick answers with picked = the new
member and refuses a non-member.
- panel-routing-pick.test.cjs: a 440px panel in Chromium and WebKit, in
en, zh, zh-TW, ja and de. 10/10 pass. Red with the row left out of
renderPanel. Screenshots were checked in de (web) and zh-TW and en
(app).
- gofmt -l clean; go vet -tags nogui for darwin, linux and windows: clean.
- GUI subset (panel-*, routing-*, i18n-*, header-relang,
agent-notice-lang; 1199 cases) on 63be47717+this: 1175 pass. Each red
was rerun file by file on this head and on a clean
|
||
|
|
af601541ef |
routing: a request opens to its request and response (Fate on Discord)
Fate asked on Discord to see what a single request on the Routing page sent
and got back, such as a Codex prediction. The bodies were captured already,
in the Gateway page's 40 recent calls and the opt-in request archive, but
nothing led there from a Routing request.
- gateway: a Call carries the Routing request it was (Call.Route = the
trace's Route.ID), set where serve, the Codex backend and a refused title
record it. Server.RouteCall finds it in the ring. A route id is not a
call id. A route names its archive copy (Route.Archive =
call.archiveName()), set only when the archive was on, so it reaches the
saved history too.
- gui: GET /api/gateway/call takes ?route= besides ?id=. It is the same
handler, the same no-store, the same key guard and the same 404 once the
ring has let the call go.
- Routing page: the story's head has "Request and response". It fetches
only when pressed, and shows the masked bodies through callBodyPanel (an
SSE reply reads as its events). A request the ring no longer has shows
the archive's copy through archivePanel when the route names one.
Otherwise it says the last 40 are kept until magpie quits and how to turn
the archive on. Nothing more is captured or kept than before.
- The head now wraps. At narrow widths its buttons ran past the story
("Back to live" was cut off at 440px).
- The two button words live in i18n.js: i18n-keys' "a plugin's words are
its own" found them inside core strings.
- docs/subsystems/gui-shell.md says how a route reaches its bodies.
Tests:
- TestRoutingRequestOpensItsBodies (new): each of two routes gets its own
bodies; route 0 and an unknown route get 404. Red without
`call.Route = tr.ID` ("route …: 404").
- TestArchiveWholeBodies now checks that the route names the archive. Red
without the t.Archive line (`route names archive ""`).
- routing-bodies.test.cjs (new), chromium and webkit at 440px, en, zh,
zh-TW, ja and de, 10/10. It covers the ring's copy read only when asked,
hiding, another request closing it, the archive's copy, the
how-to-keep note, nothing past the story and no left border.
- Red with the client asking ?id= and with the head's wrap removed.
- routing-request-metrics.test.cjs: with the head wrapped, its 480px
picker clicks in WebKit landed on the footer. Playwright's WebKit places
elements in the scrolled view hundreds of px lower than
getBoundingClientRect, which elementFromPoint agrees with. The test now
clicks where the page shows them. 5 runs of both engines, 20/20.
Run in a sandbox HOME at
|
||
|
|
6f92815335 |
routing: each try says where its time went: magpie, the network, the vendor (Discord, Magic_zero)
A user read a slow turn as the gateway being slow. The try loop's
httptrace now also records DNS, connect, TLS, GotConn (reused or not)
and the first response byte. Each Try keeps a TryNet ("net"): magpie's
own time, requests made before it, the wait for a pooled connection,
DNS, connect, TLS, sending, the vendor's wait for its first byte, and
Head (from the try's start to that byte). A Route also carries the usage
record's Sent/Own/Retried/Queued split. Usage records are unchanged.
The Routing page's story shows "Where the time went" under each finished
try. It is one stacked bar plus named values, in three groups (magpie,
network, vendor): Waiting for a slot (tr.queued, which was never shown
before), In magpie, DNS, Connecting, TLS, Sending, Vendor (first byte),
First token, Streaming. Parts that took no time are left out. The
strings are in every language. "Waiting for a slot" moves from the
Usage plugin's i18n into i18n.js, since Routing uses it too.
Not covered: plugin providers (and any other request sent by something
other than Go's client). Their request goes out through the Bun host's
fetch, so no httptrace fires. Such a try has no net and shows no
breakdown, only the time it took, as before (and so does a trace from
before this change).
Run (worktree at origin/main
|